this post was submitted on 28 Jun 2025
1064 points (99.2% liked)

Programmer Humor

24580 readers
770 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] 01189998819991197253@infosec.pub 1 points 12 hours ago
[–] HugeNerd@lemmy.ca 5 points 18 hours ago (1 children)

I freaking love naan! Bring it!

[–] funkless_eck@sh.itjust.works 3 points 18 hours ago

NaN naan Jeremy that's insane

[–] TheEighthDoctor@lemmy.zip 21 points 1 day ago (2 children)

Wait until Null opens the door

[–] null@slrpnk.net 2 points 16 hours ago

Knock knock

segmentation fault

[–] fargeol@lemmy.world 125 points 1 day ago* (last edited 1 day ago) (2 children)

NaN minutes later, a truck arrives in the alley, its license plate reads "undefined". Someone gets out of the vehicle
"I have something for you"
He gives you a package. You open it. It's an [object Object]

[–] dovahking@lemmy.world 19 points 1 day ago

"I've been looking for you! Got something I'm supposed to deliver. Your hands only."

[–] dohpaz42@lemmy.world 66 points 1 day ago (4 children)

Must be from the NPM delivery service. The recipient is lucky the driver didn’t give them thousands of dependencies too.

[–] HenryDorsett@lemmy.world 1 points 16 hours ago

You don't get dependencies in real life like that.

You work 10 years in an industry and try to get a promotion? That may be a dependency issue.

[–] fargeol@lemmy.world 26 points 1 day ago (1 children)

"I got a package from Jason"

[–] axEl7fB5@lemmy.cafe 1 points 13 hours ago

"I also got a lock"

[–] FrostyCaveman@lemm.ee 13 points 1 day ago* (last edited 1 day ago)

Ah sweet, my left-pad is coming today!

[–] elvith@feddit.org 20 points 1 day ago (1 children)

Guess why he came with a truck and not on a cargo bike...

[–] ulterno@programming.dev 3 points 1 day ago

Because you forgot to tell them that you already have the dependencies at home?

[–] badcommandorfilename@lemmy.world 72 points 1 day ago (1 children)

You wouldn't want your code throw an exception

[–] JackbyDev@programming.dev 3 points 18 hours ago

[object Object]

[–] altkey@lemmy.dbzer0.com 15 points 1 day ago

Is it a threat?

[–] Scoopta@programming.dev 35 points 1 day ago (3 children)

As someone who mostly avoids JavaScript, I don't see the IT in this image, I just see a bad language I avoid!

[–] JackbyDev@programming.dev 4 points 18 hours ago

I promise you, people make mistakes in every language lol.

[–] blackn1ght@feddit.uk 15 points 1 day ago (4 children)

This isn't the languages fault, it's the developers.

[–] sukhmel@programming.dev 6 points 21 hours ago (1 children)

Albeit true, I want to note that some languages encourage such practices way more than others do. Also, when you've got a hammer everything looks like a ~~string~~ nail.

[–] blackn1ght@feddit.uk 1 points 14 hours ago

In my mind a simple unit test should have caught this. Mock out the call to the service that sends the message and verify that it's been called with the correct message, and cover the possible failure scenarios. That said I hate loosely typed languages lol.

[–] CanadaPlus@lemmy.sdf.org 2 points 20 hours ago
[–] Scoopta@programming.dev 2 points 22 hours ago

I'm assuming by this you mean the developers of JS /s

[–] copd@lemmy.world 4 points 1 day ago (1 children)

besides NaN actually being a number, this could completely and easily be avoided with typescript.

[–] rooroo@feddit.org 5 points 1 day ago

Naaah. Good programmers know how to use as any as any to make this work in typescript as well.

[–] davidagain@lemmy.world 3 points 1 day ago

I had the exact same reaction.

[–] jwt@programming.dev 30 points 1 day ago

I [object Object]

[–] anguo@piefed.ca 18 points 1 day ago

I kid you not, opening this post on piefed.ca gave me "Internal Server Error" the first time.

[–] mumblerfish@lemmy.world 19 points 1 day ago (1 children)

I got one of those too. I called the customer service to get another path home because of disturbances, and they just have robot answering. The robot started halfway through the call just reading pure json at me, and then said "to get this information as a message press 1" or something. This is what I got:

Here is your journey from undefined to undefined: BUSS 506 towards Karolinska sjukhuset 09:36 from undefined 10:18 arrived at undefined. Link to your journey.

[–] JackbyDev@programming.dev 1 points 18 hours ago

If you want those on separate lines you need to add two spaces on the end of each line!

[–] glorkon@lemmy.world 14 points 1 day ago* (last edited 1 day ago) (2 children)

I'm an old fuck and I started to code in the late 80s. Fast forward 30 years, I once had to work at a WeWork. One day, directly outside of my small office space, I swear to god, a fucking hipster kid with a Macbook under his arm practiced skateboard moves. That was the exact moment I started hating working in IT. It's also what I think every Javascript coder looks and acts like.

[–] Guttural@jlai.lu 5 points 1 day ago

Youngsters these days, uh?

Now grandpa, time to take your medicine

[–] Dumbkid@lemmy.dbzer0.com 6 points 1 day ago (3 children)

What's wrong with skateboards

[–] JackbyDev@programming.dev 3 points 17 hours ago

I really don't care people using skate boards, even doing it around a workplace isn't necessarily taboo in my mind, but they were in the office right outside someone's door. Do it in the parking lot or something.

[–] glorkon@lemmy.world 16 points 1 day ago

Nothing. But that kid used it inside a coworking space.

[–] Matty_r@programming.dev 8 points 1 day ago (2 children)

I actually wish skateboards made a come back. Much more preferable over the escooters I see around a lot.

[–] axEl7fB5@lemmy.cafe 1 points 13 hours ago

What about kick scooters?

[–] Kaboom@reddthat.com 4 points 1 day ago (1 children)

Yeah but no handle so you're much more likely to eat shit when you go down a slope or something.

[–] Matty_r@programming.dev 2 points 1 day ago

Yea, it takes actual skill to use them ha ha

[–] Viking_Hippie@lemmy.dbzer0.com 11 points 1 day ago (1 children)

I'm no acupuncturist, but I'm pretty sure that it's SUPPOSED to say "naan minutes", which is time spent enjoying delicious Indian flatbread.

I guess you just eat your naan and then your ride arrives to ask you if you have any leftovers? 🤷

[–] ulterno@programming.dev 1 points 1 day ago (1 children)

But what does that have to do with acupuncture?

[–] marcos@lemmy.world 13 points 1 day ago (1 children)

The Javascript literal interpretation of NaN never fails to amuse me.

[–] squaresinger@lemmy.world 4 points 1 day ago (1 children)
"a"+"b" -> "ab"
"a"-"b" -> NaN
[–] marcos@lemmy.world 2 points 22 hours ago (1 children)

Yeah:

parseInt("a") -> NoT a NuMbEr
[–] squaresinger@lemmy.world 2 points 22 hours ago

Sure, but the main issue here is that JS doesn't only auto cast to more generic but in both directions.

Maybe a better example is this:

"a" + 1 -> "a1"
"a" - 1 -> NaN

With + it casts to the more generic string type and then executes the overloaded + as a string concatenation.

But with - it doesn't throw an exception (e.g. something like "Method not implemented"), but instead casts to the more specific number type, and "a" becomes a NaN, and NaN - 1 becomes NaN as well.

There's no situation where "a" - "b" makes any sense or could be regarded as intentional, so it should just throw an error. String minus number also only makes sense in very specific cases (specifically, the string being a number), so also here I'd expect an error.

If the programmer really wants to subtract one number from another and one or both of them are of type string, then the programmer should convert to number manually, e.g. using parseInt("1") - parseInt("2").

[–] airbussy@lemmy.one 9 points 1 day ago

At that point just throw an exception man

[–] mindbleach@sh.itjust.works 4 points 1 day ago

Thirteen furries just had an aneurysm.

load more comments
view more: next ›