this post was submitted on 16 Mar 2025
5 points (100.0% liked)

Programmer Humor

24039 readers
1327 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
5
C++ (ani.social)
submitted 2 months ago* (last edited 2 months ago) by kiri@ani.social to c/programmer_humor@programming.dev
 
top 15 comments
sorted by: hot top controversial new old
[–] brucethemoose@lemmy.world 2 points 2 months ago* (last edited 2 months ago) (2 children)

Meanwhile, Rust punches you in the face for the mere suggestion. Again. And again.

Python happily nods, runs it one page at a time, very slowly, randomly handing things off to a C person standing to the side, then returns a long poem. You wanted a number.

Assembly does no checking, and reality around you tears from an access violation.

EDIT: Oh, and the CUDA/PyTorch person is holding a vacuum sucking money from your wallet, with a long hose running to Jensen Huang's kitchen.

[–] caseyweederman@lemmy.ca 1 points 2 months ago

Rust just keeps telling me "you didn't actually learn how references work" over and over

[–] stingpie@lemmy.world 0 points 2 months ago (1 children)

I refuse to believe the python one ever happens. Unless you are importing libraries you don't understand, and refuse to read the documentation for, I don't see how a string could magically appear from numeric types.

[–] expr@programming.dev 0 points 2 months ago (1 children)

You don't see how type mismatch errors can happen in a dynamically-typed language? Then why do they happen all the time? Hell, I literally had a Python CLI tool crash with a TypeError last week.

[–] stingpie@lemmy.world 0 points 2 months ago (1 children)

That's not what I'm saying at all. What I'm trying to say is that I can't think of any way a program working with numeric types could start outputting string types. I could maybe believe a calculator program that disables exceptions could do that, but even then, who would do that?

[–] expr@programming.dev 1 points 2 months ago

The point of the joke is not that the Python interpreter will change types mid-program on its own, but that you don't have any real way of knowing if you're going to get the type you expect.

Programs are messy and complicated, and data might flow through many different systems before finally being used for output. It can and often does happen that one of those systems does not behave as expected, and you get bugs where one type is expected but another is used in actuality.

Yes, most likely what would happen in Python is a TypeError, not actual output, but it was pretty clearly minor hyperbole for the sake of the joke.

[–] count_dongulus@lemmy.world 1 points 2 months ago

This is why I will never touch Javascript again. Long ago when I worked on web stuff, half my workflow was spent in the debugger tracing garbage to find where a typo was. The industry moved to Typescript, and now assuming the strictness checks are enabled, if some Typescript transpiles successfully, I can be 95% sure whatever fuckup I observe at runtime is a logic problem.

Weakly typed languages were an awful idea. But in general, if the compiler isn't able to detect most runtime issues (like with C++ here), it's not going to be the most productive language to use for building solutions compared to smarter alternatives.

[–] ICastFist@programming.dev 1 points 2 months ago (2 children)

What surprised me the most was the speed of the compilation, must be a very small program. I tried to compile Godot from source once. Force-stopped it after 3 hours

[–] scholar@lemmy.world 1 points 2 months ago

There's a reason the play is called waiting for Godot

[–] Sylvartas@lemmy.dbzer0.com 1 points 2 months ago

How many cores do you have and what compiler was it ? Also RAM can help with huge codebases iirc. When I was working with UE5 I had the best Ryzen available with 128 Go of RAM, could compile the engine (which is much bigger than Godot) from source in less than 2 hours iirc (yes that is a full clean+rebuild, not just compiling recent changes)

[–] henfredemars@infosec.pub 1 points 2 months ago

Ah, C++. An endless supply of footguns where the difference between a junior and a senior dev is knowing what parts of the language to never use.

[–] riodoro1@lemmy.world 1 points 2 months ago (1 children)

Am I bad at programming?

No, it’s the language thats wrong.

[–] RoyaltyInTraining@lemmy.world 1 points 2 months ago (1 children)

Except that many other languages have proven that C++ is simply terrible at providing meaningful errors.

[–] QuazarOmega@lemy.lol 0 points 2 months ago (1 children)

I wish there was something like that for SQL

[–] rickyrigatoni@lemm.ee 1 points 2 months ago

We can always make a Rust Query Language