I Dislike Large Variables, I Don't Like Vertically Long Functions, And Hate Comments Because They Distract Me. I've Started To Change Though After Having To Go Back To Things Like This.

I Dislike Large Variables, I Don't Like Vertically Long Functions, And Hate Comments Because They Distract Me. I've Started To Change Though After Having To Go Back To Things Like This.
clean-code-memes, code-readability-memes, technical-debt-memes, self-documenting-code-memes, bad-practices-memes | ProgrammerHumor.io

Nothing quite like reverse-engineering your own code and realizing you've basically written an encryption algorithm for yourself. Single-letter variables, nested ternaries, bitwise operations thrown in for flavor, and logic so compressed it could be a ZIP file.

That function is doing approximately seventeen things at once while looking like someone sneezed on a keyboard. Good luck figuring out what r, t, c, and p represent without a Rosetta Stone.

Turns out "clever" code is just future you's problem. And future you is standing there like a confused mob boss trying to decode what past you was thinking. Spoiler: past you wasn't thinking about readability.

Pro tip: if your function needs a PhD to understand, maybe add a comment or two. Your future self will thank you instead of plotting revenge.

More Like This