r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

2.0k

u/dasmau89 Nov 25 '22

Nothing is as permanent as the temporary solution

575

u/[deleted] Nov 25 '22

I think it was CodeWarrior for the PS2 or PSX (definitely a playstation compiler around the year 2000) we were having issues with byte alignments. Eventually we discovered that the tokenizer was including commented out code which was then used as a part of padding/alignment and you could break the ABI by changing comments. Those comments were locked into place, even after they were no longer relevant and flat out wrong. It was horrible.

478

u/helpiminabox Nov 25 '22

"These here are load-bearing comments, so don't touch them."

92

u/Zoidburger_ Nov 25 '22

It's only necessary when you name your game package "your_mom.ps2"

90

u/elon-bot Elon Musk ✔ Nov 25 '22

How can we use Bitcoin to solve this?

80

u/Zoidburger_ Nov 25 '22

The Blockchain can't support the space complexity of your mom

21

u/[deleted] Nov 25 '22

Your mom is so fat she overflows a 128 bit integer

6

u/Does_Not-Matter Nov 25 '22

Bad coding your mama jokes, go!

8

u/[deleted] Nov 25 '22

No no hold on, your mom is so dumb she wears sunglasses when she starts eclipse

5

u/[deleted] Nov 25 '22

Your mom is so dumb she still uses GOTO for everything.

→ More replies (1)

8

u/ric2b Nov 25 '22

But how do you add that comment without breaking things?

→ More replies (1)

98

u/apc0243 Nov 25 '22

Jesus what insanity

95

u/qoning Nov 25 '22

Tbh the obvious solution there is to write a precompiler to remove all comments.

But I bet the dude who discovered the source of the bugs had an awesome day. I would LOVE to be there at that minute.

72

u/[deleted] Nov 25 '22

And suddenly you have to spend resources chasing down every other hack which was put into place to fix the stuff. PSX/PS2 were real-mode memory. It was common to directly access raw addresses and implement pointer math on top of that. Removing all comments in the primer would have gone from "okay here's one big headache we are aware of" to "we have no idea where all these small headaches are coming from."

15

u/qoning Nov 25 '22

Well yeah if it was already worked around without knowing the cause in multiple other places, then that's a problem. Otherwise it's just a full rebuild the world once fix though.

→ More replies (1)
→ More replies (2)

16

u/StatementAdvanced953 Nov 25 '22

Jesus I never would have thought about comments busting the ABI

→ More replies (2)

215

u/PooSham Nov 25 '22

That's because it's full of side effects that make things work, which means that replacing it with something better will break things and be much more work than it should be

46

u/lightninhopkins Nov 25 '22

Doesn't that make it not better by definition?

150

u/elon-bot Elon Musk ✔ Nov 25 '22

I'm gonna need you to come in on Saturday...

58

u/emiliathewhite Nov 25 '22

First time seeing this, who the fuck made this bot HAHAHA

11

u/Perry_lets Nov 25 '22

I think a mod. ButI know it was because of a post asking for it

→ More replies (4)

5

u/Joe_Ronimo Nov 25 '22

//Here there be dragons.

0

u/[deleted] Nov 25 '22

[deleted]

19

u/All_Up_Ons Nov 25 '22

Yep, if you ever need to clean up a temporary fix, it has to happen immediately or it never will. That means you have to do it now, as part of the pants-on-fire fix. No one else can even see the problem, so it's on engineering to drive it.

→ More replies (2)
→ More replies (12)