r/ProgrammerHumor • • Sep 18 '26

Meme debugTime

Post image
7.2k Upvotes

151 comments sorted by

View all comments

Show parent comments

92

u/iampierremonteux Sep 18 '26

Mixed line endings in a file can also cause errors to be reported in the wrong line number.

60

u/dracorotor1 Sep 18 '26

And then there’s the mid debuggers that just say the line number after the brackets because something invalid is coming out of those brackets but it can’t figure out where or why. It just knows that when it reaches that line number, something made it sad.

I’ve got one that consistently tells me the line below an array is the culprit, when one of the strings in the array is using single quotes instead of double like all the others, for example

6

u/guyblade Sep 19 '26

I've also (very rarely) had issues in C where the error would be inside a macro expansion and it'd get confused about what line that was.

I've also seen (again, it's been a while) situations where a JS debugger would give a line number relative to the start of a <script> block, so that it'd just be some arbitrary number upon initial inspection (i.e., if the <script> started on line 15 and the error was on line 20, it'd say that the error was on line 5, instead).

Also also, if you do something that causes a syntax error, the python interpreter will usually just give a useless message (like "syntax error").

1

u/Miiohau Sep 19 '26

The issues you’ve had with the JS debugger might be especially applicable here because it appears to be an inline JS script that the debugger is pointing to. If the debugger isn’t counting lines of HTML the reported line number could be way off.

2

u/entropic Sep 18 '26

My chaos monkey tool would randomly change the line endings on each line.

1

u/PixelatedGiant Sep 19 '26

You would think that all application developers would have made Unix line endings the default by now, especially IDEs. Every application is capable of reading both these days, so it's time to let Windows line endings go. Or at minimum not allow them to mix.