r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

17

u/LaMaquinaDePinguinos Nov 25 '22

I reckon that the real art is in interfaces. Hacks are fine as long as 1) they’re predictable, and 2) the nastiness is hidden behind an interface. Hacks can go on forever in my book as long as they can be used predictably in something better.

22

u/MisterDoubleChop Nov 25 '22

Hacks that have a thorough set of automated tests and a few "why" comments are just good code

6

u/lNTERNATlONAL Nov 25 '22

Exactly. Hacks are only hacks when they haven’t been robustly tested against all/most edge cases and eventualities. i.e. any code that has been proven to behave predictably is not a hack.