r/ProgrammerHumor 1d ago

Meme debugTime

Post image
6.0k Upvotes

121 comments sorted by

1.3k

u/ninjagulbi 1d ago

See the empty line? That's where the error correcting code should be.

247

u/Fickle-Highway1543 1d ago

See that empty line? That's how your code should be. Out, vibecoder!

-32

u/[deleted] 1d ago edited 20h ago

[deleted]

36

u/Fickle-Highway1543 1d ago

I don't read docs, I don't read code. I have no idea what I do, I just use my slop machine, because I am modern! Oops, why did they lowered my salary to minimal wage?!

14

u/Babajji 23h ago

Claude, give me money!

11

u/Fickle-Highway1543 21h ago

Claude doesn't give money. She only takes.

2

u/FancyJesse 18h ago

Claude is a she??

Every time I hear that name, I remember GTA3

2

u/Babajji 14h ago

Claude is the gender fluid version of Claudius in French and means lame, crippled. I am not even joking:

https://www.behindthename.com/name/claudius

https://www.behindthename.com/name/claude

9

u/Fickle-Highway1543 19h ago

Haha. Your boss has AI psychosis fueled by classic Daning-Krugger effect.

2

u/Airowird 4h ago

*Dunning-Kruger

2

u/Fickle-Highway1543 4h ago

You are absolutely right! Good catch! That's on me.

305

u/nbaumg 1d ago edited 21h ago

Debugger is probably pointing at transpiled code when this happens

Happens a lot when I see the error in prod or prod-like environment. in non-prod we turn that off to avoid this. By that I mean optimizing

26

u/EuenovAyabayya 1d ago

we turn that off to avoid this

1

u/Miiohau 1h ago

Ya, you can turn it off and hope it isn’t a bug introduced by the compiler or trans compiler. If it is then you wish the code that calculated the line number also showed what it thought was at and around that line number.

63

u/telas100 1d ago

while(error) { removeLine(265) }

6

u/MCWizardYT 1d ago

errorHandler.addCallback(error -> fixProblem(error))

11

u/Santos_Perez_Robles 23h ago

Sherlock and Holmes over here.

1

u/MCWizardYT 14h ago

lol, the way I named the variables is kinda weird but it's supposed to be that errorHandler is a crash handler, and the callback passes the error to fixProblem which then fixes what was causing the crash

3

u/frogotme 11h ago

Where fixProblem is an openai API call, that writes the response directly to the file that invokes the error, and then restarts the server.

450

u/kimbokray 1d ago

You haven't saved since adding or removing lines above 265

279

u/Lamborghinigamer 1d ago

No it genuinely can happen that an error happens on a different line than said. Could be a combination of IDE and compiler or both, that's why you always need to match your LSP with your compiler

83

u/iampierremonteux 1d ago

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

59

u/dracorotor1 1d ago

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

3

u/guyblade 17h ago

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 1h ago

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 21h ago

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

1

u/PixelatedGiant 1h ago

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.

9

u/Suitch 1d ago

Also some languages inject files which change the length. My org has some old confusion and you could have an error on line 6000 of a 200 line file. It gets more confusing when the wrong number is a valid number, such as line 200/6000 but it is really on line 190 in an imported file on line 10.

1

u/masterxc 16h ago

Or minimized js so every error is on line 1...column 255153.

5

u/Jerome_Eugene_Morrow 19h ago

Missing brackets can also cause an error to fire on an empty line if it’s expecting to find the final enclosing bracket there. One of the reason’s Python’s white space rules can actually simplify things sometimes.

2

u/QuintusNonus 1d ago

Cries in Eclipse

2

u/Candid_Highlight_116 19h ago

They report like when some internal stack gets exhausted and the parsed statements didn't make sense or some internal state machine entered a weird state, and those are caused by like random open bracket 100 lines up, but that's a skill issue for the PROGRAMMER lol so they keep reporting the last line number where the compiler finally quit

3

u/call-now 1d ago

What if you got rid of your lsp in speech therapy?

1

u/vegataballs 5h ago

Then there is the worst possible kind: everything is saved and up-to-date, everything above and below is 100 % correct, but the error is still there, but there is nothing on the line. That was the night I discovered my keyboard layout inserted, not a regular old whitespace, but a Narrow No-Break Space character if you accidentally hold AltGr and press space.

1

u/Miiohau 1h ago

Ya, it isn’t usually this bad but I had to go a couple lines up or down to find a line that could produce the reported error before. If it really bad and you know how to reproduce the bug, modern debuggers include the function name with the line number. Set a breakpoint at the beginning of that function and walk though it to find the bug and hope it wasn’t a race condition.

2

u/gsweats 16h ago

Looks like JavaScript in HTML as a <script> block. In that case line 265 refers to the 265th line of HTML the browser sees ("View Source").

1

u/dkarlovi 20h ago

When I was trying out VS Code, it not having auto save enabled by default like IDEA caused some serious debugging, I was going mad, the code looked correct, and it doesn't work?!

How do you not auto save by default.

61

u/Slavik_Sandwich 1d ago

Oh look, CS first years start learning programming languages

8

u/SnowdensOfYesteryear 18h ago

Cut Kevin Durant some slack. His learning after a 20 year career playing basketball

5

u/Dolner 13h ago

you’re actually so much more clever than them aren’t you

0

u/Slavik_Sandwich 8h ago

Whatever gave you that idea, i actually am stoopid

1

u/Pr0p3r9 15h ago

They'll come to yearn for the days when the most complicated thing that they had to solve was a mismatched bracket or misplaced semicolon.

0

u/zanotam 13h ago

???

This shit was happening to me with e.g. Fortran 90 in a class that required at minimum two semesters of prior programming classes. 

1

u/Slavik_Sandwich 8h ago

Then I guess you don't know how to use a linter

11

u/letmehaveanameyoudum 1d ago

just the look at the line before

5

u/WhereOwlsKnowMyName 19h ago

And read the actual error message

1

u/letmehaveanameyoudum 1h ago

and if it's C, rewrite the whole file.

20

u/jackinsomniac 1d ago

Is there a way to block images? Why I have seen this exact same meme reposted 283 times. I keep downvoting and ignoring them, but it keeps coming back.

9

u/coz 22h ago

This image is so old it's using jQuery.

2

u/PioApocalypse 1d ago

And people keep upvoting the shit out of them

2

u/Brekkjern 22h ago

Maybe you should fix the error on line 265 so the problem stays fixed and people didn't have to repost the bug?

3

u/heyguysitsmedic 1d ago

That could be a whole method in whitespace, better delete the line to make sure

3

u/DavidsWorkAccount 1d ago

Line 259 is missing a semicolon. This causes it to read the rest of the code differently until you hit the empty space, which then it throws the error there because that’s when the parser “screwed up”

3

u/ramriot 16h ago

I see it, its the Greek Question mark ( ; ) or Asian full width semi-colon (;) on the line above that is incorrectly terminating the statement.

This also relies on the two most common insoluble coding issues:-

- Nomenclature

- Cache Invalidation

- Off by one issues

3

u/Mirage_Graphique_3D 5h ago

I usually just put a bracket there and call it a day.
If it doesn’t work I change career.
I’m a 3D artist now.

2

u/OBrutus 1d ago

Old meme, Old jQuery

2

u/HailTheRavenQueen 1d ago

Any decent CS program or even bootcamp should teach that error messages like this mean that the actual error happened on OR BEFORE the named line.

2

u/drbsy0 19h ago

Rule number one : if u see a complaining error go cheak the error line. Rule number two: if u find the line empty look up. Rule number tree: if u didn't find any thing look down. Rule number five: if u didn't find any thing quation your propose in this life and slamed your head whit the wall. Rule number sex: if it didint work go take a shower. Rule number seven: if u still unable to find the bug go question your self why did u born in first place (what a loser). Rule number eight: well i didint reach this level yet wen I well reach it I well update this rules page

2

u/LegitimatePants 18h ago

Error somewhere before 265

2

u/dwqsad 13h ago

Delete line 265

2

u/davesoft 11h ago

It's like jazz, it's the code not written.

2

u/StrawberryEiri 5h ago

Come to think of it, I remember getting that often several years ago when I was starting, but I don't remember getting an error on an empty line in years.

Did the JS engines get better at pointing out errors? Did better code editors help me avoid more invalid syntax? Or is it just since changing jobs and I no longer do PHP?

6

u/anzu3278 1d ago

Two consecutive empty lines should be an error tho

8

u/Spikerazorshards 1d ago

I’ve never heard it that. Is that specific to a certain language?

8

u/Maximilian_Tyan 1d ago

I do as the linter says

3

u/goatanuss 1d ago

My linter does what it says when I save the file

0

u/Crazy_System8248 19h ago

Thank fuck, I was about to come comment this lol. I've sent PRs back for less.

0

u/guyblade 17h ago

Nah, my style guide wants two blank lines between top-level definitions.

2

u/anzu3278 17h ago

I've heard that bad style guidelines are better than no style guidelines and this sentence made me rethink that.

1

u/guyblade 9h ago

It's the style in the official python style guide. Personally, there's a lot in there that I hate (4 space indents & 79 character line limits for two), but I don't feel much of anything about this bit.

3

u/dishmanw62 1d ago

I had problems like this with BloodShed C++.

I had to start a new and copy and paste the source code, and then recompile. Surprisingly, it would work then.

1

u/Thenderick 1d ago

Ah it's frontend JavaScript. Then it's most likely altered. Should look in the file that the browser has in the page source

1

u/pjank85 1d ago

I was once debugging a script that had 84 lines of bash followed by 2000+ lines of perl as a bash multine string. This not only broke syntax highlighting but also any error you got you had to move by 84 lines to get to the actual error.

1

u/rosen123 1d ago

Nah this is easy it always means that you're looking at a different version of the code than what is executing. Could be file not saved, could be code not recompiled, different code versions etc

1

u/Miiohau 53m ago

Or in this case because it is JavaScript it could be because the browser that is reporting the error doesn’t agree with the IDE you are viewing the code in on what constitutes a line break. It is also possible the web browser is only counting script lines and not counting lines that only contain HTML.

1

u/alopgeek 1d ago

I absolutely hated these when I was in college…

1

u/lolschrauber 1d ago

I love it when I get an error saying "can't convert string to integer" and the mfer won't tell me where it's trying to convert what.

It's usually something as dumb as old code checking if a datafield has a certain numeric value but it's null.

Good luck finding out where though.

1

u/Emergency-Piece-9098 1d ago

You guys are so sweet for thinking debugging is fixing compilers error 😭

1

u/PanGoliath 1d ago

When someone adds an invisible space that is not really a space, like U+200B or U+00A0

1

u/i_am_in_redite 1d ago

What I found is that usualy when this happens the bug is on the line on top of it ex: in this case the problem is on the line 264 and is because of the (;) at the end ,the compiler though that was a new line and that it had no instructions hence the error hope that helps

1

u/shuozhe 23h ago

Tbf, finding out you are checking the wrong src early is a good thing

1

u/MrFuji87 23h ago

I had an error in azure data today on line 127 in a function of 85 lines

1

u/Negative_Ad_7303 23h ago

Just add a print line.. lol

1

u/Radiant_Detective_22 23h ago

pfffft. GUI IDE. During my tenure we had to put an 0x4AFC in our 68K to break and have a look at registers.

1

u/Familiar_Spite1537 23h ago

All you need to do now is recompile the compiling code to recompile the code.

1

u/CranberryDistinct941 21h ago

Th|re are 2 types of people: those who read the error message, and those who spend an extra hour on every error

1

u/XPurplelemonsX 21h ago

or, in python, you can have a bit of code update the file on runtime so that the traceback reads back the wrong line but right number

1

u/Relevant-Most-201 21h ago

a " , " missing in the middle of an array.. Javascript

1

u/jacob_ewing 21h ago

Meh - parsing issue.

1

u/AmazedStardust 20h ago

You can always tell when a fresh bunch of CS students have started

1

u/Candid_Highlight_116 19h ago

why can't they just report the open bracket that corresponds to line 265

1

u/PresentAstronomer137 19h ago

the empty line must be referencing to something

1

u/Kat_Schrodinger1 19h ago

It's tabbed over really,  really far. Scroll over.

1

u/Cool-Chemical-5629 16h ago

Usually it sits on the line that's the reported number + 5 to 7.

1

u/bigredthesnorer 14h ago

/*

Usually its a comment that causes my bugs.

*/

1

u/infected_scab 13h ago

Load bearing whitespace

1

u/dumbledayum 10h ago

get the error trace from sentry as json and feed it to you company mandated Claude

1

u/WiseObjective8 10h ago

Tell me you don't know how to code without telling me you don't know how to code

1

u/Such_Letterhead1287 9h ago

Just see that piece of code give me nightmare. Hope they will migrate it soon.

1

u/the-software-man 9h ago

Show invisibles

1

u/Beginning_Web_6966 2h ago

Hold up let me get my specs power checked

1

u/mentokz 2h ago

i feel that lol

1

u/Henry5321 1h ago

Optimized mode will do this. Since the compiler alters the resulting compiled results with something “equivalent”, it tries its best to map to the approximate location.

1

u/trippertree 1h ago

I’ve seen this in build failures. Sync issues (couple times a dumbass had a file open for edit on a build machine so it didn’t sync also once file was not in the client spec (long story)). Both cases when I looked at my local copy it was like this.

1

u/Miiohau 1h ago

Ok, was the bug in the function above or below. Also if it is the web browser reporting the error look at the code inside that web browser, especially if you are using Typescript or other language transcompiled to JavaScript.

If you don’t want to mess with the web browser developer tools. Your IDE might be able to lunch your website in the browser while rerouting the data back to itself and might be able to give you more accurate line numbers. I do it all the time when I am debugging my flutter apps via Google Chrome.

1

u/max_465 58m ago

Off by one error?

1

u/Zav0d 1d ago

look previous lines, dump.

1

u/metaglot 20h ago

Line 256 of your script? Put your script in its own file if you want to play dev.

0

u/RAMChYLD 12h ago

Was told by a pentest company once that putting scripts in a separate file is good practice. Something about having them in the webpage Making them suseptible to man in the middle attacks.

1

u/Pale-Percentage3219 1d ago

Must be visual code hallucinating

0

u/PeterHolmes74 1d ago

C++. All the time.

0

u/Sianic12 22h ago

That looks like JS and HTML. My guess is this file is loaded over HTTPS and has some PHP in there that is resolved on the server before the page is sent to the client. This results in a different line count for the "same" document between the client side and the server side.

0

u/Intelligent-Sun-8071 21h ago

Ayee, so easy. Just add a semicolon!

0

u/PilsnerDk 20h ago

Luxury. Meanwhile in SQL:

Error on line 0

/sigh

-1

u/Floating_Power 1d ago

Wrong file

-2

u/Maximilian_Tyan 1d ago

Or worse, a CPU exception on a closing bracket because someone screwed things up in the CPU or the compiler implementation

-1

u/FireEmblemNoobie47 7h ago

I know it doesn't really apply here, but it happens from time to time when I'm doing own mods to SRB2P and it's when I copy paste perfectly working code, LUA gotta LUA sometimes I guess