• Thorry84@feddit.nl
    link
    fedilink
    arrow-up
    0
    ·
    9 months ago

    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.

    • Blue_Morpho@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      9 months ago

      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
        link
        fedilink
        English
        arrow-up
        0
        ·
        9 months ago

        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
          link
          fedilink
          arrow-up
          0
          ·
          9 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

      • RagingRobot@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        9 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.

    • janAkali@lemmy.one
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      9 months ago

      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
        link
        fedilink
        arrow-up
        1
        ·
        9 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.