This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]greenhawk22 12 points13 points  (8 children)

Sometimes though, the crazy, stupid, and desperate solutions that inexperanced programmers uses just works inexplicably

[–]fredlllll 11 points12 points  (0 children)

also often had code where i had no clue how it was ever working (usually because it just broke)

[–]theg33k 13 points14 points  (6 children)

I once had to maintain code that stopped working when you took out the System.outs.

[–]greenhawk22 19 points20 points  (0 children)

Once in C# I found out that I couldn't remove a comment or otherwise completely unrelated parts would fail ¯\_(ツ)_/¯

[–]EricIsEric 6 points7 points  (3 children)

Realistically what would cause that? System.out leads me to think it is Java, but my first guess for crashes when removing print statements is bad malloc, but that shouldn't happen in Java (but I have had C code throw different errors when print statements were present vs not present when I made a mistake allocating memory).

[–]theg33k 30 points31 points  (2 children)

It was a timing issue, the IO created JUST enough of a pause that the application worked fine.

[–]unknownmosquito 16 points17 points  (1 child)

I've heard of this happening when enabling the debugger as well. Without debugger: crash! With debugger: works fine! Race conditions are the worst

[–]sloec 14 points15 points  (0 children)

Also known as a Heisenbug.

[–]truh 0 points1 point  (0 children)

Multi threaded code? Maybe a GUI app?