What the hell was I thinking

“What the hell was I thinking?”; “Huh?”; “Who’s the fucking idiot who did this?.. oh. It was me…”.

Three questions every developer / coder / programmer / whatever-er asks themselves from time to time.

And I am definitely no different.

I built an initial version of a web-based tool for work some time ago. I built it with some speed to get it done as quickly as possible. But I should have taken longer and focused in more on the ongoing code quality.

I wrote tests from the get-go, but I let it slip a little when I would dip back into the project for little updates and tweaks across the last twelve months.

The other day I ran a static analysis tool over the project for the first time.

Christ on a bike.

So for the past day or so I’ve been battling hard to climb up the 9 rung ladder to the highly sought after status of level 9 all green. (Larastan/phpstan this is).

I’m currently on level 7 with about 15 errors to fix.

I have found that from implementing the fixes — many of which have been type hinting and generics-related — I am understanding the code — and the underlying framework Laravel — much better.

I’ve even found a very odd design decision in Laravel. The `auth()->id()` method can return either of the following:

  • int
  • string
  • null

Why not just “int” and “null”?

Anyway.

It’s been fun and I’m looking forward to fighting through level 8 before defeating the final boss — level 9 All Green. 🟩🟩🟩🟩🟩

What to write about

I’m having a great time keeping up to date with the blogging journey of a friend of mine.

And I mean keeping up — he must post at least three times a day.

And I have found it inspiring.

I used to write often back when I’d commute to work. But weirdly since working remotely I have written less. I suppose it’s not surprising — at home I have many things to pre-occupy myself.

But I want to start posting more often. Maybe not three times a day, but much more often than i do.

I do tend to post my daily Wordle plays, but I’m not counting those.

Who knows how this will go. Or even if it will go.

Let us see.