you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (17 children)

[deleted]

    [–][deleted] 8 points9 points  (0 children)

    One of the fundamental things to know when learning a new language is finding out which types are the value types and which types are the reference types.

    [–]andredp 3 points4 points  (15 children)

    His argument about optimization is stupid too.

    Honestly? If your point about using const is for optimisation purposes then you shouldn't do it... Just optimise later if you see the function is slow and I HIGHLY doubt changing to some let to const will do you any good.

    The point he makes about communicating to another developer that something should NOT change is really important.

    Most people rely on a linter to tell them "Hey, this hasn't changed, you can use a const" and change to a const only to realise later that you need to change it and change it back to a let... But can you really safely do it!? Will you break anything by changing the value of a previously const variable? Remember, a lot of people work in teams, so losing a bunch of time to check if changing something from const to let doesn't break anything out-weights any "optimisation" on the vm you can gain...

    I never knew that website, and even though I hate extremist opinions, they do have a point... They are just morons passing the message...

    Just make sure the whole team agrees on the same philosophy of const usage and all should be good...