this post was submitted on 17 Dec 2025
475 points (96.1% liked)

Programmer Humor

27977 readers
670 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
you are viewing a single comment's thread
view the rest of the comments
[–] 5C5C5C@programming.dev 16 points 5 days ago (12 children)

Types are not implicit, they're inferred by the compiler when there is no ambiguity about what the type needs to be. This is a huge benefit for refactoring code and reducing maintenance. I acknowledge that sometimes you might care to know the exact type of the variable, and sometimes that's not as easy for a human to infer as it is for the compiler, but every decent IDE will provide inline type hints for you. Interpreting code by reading it in plaintext is an exercise in masochism.

Python is actually the opposite on this, and it's one of Python's worst characteristics. The type is unknown until runtime unless you annotate it, and then the annotation isn't really enforced. It's the worst of every dimension.

C++11 introduced auto, and now the community is split between "almost always auto" and "never auto".

JavaScript needed a whole new compiled language (Typescript) to fix its type system problems, and Typescript is only an incremental improvement at best.

Rust has the best type system of any modern language by far. If you're tripped up by not always seeing the type declarations then you're either focusing on the wrong details in the code or you just need a little more practice. The key thing that needs to sink in for new Rust users is that the compiler is always providing safety rails. That means it's no longer your job to verify that every aspect of the code is correct. You can relax a little and actually have something akin to duck typing without all the pitfalls that usually come with it.

[–] Shanmugha@lemmy.world -4 points 5 days ago (11 children)

Sorry for intrusion, but mhm, nah. I get it there are people who want to play around and have language/compiler babysit them, but there are also people like me who want to see exactly what something is. So no, Rust, just like JavaScript, can be liked by some people, but it is in no way something that has "best type system"

There actually is no such thing as best type system, same way there is no such thing as best language

[–] SlurpingPus@lemmy.world 6 points 5 days ago (4 children)

If you don't realize that x = 10 denotes an integer of some default length, and that y = 10.0 is a float, then the language isn't the problem.

[–] Shanmugha@lemmy.world -3 points 5 days ago (1 children)

I am not gonna look for first x= expression when I want to know type

[–] SlurpingPus@lemmy.world 5 points 5 days ago* (last edited 4 days ago) (1 children)

You betray so much of what your programming environment is like, with that comment. Because, you see, if you can't behold the first x= expression on the same screen or, at very worst, the one above, then your code is majorly and deplorably fucked. It's utterly trashed and is in immediate need of repair. If scrolling back to the first x= expression is overwhelming and exhausting work for you, then the codebase that you work in is mutilated beyond belief and any immediate hope. You need to drop what you're doing, and get to unfucking you code right away so that you can have it in a comprehensible state that isn't dependent on reminding the reader on every single line what stuff is like. You need to learn to split things in smaller things that humans can understand as their own self-contained units of meaning. When you reach the balance of formulating the code in self-contained units that can be comprehended easily, you won't need type reminders on every line.

Not to mention that if you name your identifiers properly, you won't have to wonder what their type should be.

[–] Shanmugha@lemmy.world -3 points 5 days ago (1 children)

Lol. Thanks for the trip in your dreams, but that will be enough for me. Have a good day

[–] SlurpingPus@lemmy.world 4 points 5 days ago

Stage one: denial.

load more comments (2 replies)
load more comments (8 replies)
load more comments (8 replies)