Skip to content
0:00 / 0:00

#automaticsemicoloninsertion#javascript

Semicolons cannot save you! - FunFunFunction #9

Fun Fun Function

257K subscribers • 6 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • May be out of date. Uploaded 10 years ago, in an area where tools change fast.
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

41K views10 years ago1 recommendation

Programming languagesWeb developmentJavaScriptLanguage design and type systems

An explanation of Automatic Semicolon Insertion in JavaScript and why adding semicolons does not mean you can ignore how it works.

💖 Support the show by becoming a Patreon patreon.com/funfunfunction By all means, use semicolons for consistency, or just because your team likes it that way because it’s more C-like, or frankly just because you like how it looks. But don’t buy into the religion that it absolves you from thinking about automatic semicolon insertion. The ASI is always there, and and you need to be always vigilant about it, no matter if you add semicolons or not. Full script here: medium.com/@mpjme/bf991756174e More reading: blog.izs.me/post/2353458699/an-open-letter-to-javascript-lea…

Why it's here

1 person recommends this

What people say. Recommended for its discussion on JavaScript's automatic semicolon insertion.

u/CaptainStackin r/programming • Recommends

On “Imperative vs Declarative Programming”

MPJ of the YouTube channel FunFunFunction (link to this video discusses this in a video called semicolons cannot save you (link to this video I think it's a good discussion, though based on his own points I actually draw the opposite conclusion (still strongly recommend his channel for great weekly programming discussions). I think it makes code both safer and more readable and kind of wish they enforced at the language level in JavaScript. Here's a quick breakdown of the points if you don't feel like watching: JavaScript features automatic semicolon insertion (ASI), a feature that's commonly considered unhelpful and can cause problems in certain cases. For instance: function randomNumberA() {…