Two moments stand out where I lost track of time completely:
- Writing a roleplaying-games initiative trackerIn Tabletop Roleplaying Games (TRPGs) like Dungeons and Dragons (D&D), initiative determines the order characters act in combat. A tracker helps the Dungeon Master (DM) and players know whose turn it is without losing track. for my Nokia Lumia 720 — a Windows Phone — while still an accounting student, blowing money on hardcover comics and hardcover RPG books and PDFs.
- Following Brackeys' How to Make a Tower Defense Game during a college summer break that remains one of the most fun stretches of my life. Wake up, code for hours — usually well past what the videos covered — eat at some point, sleep, rinse and repeat. I still have a soft spot for C# because of it.
During one of those videos, there was a line I've never forgotten:
if (target == null) return;That was it. The biggest game changer. It sounds almost too simple to matter — even a little bit stupid to you who are reading this, but that is precisely the point. That was my first wake up call to keep it simple stupidAlso known as the KISS principle, it dictates that systems, designs, and processes work best if they remain simple rather than becoming complex. before I learned that term.
Before that, I wrote code the way most beginners do: wrap everything in conditions, nest the happy path deeper and deeper, handle outliers as an afterthought.
Same logic. Completely different to read. I would later down my career learn a few more names, but one of them got stuck in my mind:
That single line sent me down a rabbit hole I haven't left: linting, testing, automation, code quality, design patterns, code styling and many other things. There was an entire world of thought dedicated to how to write, test, validate, whatever-else software, and I'd barely scratched the surface.
To this day, simplicity is what guides the way I build things. I want to write code that reads like it couldn't have been written any other way. Code that provides a great developer experience and that may become someone else's happy little accident legacy.
Kind regards, Leonardo