this post was submitted on 13 Oct 2023
805 points (93.5% liked)

Programmer Humor

32596 readers
999 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
[–] xmunk@sh.itjust.works 87 points 1 year ago* (last edited 1 year ago) (3 children)

This meme was written by a novice that does not yet know true pain. An error that takes fifteen minutes to find! In your own code! Ha, you young whipper snapper... just wait until you have to debug an unforeseen edge case in a library... especially if it's compiled. And once you've seen that, once you've known that horror, come and talk to me about DLL hell.

Unless you're working with installers and, probably, in C++ it's unlikely you'll ever meet this Cthonic horror. Zalgo? Tony the Pony comes? You have met that friendly demon of development? They are but the apprentice... DLL hell is a span of time measured in days.

... Alternatively talk to me about trying to track down an extra newline at the end of a PHP file, that (against all advice) has a closing tag, that causes some output to be sent preventing you from sending headers to the client. There's no error detection for that and PHP is an interpreted language... you just need to check files manually!

[–] MajorHavoc@lemmy.world 3 points 1 year ago

This meme was written by a novice that does not yet know true pain.

Hey now, lots of us still...

An error that takes fifteen minutes to find!

I see what you did there.

DLL hell

For anyone reading along who has not experienced DLL hell, don't believe this account on face value.

xmunk is clearly understating the horrors, as a kindness, to protect you from what we went through.

[–] pixelscript@lemmy.ml 64 points 1 year ago (2 children)

It's 2023. If you're not using an IDE or a highly extensible text editor with simple static analysis features, I really don't know what to tell you.

[–] GigglyBobble@kbin.social 36 points 1 year ago (2 children)

I had to read it repeatedly and check if it really said "syntax error". What will those people do if they encounter their first race condition?

[–] xmunk@sh.itjust.works 17 points 1 year ago (1 children)

Well, what most of us do... manage to reproduce it by chance one out of twenty attempts and then remove any evidence that you managed to trigger it and mark the ticket "unable to reproduce". Bury the ticket by removing any good tags or keywords and hope it's at least three months until anyone else reports the error so you can repeat the dance.

[–] MajorHavoc@lemmy.world 3 points 1 year ago

I see myself in this comment, and it makes me uncomfortable. Lol.

[–] Arigion@feddit.de 11 points 1 year ago (1 children)

They insert sleep(1) and print statements. No shit. I had to fix this in two projects. One was a complete rewrite.

[–] AVincentInSpace@pawb.social 2 points 1 year ago* (last edited 1 year ago)

Reading this made me nausesous. I feel your pain.

[–] qaz@lemmy.world 2 points 1 year ago* (last edited 1 year ago) (3 children)

Clang won’t tell you if you’re missing a return statement, even with all warnings on and will just let it crash during runtime. Static analysis won’t save you from all stupid mistakes.

[–] pixelscript@lemmy.ml 12 points 1 year ago (2 children)

Static analysis won't save you from all of them, but they will definitely save you from the great majority of the ones ProgrammerHumor seems to get worked up about.

I still see people sharing ancient memes about pouring over code for hours looking for mismatched curly braces, missing semicolons, and greek question marks. These and the bulk of minor syntax problems like them should all be complete non-issues with modern tooling.

[–] TunaCowboy@lemmy.world 5 points 1 year ago (1 children)

clangd should have warned you about this before you even considered compiling.

[–] qaz@lemmy.world 2 points 1 year ago

Thanks, I’ve tried it and it works a lot better than the built in intelli-sense.

[–] sonymegadrive 3 points 1 year ago (3 children)

Clang won’t tell you if you’re missing a return statement.

Is this C++? Have you got some code examples?

I’ve been writing C++ for 20+ years and the last compiler I encountered this with was Borland’s. In the late 90s.

load more comments (3 replies)
[–] Synthead@lemmy.world 26 points 1 year ago

Read your errors fully, kids

[–] Cornelius@lemmy.ml 25 points 1 year ago (1 children)

Dynamically typed/interpreted language?

Python Yup that checks out.

I've never understood why so many languages insist on a feature that causes such a obtuse and tedious programming experience.

Python is great, until you don't remember a function call, and can't guess using your LSP to tell you. :/

[–] DWin@sh.itjust.works 3 points 1 year ago (2 children)

Time to delivery is important. Moving quickly withing a language and frameworks that prioritise speed over safety gets a product out the door is important when testing whether a business idea holds merit. Once you're established with a better scope of the project you should be rewriting this in a static language.

Dynamically typed interpreted languages should never be used for long term support imo

[–] traches@sh.itjust.works 5 points 1 year ago* (last edited 1 year ago) (1 children)

Idunno, Ruby was my first language and the other day I was trying to write a one-file script to wrangle some CSV data and even that got irritating. What does this function need? What does it return? Who the fuck knows! Is it even a function? Run it and find out, loser

And I’ve got reasonably popular projects in ruby, I’m not a beginner.

load more comments (1 replies)
[–] MajorHavoc@lemmy.world 5 points 1 year ago* (last edited 1 year ago) (4 children)

Once you're established with a better scope of the project you should be rewriting this in a static language.

Or bolt MyPy to it, right? concerned Padme meme

Edit: Wow. Somebody out there has no sense of humor about their bolt-on type solution.

load more comments (4 replies)
[–] jubilationtcornpone@sh.itjust.works 23 points 1 year ago (1 children)

That's nerve wracking. But you know what's worse? Finding code that shouldn't work, not being able to figure out why it works, and having to leave it in production because of you "fix" it, the whole damned thing will come fluttering down like a house of cards in a slight breeze.

[–] xantoxis@lemmy.world 19 points 1 year ago (1 children)

There is actually an approach for this. Leave the cursed code in, but implement it again in the same file, from scratch, without looking at the cursed code. You'll either unthinkingly fix the combination of conditions that led to bad code being correct, or you'll realize why that was what you needed the whole time.

load more comments (1 replies)
[–] dan@upvote.au 20 points 1 year ago (1 children)

As someone with 20+ years coding experience, this only gets worse as you get more experienced.

[–] MajorHavoc@lemmy.world 8 points 1 year ago (1 children)

Yes. I tell my mentees this all the time.

Decades ago, as a new developer, I expected to stop getting stuck like this.

Instead I get stuck, like this, on really interesting problems with really valuable solutions.

So that was a fun surprise, I guess. Lol.

[–] Stumblinbear@pawb.social 4 points 1 year ago* (last edited 1 year ago) (1 children)

I was stuck on a problem for six months, and after figuring that out I banged it out in an afternoon. If anything you get stuck for even longer

[–] dan@upvote.au 3 points 1 year ago (1 children)

If I'm stuck on something for more than a few hours, I ask one of the more junior developers on my team if they have any ideas. Sometimes, a new perspective helps a lot!

[–] Stumblinbear@pawb.social 3 points 1 year ago

Unfortunately it was for a personal project and nobody else understands the system so, haha

[–] AVincentInSpace@pawb.social 18 points 1 year ago* (last edited 1 year ago)

You should switch to Rust. Through massively impressive feats of compiler engineering and a phenomenal amount of novel syntax constructs that make Rust the hardest language for existing programmers to learn, the rustc team has successfully managed to move this agony from after the program compiles to before.

This is clearly an improvement.

[–] dingleberry@discuss.tchncs.de 16 points 1 year ago

There are way too many Notepad enthusiasts out there.

[–] LolaCat@lemmy.ca 11 points 1 year ago
Image Transcription:

number-1-haxorus-fan

[In large text]
The coding experience:

"Okay, everything looks good, time to run it"
Code fails
"What? Let me try again…"
Code fails
"What the fuck, where's the issue???"
Checks syntax error
"GOD DAMN IT TELL ME WHERE THE FUCKING ISSUE IS YOU PIECE OF SHIT"
Hopelessly tries to fuck around with the code and find the error
"PLEASE PLEASE JUST WORK WHY WON'T YOU WORK-"
Notices obvious error that I should have noticed like 15 minutes ago
"Oh. I'm a fucking idiot."
Code works now
"I have gained nothing from this experience and I will do it again"

#coding #coding pain #python #coding hell
#this is from painfully personal experience
#but replace 15 minutes with a fucking hour

57 notes

[–] MajorHavoc@lemmy.world 11 points 1 year ago

I have gained nothing from this experience and will do it again.

Whichever vendor or framework puts that on a shirt will get free advertising from me.

[–] fibojoly@sh.itjust.works 9 points 1 year ago

Then when it's a job, you can replace that with weeks. But instead of a silly syntax error, it's a slow memory leak that nobody seems to have noticed for years, but that now forces you to restart your service every day at the very least. And we just spent an afternoon, six people, looking at it and only making it worse.

Don't you love programming? I sure do!

[–] traches@sh.itjust.works 9 points 1 year ago

This is why linting and static typing are mandatory

[–] Vishram1123@lemm.ee 8 points 1 year ago

Me and my cs prof i'm TA'ing for trying to debug two swapped lines for an hour yesterday be like

[–] tiredofsametab@kbin.social 8 points 1 year ago

Write smaller units. Test those units. Save time.

[–] WhyYesZoidberg@lemmy.world 6 points 1 year ago (1 children)

15 minutes.. rookie numbers

[–] _dev_null@lemmy.zxcvn.xyz 3 points 1 year ago

I've spent more time wondering if I farted and forgot or if it was the guy in the cube next door.

[–] tdawg@lemmy.world 6 points 1 year ago

Hey at least they didn't have to trace a bug in their core framework. Only to find it is both in the issue tracker and 10 years old, and there is no offical fix. So you have to make a hacky patch yourself

[–] wraithcoop@lemmy.one 5 points 1 year ago

I've learned that in these scenarios, show it to somebody else. They'll see the stupid mistake you made within seconds.

[–] xantoxis@lemmy.world 4 points 1 year ago (1 children)

The thing is, you don't make syntax mistakes on purpose. Especially if you know a language extremely well, a syntax error will happen at random, you won't notice it (if you did, you would have fixed it), and it therefore becomes invisible to you.

Part of your brain "knows" there's no error, because you know the language extremely well, and because if you had made an error, you would have fixed it.

This leads to acute, irrational frustration. It's very human.

There's not really a solution, just smoke more weed and take your eyes off the screen occasionally.

load more comments (1 replies)
load more comments
view more: next ›