Timeline Taxi Out now: my sci-fi novel Timeline Taxi is published!

I don't write code the way I used to

I turned 30 last week, and it made me realise I've been coding for more than half of my life now. I took a moment to reflect on my programming skills after a decade, and realised that 20-year-old me would probably facepalm if he'd seen my write code today.

First, I gave up on most abstractions. Oh, how young-me loved them. For present-me, abstractions are becoming more and more of a rarity. I just find that 95% of problems don't need abstractions, they are better to be solved in place. I remember I reached for abstractions whenever a problem could possibly need it, instead of when I actually needed it. I don't do that anymore.

Second, I find myself liking a functional mindset more and more. It's just simpler. I find it comfortable to split data and functionality, to keep my code as flat as possible. I'm still using classes and objects and their internal state, but overall these objects are looking more and more like functions: data goes in, data comes out. That's it.

Something I'm less proud of: testing is still a struggle. I don't really understand why. I know testing makes my life easier. I know it's good in the long run. And still, there's always a barrier to cross. In part, I think it's because of the friction and overhead that comes with testing frameworks, the setup, mocking, faking data, … It's really a shame that testing doesn't come more natural to me. I force myself to do it — and it always pays off — but still…

Next, I'm using less fancy shorthands. I don't care about clever oneliners anymore. I'd prefer to write a verbose if/else statement over cramming the same functionality in one line of code. Less is not always more.

Another realisation: I can't live without static analysis anymore. I remember using Sublime for the first 2 or 3 years of my professional programming career, but I don't understand how I made that work. Have I become lazy? Too reliant on my tools? I don't think so. I think I've optimised my toolchain to serve me better over the years. Let the computer do the boring things for me, I'll focus on the things I like.

Finally, I'm still using PHP. It has its quirks, it's old, it shows, I know. And yet… it's ok, it gets the job done. In fact, I like the language much more today than a decade ago. I think the past ten years have been great for PHP.

Here's to the next ten 🍻!