I am currently learning Javascript, and there is one element of the syntax that I can just not seem to nail down. That element is adding semicolons at the end of each line. I have learned Python and Ruby, and written a ton of both, so the lack of semicolons is stuck in my mind! Is there a way to drill that (or even any syntax, to make this more useful to future readers) into my brain?
Tell me more
×
Programmers Stack Exchange is a question and answer site for
professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
|
|
No tricks for this I'm afraid. As @Raynos pointed out, semicolons are optional. But if you want to learn the habit in case you might learn other languages that require them, just code slowly and remember it for each line. As you get used to the idea, you'll be able to code faster and it'll become a habit over time. You'll only get it in the same way you got the habit of not placing any: by "writing a ton of the language". |
|||
|
|
|
In week #3 and language #3 of CS 103, Comparative Languages, our prof took questions about what problems we were having. Someone said that they couldn't remember which languages had semicolons as separators, and which as terminators. Prof said if you couldn't deal with that, you were gonna fail. |
|||
|
|
