Posts tagged with pragmatism

Airplanes and Ashtrays

Harry Roberts makes the case for making technical debt visible instead of trying to hide it.

This means that, although far from ideal, the impact of these hacks is well contained and signposted, meaning that they won’t slip through the cracks and remain hidden in the codebase for the next five years.

This pragmatism and lack of stubbornness can make your codebase much more malleable, resilient, and ultimately much more useful. Everything is a compromise.

https://csswizardry.com/2017/10/airplanes-and-ashtrays/

Read more

Partitioning for concurrency in synchronous business processes

On his blog Frank De Jonge, member of the PHP League and creator of Flysystem, explains a cool pragmatic solution how to ensure queued processes for the same user complete in the right order.

The use of multiple workers allows for much higher throughput, but it also allows for race conditions during processing. When messages for the same user are sent to different workers, handling order can no longer be guaranteed. Therefore we have failed to fulfil our business rule.

If we were able to ensure every message from the same user were sent to the same worker, the worker could ensure those messages are handled in order while the system as a whole would still benefit from the degree of parallelism. But how do we make this happen?

https://blog.frankdejonge.nl/parallelise-synchronous-business-processes/

Read more

Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

No spam. Unsubscribe anytime. You can also follow me on X.

Elegant form handling in Laravel

Michael Dyrynda, co-host of both the excellent North Meets South podcast and Laravel News podcast, wrote a short article on how he pragmatically manages forms in a Laravel app.

I personally feel that I'm not gaining anything by bringing in another package just to handle generating HTML on my behalf when it's just as fast to use the tools available to me in my editor. It also means there's no implied knowledge of a now non-standard external package, should a new developer be brought on to the projects that I've worked on. HTML is HTML, after all.

https://dyrynda.com.au/blog/elegant-form-handling-in-laravel

Read more

Pragmatic coding

Stefan Koopmanschap argues that, besides writing beautiful code and using kickass frameworks and libraries, we should be able to do some quick and dirty coding as well.

Can you write me a simple script that fetches some information from an RSS feed and displays the titles? Like, just write me that script in a couple of minutes. I don't care about tests, quality, etc. Just get me the information, quickly.

http://leftontheweb.com/blog/2017/01/04/pragmatic_coding/

Read more

Does code need to be perfect?

Andreas Creten explains his view on wether you should always try to write perfect code. Spoiler: no.

The engineers want to write perfect code using the latest techniques, make sure that the code is well documented so they can fully understand how everything works and that it has tests so they can easily update things later. Product owners on the other hand just want things to be done, fast and cheap, so they can ship new features or convince new clients. How can you make these conflicting views work together?

https://medium.com/we-are-madewithlove/does-code-need-to-be-perfect-a53f36ad7163

Read more