this post was submitted on 14 Oct 2023
1066 points (97.0% liked)

Programmer Humor

32000 readers
1744 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 76 points 11 months ago (2 children)
[–] [email protected] 39 points 11 months ago (1 children)
[–] [email protected] 15 points 11 months ago

Damn that mash looks tasty.

[–] [email protected] 9 points 11 months ago (1 children)

It just seems like a strange place to go on fire

[–] [email protected] 7 points 11 months ago

It's a very strange place to go on fire! A fire? At a Sea Parks? It's been racking my head!

[–] [email protected] 66 points 11 months ago (1 children)

May I introduce you to Error in Unknown on line 0.

[–] [email protected] 75 points 11 months ago (3 children)

That one is easy. Just delete the whole project and start again after consuming some alcohol

[–] [email protected] 26 points 11 months ago

I see you learned to code like I did.

load more comments (2 replies)
[–] [email protected] 62 points 11 months ago (2 children)

Have you considered learning how to read a stacktrace?

[–] [email protected] 47 points 11 months ago (1 children)

Jokes on you, I don't even know how to read.

[–] [email protected] 10 points 11 months ago

Damn, got us good!

[–] [email protected] 11 points 11 months ago (3 children)

It is 2023 my brother in christ! We deserve better error outputs than a stack trace.

  1. Tell me what line in my file caused the error,
  2. Tell me the values of the variables involved,
  3. Then you can have the stack trace.

Why are we pretending like these error messages are acceptable in 2023?!

[–] [email protected] 5 points 11 months ago (1 children)
so said EVELYN the modified DOG

(This is not just a Zappa quote, but an actual error description from the Small Device C Compiler.)

load more comments (1 replies)
load more comments (2 replies)
[–] [email protected] 51 points 11 months ago* (last edited 11 months ago) (1 children)

I had this happen to someone I mentor and pointed out that they had two versions of the same file in two different paths named the same. They were running the version in the other path than they were editing lol.

[–] [email protected] 5 points 11 months ago

You're describing classic ASP except that was usually 17 different versions of the same-named file.

[–] [email protected] 38 points 11 months ago (1 children)
[–] [email protected] 17 points 11 months ago

NodeJS when trying ES Module in CommonJS project:

[–] [email protected] 34 points 11 months ago (1 children)

Check which file is giving the error, it's probably being thrown in an included library, not your code.

[–] [email protected] 26 points 11 months ago (1 children)

Yeah, but that's some bullshit. I want to know what line in my file is causing the error.

And they know! They know what line in your file caused the error! They know the value of all the variables when the error hit. But do they show that? Fuck no.

[–] [email protected] 11 points 11 months ago (2 children)

Just read the whole stack trace till you find a familiar file

load more comments (2 replies)
[–] [email protected] 29 points 11 months ago (1 children)
[–] [email protected] 17 points 11 months ago (1 children)
[–] [email protected] 13 points 11 months ago (1 children)
[–] [email protected] 9 points 11 months ago (2 children)

And how did that happen, if you allow the question?

[–] [email protected] 11 points 11 months ago

I don't kno~ow

[–] [email protected] 6 points 11 months ago
[–] [email protected] 23 points 11 months ago (1 children)
[–] [email protected] 4 points 11 months ago

Hey hey. JavaScript is easy. It's when you get into virtual doms that debugging becomes a nightmare.

[–] [email protected] 20 points 11 months ago (1 children)

Line 548! is insane. I can't even imagine a number that big.

[–] [email protected] 6 points 11 months ago

Programming Dad jokes are so bad yet so good.

[–] [email protected] 19 points 11 months ago (1 children)

I love how all the comments feel the need to say how they'd solve it.

[–] [email protected] 17 points 11 months ago (1 children)

Programmers are problem solvers 🤷‍♂️

[–] [email protected] 5 points 11 months ago

And problem causers

[–] [email protected] 18 points 11 months ago (2 children)

Sourcemaps. Use sourcemaps.

[–] [email protected] 60 points 11 months ago (1 children)
[–] [email protected] 13 points 11 months ago (1 children)
[–] [email protected] 10 points 11 months ago (2 children)

The hostage has been planted.

[–] [email protected] 5 points 11 months ago (3 children)
load more comments (3 replies)
load more comments (1 replies)
[–] [email protected] 6 points 11 months ago (1 children)

Can you give us an eli5 on sourcemaps?

[–] [email protected] 7 points 11 months ago (1 children)

Usually when code is minified, it is shipped alongside a sourcemap (*.js.map), which can be used by the browser to show you the original code.

If you get an error in the browser, you can click the error, which will take you to the network(?) tab and show you exactly where the error occurred

[–] [email protected] 5 points 11 months ago (1 children)

Also when code has been compiled, or transpiled. The reason the line numbers don't match is because all of the code is being assembled into one large package and served to whatever client uses it. So even if you don't minify, but you're compiling, sourcemaps will show you where the error actually occurs, instead of where it occurs in the finished product.

load more comments (1 replies)
[–] [email protected] 18 points 11 months ago

For the record the only language I've had this happen to me is in js

[–] [email protected] 12 points 11 months ago

This regularly happens for me in Kotlin due to inlined functions

[–] [email protected] 11 points 11 months ago (1 children)
[–] [email protected] 6 points 11 months ago

It's a VERY WEIRD place for a fire!

[–] [email protected] 9 points 11 months ago (1 children)
[–] [email protected] 4 points 11 months ago

iPhone 4 vibes

[–] [email protected] 6 points 11 months ago (2 children)
load more comments (2 replies)
load more comments
view more: next ›