Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[devtools-rfcs] Discussion: use of let and const

11 views
Skip to first unread message

Julian Descottes

unread,
Apr 3, 2018, 2:45:49 PM4/3/18
to dev-developer-tools
A new proposal has been posted on https://github.com/devtools-html/rfcs

subject: use of let and const
link: https://github.com/devtools-html/rfcs/issues/44

> This is something that I noticed in our codebase on mozilla central, but
not
> in our github codebases - the use of `var`, `let` and `const `is pretty
> inconsistent. Linting is also turned off for a number of files so we
don't
> even get errors for using var half the time. We should turn on the
linting,
> but there remains the issue of let and cost which are currently used
somewhat
> without clear intention.
>
> My thought is we should use `let` and `const` strictly, as it reduces the
> mental load when reading code. If `let` is always used, you have to watch
for
> reassignments, and it makes it easy to miss potential problem areas. On
the
> other hand, using `const` wherever possible, and `let` _only_ when
something
> is going to be reassigned, you can pay less attention to this rather
tedious
> part of code reading.
>
> In this same vein, I would recommend to have a linting rule that does not
> allow modification of arguments.
0 new messages