Tag: Refactoring
-
Worms infested my code base and I am fighting back
The sabberworm/php-css-parser used to be bundled with the horde/css-parser library. Supposedly the one is a shield before the other, separating the code base from this particular beast. But over time it crept in and infested various places. How to fight back It’s time to teach the worm some manners and throw it out where it…
-
Time, it needs time
As I am writing this, bug reports from users are coming in on last night’s updates to Turba Addressbook. In Turba we first rolled out our new way of date handling and upgrading existing user-selected date formats in backends. The initial results were … mixed. Horde comes from the strftime era, a way of formatting…
-
Modernizing horde/text_diff
If you ever read a github pull request or similar extension proposal, you will likely have seen side by side comparisons of the original and the changed file. You may also have seen some text format that highlights only differences and a little context but hides the unchanged rest of the file. Both of these…
-
Code Generators: Bad, worse & ugly
Code generators have been invented and forgotten at least four times in software history. They have an appeal to developers like the sun to Daedalus’ son. Let’s not be Icarus, let’s keep them generators at a distance and watch them carefully. Whenever a language, framework or paradigm forces developers to do the same thing over…
-
Tools to build better Tools faster
Behind every lofty architecture mantra there is mundane execution. This is best left to tools and I don’t mean anybody in particular but programs that help us make better programs. It basically goes like this: Build tool. Use tool. Build better tool. Build tool to build better tool. Build better tool to build better tool…
-
Why you should develop for latest, greatest
Developers sometimes choose not to use the latest available language features that would be appropriate to tackle a problem for fear of alienating users and collaborators. This is a bad habit and we should stop doing that. Part of the solution are transpilers. What are transpilers, where are they used and what is the benefit?…
-
Horde/Yaml: Graceful degradation
Tonight’s work was polishing maintaina’s version of horde/yaml. The test suite and the CI jobs now run successfully both on PHP 7.4 and PHP 8.1. The usual bits of upgrading, you might say. However, I had my eye on horde/yaml for a reason. I wanted to use it as part of my improvements to the…
-
PHP: Tentative Return Types
PHP 8.1 has introduced tentative return types. This can make older code spit out warnings like mad. Let’s examine what it means and how to deal with it.
-
Horde/Skeleton: Modernized
Over the last months, a lot of new technologies have entered the Horde ecosystem. It was long overdue to modernize the Skeleton example app. No more un-namespaced code Skeleton has completely migrated to PSR-4 namespaced code in /src/ rather than traditional, unnamespaced code in /lib/. This includes framework integration classes like Application, Api, Ajax\Application but…
-
Horde’s HTTP component goes PSR
This weekend, I gave the horde/http component a some major redesign. See how things escalated. Oh my. My minimum goals were namespacing, PSR-4 (Revised Autoloading Standard) and some minor, schematic adjustments. The final result is quite different. I ended up implementing PSR-7 (HTTP Message Interface), PSR-17 (HTTP Factories) and PSR-18 (HTTP Client). The code largely…