News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by TimTheTinker on Wednesday September 25, 2019 @12:52AM (#21067708)
I think it can be argued both ways. I've seen a large TypeScript codebase with a pre-commit hook that enforces use of const on all non-reassigned variables. With that being done everywhere, it made for easy reading - whether a variable was being reassigned or not effectively became annotated in its declaration.

On the other hand, there are some good reasons not to use use const everywhere we can. Paul Sweeney lists a few here: https://medium.com/@PepsRyuu/use-let-by-default-not-const-58...

I'm not sure where I land yet. Perhaps it's a decision to make separately for each codebase.

Re:V8 adds support for top-level await by elyobo on Wednesday September 25, 2019 @02:28AM (#21068237)
I don't think I'd call any of those reasons good; the main thrust of them is "const doesn't do everything, so don't let it do anything". If that line of reasoning is appealing, then one might as well continue using var.
Re:V8 adds support for top-level await by megous on Wednesday September 25, 2019 @09:37AM (#21070629)
The main benefit of let/const over var is that it's block scoped. The benefit of const over let is pretty much nothing, much. It only prevents some limited form of re-binding. You can still easily re-bind const variables from inside a function:

    const x = 1;
    (function() {
        const x = 2;
        console.log(x);
    })()
or from an argument:

    const x = 1;
    (function(x) {
        console.log(x);
    })(2)
So it has limited value in any code that uses closures.
Re:V8 adds support for top-level await by e12e on Wednesday September 25, 2019 @03:12PM (#21074214)
Shadowing isn't rebinding?

If you've declared const x = 1, then that will hold for your scope?

If you go into a separate scope... Well, then you're in a separate scope?

Re:V8 adds support for top-level await by elyobo on Wednesday September 25, 2019 @03:16PM (#21074255)
Neither of those rebind the `const x`, which will continue to hold the value it was given.