r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

1.0k

u/DenormalHuman Nov 25 '22

the number of times I have seen this be literally true is amazing

227

u/TurboGranny Nov 25 '22

Yeah, this one resonates hard enough to feel like a personal attack, lol

88

u/DoctorWaluigiTime Nov 25 '22

I've seen the reverse true too. Temporary hacks can be temporary due to requirements change, or because tech debt was cleared out; and the pristine solution to a thing lasts a decade and is relatively bug-free because of the good foundation.

83

u/All_Up_Ons Nov 25 '22

The reasons are obvious when you think about it for a second. The projects that require temporary fixes are business-critical with tight timelines. The only projects with time for perfectly-crafted artisan code are unimportant ones.

23

u/BetterOffCamping Nov 25 '22

"we don't have time" is a logical fallacy that is usually just shorthand for "I don't want to deal with it" on management's part.

I find that when I simply do it well without "asking permission" I am able to get it done quickly enough to avoid uncomfortable discussions, and the inevitable feature changes are much easier to implement (thus faster turn around).

Good design focuses on generic enough code to be resilient to change. This is a result of isolating feature specific volatile code to small pluggable modules.

Often, some of the resulting code can be substituted in other areas of the system, further simplifying it.

4

u/qhxo Nov 26 '22

Never enough time to do it right, but always enough time to rewrite it ten times. Good code isn't just nice to look at, it produces value in terms of hours spent maintaining it.

3

u/TurboGranny Nov 26 '22

yup. People are always forgetting maint. cost

4

u/sleepyj910 Nov 25 '22

Exactly if you have perfect code coverage you aren’t working a critical project because no way you’d have time for that unless they give you a bunch of interns/juniors

1

u/TurboGranny Nov 26 '22

That makes sense. That said, I've had quick hacks that weren't to solve something critical, but to just make a problem go away so I could finish the main project only for tons of systems over the years becoming dependent on that thoughtless hack, heh

6

u/thegtabmx Nov 25 '22

It's the rule, not the exception.

1

u/dudemann Nov 25 '22

I don't program but I used to build and maintain websites. We had a team that built them and constantly upgraded their methods, and my team mostly maintained them so we had ~15k sites built over 8ish years we had to be able to work on. Sometimes the dev team would find some novel new way of building and abandon it a month later; sometimes they'd simply upgrade a module version or .js file but not update legacy sites; sometimes we'd take over a site built elsewhere. Pure HTML, JS, ASP, .Net, DNN, WordPress, 3rd party user-side editors, and even my favorites, sites with hot spots and full Flash sites (right around the time smartphones came out, so... fun).

We got to the point we had certain sites only one person would work on because that 🩹 or 💎 was so damn unique or hard to use it wasn't worth training someone else how to do it. It's sad to think about how much I learned there and how 0% is still useful. It's like I'm a modern day computer with 5" floppy and zip drives.