• @[email protected]
    link
    fedilink
    English
    47
    edit-2
    6 months ago

    Missing type or identifier.

    A const what?

    Also, I read that you have to assign a const when it is declared. Something doesn’t feel right about this statement.

        • @jaybone
          link
          36 months ago

          Let me just coalesce these types for you.

          • @Ziglin
            link
            66 months ago

            But the CPU would be thoroughly confused in many cases. Like if you added a number with a string. This means low level tools have too and therefore people who do low level programming are confused and the generally carefree has rules can make it difficult to debug js.

            Also I think rust making you write “safe” code unless you explicitly tell it otherwise is a great thing.

            So I think that tools telling the user that they’re doing something wrong is great, tools telling the user to stick with physical limitations for better performance are completely valid but what js does seem really weird with having constants be reassignable, making them nothing but labels combined with HTML I find it even more annoying.

              • @Ziglin
                link
                26 months ago

                I’m always more confused by adding integers to strings or something being an empty object because something else was undefined and the console didn’t bother to tell me.

          • Ephera
            link
            fedilink
            2
            edit-2
            6 months ago

            I think, most of us consider it part of the job of a good tool, that it prevents us from using it wrongly. Allows us to use it much more recklessly.

          • @[email protected]
            link
            fedilink
            English
            -2
            edit-2
            6 months ago

            You’re downvoted, but you’re 100% right. The web is designed to not break. Engineers who can’t accept that don’t get to complain

      • @Static_Rocket
        link
        English
        7
        edit-2
        6 months ago

        Well, assuming you meant type specifier, at least not before C99. After that it is required. C23 explicitly states that a type specifier is required for all declarations.

        If you actually meant type qualifier, then no. That was never required.