you are viewing a single comment's thread
view the rest of the comments
[–] 49 points 2 years ago* (last edited 2 years ago) (19 children)

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.

  • source
  • hideshow 19 child comments
  • [–] 54 points 2 years ago (8 children)

    Its javascript, itll just let you do that

  • source
  • parent
  • hideshow 8 child comments
  • [–] 39 points 2 years ago (7 children)

    it'll just let you do that

    Pretty much sums up JavaScript's entire philosophy.

  • source
  • parent
  • hideshow 7 child comments
  • [+] -17 points 2 years ago (5 children)

    Imo, its better for it. A tool shouldnt tell the user what to do

  • source
  • parent
  • hideshow 5 child comments
  • [–] 6 points 2 years ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 2 years ago (4 children)

    Ackshually you don't need a type qualifier in C

  • source
  • parent
  • hideshow 4 child comments
  • [–] 7 points 2 years 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.

  • source
  • parent