Oftentimes, I'll spend a lot of time working on some obtuse code problem. It'll be a lot of work digging through docs, source code, forum posts or Discord history and the progress is slow -- especially when trying to solve The Mystery of Why This Won't Fucking Work. And extra-especially when I (not infrequently) miss the obvious solution right out of the gate.
When I reach the end of the journey and it Works on My Machine sometimes I'll think "damn, this could probably help someone else out of a bullshit scenario -- maybe I should blog about it".
Then I look at the highly cursed code that I have created and think "okay, maybe I should clean up the nuclear spillage before releasing that on the internet". Then the perfectionism spiral will begin, and I realise I would rather sit on my own trash heap and move on to the next problem than clean any of this up. After all, when it's a personal project the only person punished with the shit code is future me, and she probably has it coming [1].
Keeping all my copious research notes to myself helps no one. And as I am like the humble squirrel who planted a great oak tree, frequently I lose track of my notes and feel like I always need to solve the same problems several times -- thus I am also a person helped by these blog posts. The solutions I find may be janky and not be the best way to do something but I know from experience that any crumb helps when you're desperate. Not code I'm proud of, but gets the job done.
So, with that in mind, I've decided to experiment with a concept I'm dubbing 'sketch' tutorials. It's a messy, probably non-idiomatic outline of how I solved a problem. It's offered as-is without any support. While I'm usually happy to improve my code, before you 'well, actually' me consider that I have decided to just not worry about it. These sketches may be something I go back to and update as needed or I may just decide to move on with my life when they're out-of-date. Basically, this solution worked for me at a particular moment in time, no matter the absolute state of it and you can decide if there's something in the morass that helps you. If your computer or house explodes after implementing any of these things I take no responsibility.
Where possible, I'll try to include both a 'short' version and a 'long' version because the blog is supposed to be where I have fun writing but even I find myself long winded sometimes. And honestly, in some cases where copy-pasting the code doesn't work working through my reasoning might help you figure out why.
And, yeah, people write bad code and put it on the internet all the time without writing a 500 word disclaimer. But recall the perfectionism thing? Yeah, like the code, these excuses aren't really for you, they're for me.
So, enjoy these sketches, or don't as the case may be!
If you're reading this post while trying to decide whether or not to hire me I'll clarify that when I have to play with others I will clean up after myself and don't write code like the recently concussed ↩︎