News for hackers. Stuff that matters.
Re:MDN converted to Markdown by photochemsyn on Saturday November 05, 2022 @10:23AM (#33481746)
As far as MDN Web Docs, what about variable declaration, i.e. deprecating the JS var in favor of let and const, universally? var has some weird behavior (hoisting) and it seems (no expert here) that only using let and const in code has many benefits. Is it historical inertia, backwards compatibility, preference?
Re:MDN converted to Markdown by wbamberg on Saturday November 05, 2022 @02:33PM (#33484273)
I'm not sure exactly what you're asking about, but if it's our use of `var` in code examples, we had a big project this summer to eradicate `var` in favour of `const` and `let`.

This started out as a project for the Writing Day at the Write the Docs Portland conference (https://openwebdocs.org/content/posts/writing-day-wtd-portla...). It then continued as a much bigger thing: https://openwebdocs.org/content/posts/2022-q3-report/#modern.... Much of the work was done by volunteers, and it's a great example of the kind of project that I don't think would have been possible back when MDN content was in a Wiki.

If you're asking about whether we should un-recommend `var` more strongly: looking at the page for `var` (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...) - well, maybe you are right...