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

Semicolons #24

Open
feinstaub opened this issue Jan 20, 2018 · 3 comments
Open

Semicolons #24

feinstaub opened this issue Jan 20, 2018 · 3 comments

Comments

@feinstaub
Copy link
Contributor

I remembered reading something that said, one can (and therefore should) omit semicolons at the end of a Javascript code line.

Since jshero does use semicolons, I did a quick research. Examples that recommend no semicolons:

Articles and styles that recommend to use semicolons

The last article complains (among other things) that "Standard JS" is named like this despite the fact that it is only one proposal among others. Interestingly, even in "Standard JS" there is subproject called "semistandard" which adds semicolons to the style (see this page on the bottom).

The conclusion that I draw is that using semicolons is a good thing. Since jshero uses semicolons you probably came to same conclusion. Unless there is something interesting to add about this issue, it could as well be closed. :)

@feinstaub
Copy link
Contributor Author

Unless there is something interesting to add about this issue

e.g. something to say to students who ask why to use semicolons who figured out that the code works also without them.

@strenkel
Copy link
Owner

The No-Semicolon position is interesting (never heard before), but I definitely prefer semicolons.
The problem is indeed how to teach or explain it. (And there are some more things, that you can code in another way: no 'var'; all statements in one line; no brackets in one line if/for statements; ...)
At the moment I have no good solution for this problem.

@strenkel
Copy link
Owner

strenkel commented Mar 19, 2018

Some koans about the optional semikolons should be added!

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

No branches or pull requests

2 participants