this post was submitted on 07 Jan 2024
1 points (100.0% liked)

Programmer Humor

19503 readers
1088 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Thorry84@feddit.nl 0 points 10 months ago (3 children)

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.

[–] janAkali@lemmy.one 0 points 10 months ago* (last edited 10 months ago) (1 children)

Yes the compiler/interpreter can figure it out on the fly, that's what we mean by untyped languages.

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'.

[–] nul@programming.dev 1 points 10 months ago

Most of my code is untyped. First I type it, then I realize it's all wrong and use backspace to untype it.

[–] Sharpiemarker@startrek.website 0 points 10 months ago (1 children)

Untyped as in written? Or is this programming term I'm not familiar with?

[–] RagingRobot@lemmy.world 0 points 10 months ago* (last edited 10 months ago)

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.

[–] Blue_Morpho@lemmy.world 0 points 10 months ago (1 children)

And as stated both have their merits and their faults.

Yes! Just because a compiler could guess the type doesn't mean it should. Elon didn't understand the meme at all.

[–] AVincentInSpace@pawb.social 0 points 10 months ago (1 children)

why would you not want it to? what circumstance, other than an integer not given an explicit type, could it guess wrong?

[–] RepulsiveDog4415@feddit.de 0 points 10 months ago

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