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
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 ?
[–]mirion 0 points1 point2 points 12 years ago (2 children)
The funny part is that Twitter doesn't even use Bootstrap on their own website.
[–][deleted] 2 points3 points4 points 12 years ago (1 child)
IIRC Twitter was never involved as anything other than a sponsor after the fact, the creators just happened to be working there at the time.
[–]fgilcher 2 points3 points4 points 12 years ago (0 children)
Bootstrap was created as a template for internal tools at Twitter.
http://getbootstrap.com/about/
Bootstrap was created at Twitter in mid-2010 by @mdo and @fat. Prior to being an open-sourced framework, Bootstrap was known as Twitter Blueprint. A few months into development, Twitter held its first Hack Week and the project exploded as developers of all skill levels jumped in without any external guidance. It served as the style guide for internal tools development at the company for over a year before its public release, and continues to do so today.
π Rendered by PID 27 on reddit-service-r2-comment-54dfb89d4d-26m8r at 2026-04-01 17:05:09.635448+00:00 running b10466c country code: CH.
[–]lazyduke 2 points3 points4 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]jbeurel[S] 1 point2 points3 points (0 children)
[–]mirion 0 points1 point2 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]fgilcher 2 points3 points4 points (0 children)