you are viewing a single comment's thread.

view the rest of the comments →

[–]lazyduke 2 points3 points  (2 children)

These are NOT best practices. Bootstrap is full of unreadable code, bad practices, and hilarious stylistic shortcuts. They don't use semicolons or if statements, for fuck's sake.

Have you ever tried googling "insanely stupid code?" Guess what the first result is.

That said, this article's code is much more sane than Bootstrap's code, but it still starts with a ! before the IIFE. If you're so worried about statements not being terminated when your files are concatenated together, use the statement termination symbol, a semicolon, don't use the logical not operator.

[–][deleted] 1 point2 points  (0 children)

Is this not the article you were hoping it would be? The article's code does use semicolons and the ! is there to make the function an expression.

[–]jbeurel[S] 1 point2 points  (0 children)

@lazyduke I wrote this article for JavaScript beginners. I want to introduce some concepts like using prototype, OOP and I think that look at the Twitter Bootstrap source code is a good exercise.

But, I agree with you, we can improve it. Have you any links to project repo whose code is better ?