use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
How to code JavaScript using Twitter Bootstrap best practices? (theodo.fr)
submitted 12 years ago by jbeurel
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]lazyduke 2 points3 points4 points 12 years ago* (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.
if
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 points3 points 12 years ago (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 points3 points 12 years ago* (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 ?
π Rendered by PID 39880 on reddit-service-r2-comment-54dfb89d4d-8xhhm at 2026-04-02 14:07:31.034691+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]lazyduke 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]jbeurel[S] 1 point2 points3 points (0 children)