this post was submitted on 07 Jan 2024
1 points (100.0% liked)
Programmer Humor
19623 readers
3 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yes the compiler/interpreter can figure it out on the fly, that's what we mean by untyped languages. And as stated both have their merits and their faults.
Elon doesn't know what the words mean and just chimes in with his AI future BS.
Are there untyped languages? You probably meant 'dynamically typed languages'.
But even statically typed languages can figure out most types for you from the context - it's called 'type inference'.
Most of my code is untyped. First I type it, then I realize it's all wrong and use backspace to untype it.
Untyped as in written? Or is this programming term I'm not familiar with?
By typed they mean declairing a type for your variables.
In some languages, variables needs to be told what kind of data they can hold. That's it's type. For instance a number without decimals would be an integer type. While text might be a string type or a list of character types.
Other languages don't require types and sometimes don't even support them. They will just infer the type from the data that's in the variable.
If you see Elon Musk please explain this to him.
Yes! Just because a compiler could guess the type doesn't mean it should. Elon didn't understand the meme at all.
why would you not want it to? what circumstance, other than an integer not given an explicit type, could it guess wrong?
Well, if there is nof fixed (explicit or implicit) type it's imposible for the compiler to optimise your code. Also imho programming with typed languages is way easier because your IDE can recognize function argumentd before you compile/run. I tried python and found it baffling how anyone can get any work done with it :D