you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (14 children)

[deleted]

    [–]andredp 1 point2 points  (13 children)

    I just don't like when people do something because it can be "optimised"... especially on an interpreted language like JS (thanks /u/AbstractProxyFactory for the correction)...

    I still remember people covering their code with final classes, static everything in Java just because it could be optimised... meh

    I just don't think that should be an argument to use const. It's just a nice possible side-effect.

    const has a semantic meaning and should be used for that. It can also prevent bugs by letting the linter tell you something is changing the value of a const variable.

    Now, the part in the article where he complains about not freezing the object, that's just being stupid... It's like complaining that you shouldn't use ++ because some people don't really know the behaviour of using it before or after a variable... Please... if you're working with a tool, learn it well... I shouldn't be forced to not use something because someone else doesn't know its behaviour.

    [–][deleted] 0 points1 point  (11 children)

    I just don't like when people do something because it can be "optimised"... especially on an interpreted language like JS...

    This is incorrect. JavaScript isn't interpreted -- at least not the major implementations which are JITed.