this post was submitted on 22 May 2024
17 points (94.7% liked)

Hacker News

2169 readers
31 users here now

A mirror of Hacker News' best submissions.

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] mindbleach@sh.itjust.works 1 points 5 months ago

Code golf's more sensible cousin is code bonsai. You don't remove something unless the outcome is more elegant.

Don't do stupid shit like single-letter variables, or cramming everything into one line, or functionifying anything that happens twice. But if you can generalize something that happens a bunch and turn a lot of copy-paste boilerplate into slightly magic-looking function calls, absolutely chop all those blocks down to one name and a couple references.

And then comment on it, you fucking animal.