Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Zamiell opened this issue Apr 13, 2020 · 5 comments
Open

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

Zamiell opened this issue Apr 13, 2020 · 5 comments
Labels

Comments

@Zamiell
Copy link

Zamiell commented Apr 13, 2020

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.

@ljharb
Copy link
Collaborator

ljharb commented Apr 13, 2020

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.

@zeabdelkhalek
Copy link

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

@ghost
Copy link

ghost commented Jan 20, 2023

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

@Prince-GH

This comment was marked as spam.

@bitcooker
Copy link

The objective of this style guide is indeed to provide specific coding prescriptions to ensure consistency and best practices across codebase. The inclusion of the "Types" section without prescriptive guidance does seem to deviate from this goal.

If the "Types" section is meant to provide foundational knowledge essential for understanding subsequent prescriptions, its presence can be justified by making this intent clear.

Possibly :

  • Add an Introduction: Briefly explain that the "Types" section is foundational and necessary for understanding the context of other prescriptions in the guide.
  • Provide Contextual Examples: Even if not explicitly prescribing "good" or "bad" practices, include examples that highlight common pitfalls or best practices related to JavaScript types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@ljharb @Zamiell @zeabdelkhalek @bitcooker @Prince-GH and others