javascript icon indicating copy to clipboard operation
javascript copied to clipboard

What is the point of the "Types" section of the guide?

Open Zamiell opened this issue 4 years ago • 5 comments

Greetings,

The second section of the guide is "References", which is a prescription to use "const" over "var". This section showcases a "bad" code example and a "good" code example. So far, so good.

The first section of the guide is "Types", which, as far as I can tell, doesn't offer any prescriptions at all. It is simply educating the reader on the how variables work in the JavaScript programming language. Furthermore, the section does not show any "bad" code examples or "good" code examples.

Is there a particular reason that this section is included in the style guide? It seems notably out of place - every other section seems to impart a specific coding prescription. There is a time and a place to teach JavaScript newbies the basics on how the language works, and it doesn't seem like it should be in a style guide.

Zamiell avatar Apr 13 '20 19:04 Zamiell

  • https://github.com/airbnb/javascript#types--primitives

Symbols and BigInts cannot be faithfully polyfilled, so they should not be used when targeting browsers/environments that don’t support them natively.

But yes, I agree, the guide is a mixture of instruction and guidelines, and that's OK.

ljharb avatar Apr 13 '20 19:04 ljharb

Agree, I think this guide should be a best practice notes not a JS Tutorial !!!

zeabdelkhalek avatar Apr 24 '20 05:04 zeabdelkhalek

I also think this part should be removed from the style guide, as it has nothing to do with the style guide of your JS guide itself

ghost avatar Jan 20 '23 07:01 ghost

Agree, I think this guide should be a best practice notes not a JS Tutorial !!!

Prince-GH avatar Feb 20 '24 16:02 Prince-GH