Misusing Bootstrap
10clouds.com
10clouds.com
js gurus will decry jQuery - "learn to do it by hand"
php gurus will decry Wordpress - "it's a mess, learn to do it by hand"
and ... wow - front-end developers decrying bootstrap - "it's a mess, learn to do it by hand"
They're all not entirely wrong, but the specialist nature of their roles should not be ignored. Do you have a team of web devs ready to build something that is vital to your business and will be mission critical? Building on something that's not wordpress might be a good choice.
Are you trying to squeeze out every ounce of bandwidth performance and CPU optimization? Yeah, jQuery might not be the best choice.
But these libraries/products work "good enough" for so many people that it'll be a long time before anything dethrones them as the 'go to' tool for problem X. There's too much of an ecosystem built up around each one.
EDIT: I say this as someone who is generally pretty anti-wp, but I still recommend and use it for certain projects, it's just not my default go-to for everything.
I don't think a skilled front-end developer would take Bootstrap just for responsiveness and extras. I mean, 3 or 4 mix-ins for building columns, offsets and rows? Button defaults and tabs? Would you grab a behemoth for this?
Also, you wouldn't be constrained. Bootstrap means a predefined set of breakpoints for responsiveness: you can change their values, but not their number - you'll always get 4 breakpoints. Bootstrap also means a float-based grid system; you may want a flexbox based solution if you're targeting new browsers. And, of course, another pet peeve of mine: Bootstrap-powered HTML source-code looks all the same (a bunch of .row and .col.xs-N). Of course, you can use the mix-ins, but I think every Bootstrap user can relate: the mark-up for the user details page looks an awful lot like the order page. :) I actually prefer to write (and, even more, maintain) mark-up with semantic classes.
As I said above, it's not a big problem and using only the grid is a wise thing to do. I just don't think it adds that much; might as well implement it myself, targeted to my needs (and I'll do it once or twice, then reuse).
Why waste the time rewriting it?
Anyway, there's a rather diffuse line between reinventing the wheel and optimizing/fitting your own particular needs. I can easily agree that I've ended up - many times - in the first region while trying to reach the latter. Still, I'd say "no harm" if a) you got a cleaner, more legible source code; b) you got a better grasp of your solution; c) you're learning; and d) saving a few milliseconds from each of your users.
Even seasoned pros can gain something from jQuery. I know, I know: most jQuery-based code is bad, and the need for jQuery is becoming smaller everyday, but it still is among the nicest pieces of JavaScript. jQuery can save you time and boost your productivity without "imposing", as Bootstrap does (and any other CSS framework, as CSS is inherently global).
EDIT: "generic wisdom about Bootstrap being just fine for most things (which it absolutely is not)"
Again, no, I said it's good enough for most people. That's not the same thing as "just fine for most things". I'd probably still posit that it is fine for most things, but that's not what my original position was.
On the projects where it didn't work well, there were stakeholders who kept insisting on "little" tweaks.
On the projects where it worked, the stakeholders said "that looks awesome" on the first cut.
Not surprisingly, the projects where the stakeholders were happy with generic Bootstrap were the ones that ended up looking and functioning better, in my opinion.
OTOH Bootstrap's grid system is almost a must have when I'm writing a responsive application. There have been a few projects where I've ripped out the non-grid parts of BS because that was all I wanted.
The only wish I could make is a "simplified" responsive menus/navbars, so it would be easier to build on top of that after.
Regarding push/pull, Bootstrap is the only grid system I've used that has had this. The use case is when you want
[x] [y] [z]
on desktop to be [z]
[y]
[x]
on mobile.Though I do agree with the article in some respects. Bootstrap can be a bloat on a heavily designed site. You end up only using the grid for instance, and there are lighter weight frameworks for that.
Bootstrap is a godsend to strapped IT departments with no designers backing them though. Can really break the old schoolers out of table based layouts and nice pretty buttons quickly.
I leaned more heavily on Bootstrap when initially wrapping my head around RWD, but now that it has "clicked" in my brain, I'll be switching off of Bootstrap to something smaller. Bourbon and Neat more than likely, but I do need to look into Pure CSS too.
Projects that allow you to work within bootstrap's limitations and simply tweak the colors and other basics are a dream come true and wind up looking great. Not design award grade artistic, but functionally very good in a way that's not hard to look at.
Anything where you need functionality, not flashiness.
This is because it allows application developers to do just that - work on the application. They have pre-built components to use, that look reasonable and fit together, without needing a dedicated front-end developer to constantly futz with templates or a static version of the app when management asks for an extra form field.
Admittedly semantic classnames are nice to haves, but they become a vocabulary you have to teach others, whereas Bootstrap has built a useful enough shared vocabulary and strong enough documentation on it that it is rather reliable across the spectrum of developer skill level and familiarity.
That's all problems that need solving for pure utility interfaces and bootstrap is very solid at solving those, especially if you don't care that your utility interface looks like "just another bootstrap site".
I wrote about 10-20 lines of CSS.
Even though it's expressly an "admin" UI for the app (which has no public web UI) they would not accept an app made with no stylesheet and just a page of form elements. It would be practically unusable without any CSS, and the time it would take me to write the CSS for just the navigation bar OR just the pagination system OR just the reasonable form layout on multiple screen sizes, dwarfs the amount of time it takes me to download bootstrap and copy the dist folder.
For a public facing website - I think bootstrap is terrible, and I'd rather see something like Bourbon used, where semantic markup is then styled.
This isn't about that. It's about getting a usable interface that takes almost zero time to implement.
Even then, those are prototypes that get replaced by more adequate things eventually. Not to mention, in many situations I would actually write better (as in more robust and more maintainable) solutions than Bootstrap with less CSS and mark-up funk, but that might stem from my misuse or insufficient knowledge of how to use bootstrap.
Another factor I'm considering is that a packaged/sold product(s) that use Bootstrap for the UI means that someone purchasing/using the product(s) can make use of a "bootstrap theme" to apply a new basic appearance (fonts, colour scheme, possibly icon set, spacings, etc) pretty much just by loading in a new theme.css file
It just doesn't matter if they all look the same, which is what happens if you use Bootstrap out of the box.
I just did a side project and used 4 because they finally moved to rems.
Don't use Bootstrap, don't use jQuery, etc.
I mean the basic concept of the article is the assumption that you, the average reader, were going to use it in the first place, which means it's probably wildly successful.
And the comments fall into the same kind of area, "Sure, if you're some kind of big baby amateur idiot who doesn't know what they're doing, then go ahead and use one of the most popular tools in this space."
It's the exact same impulse that says you're not a real dev if you use language X or framework Y.
If you ever need anything please don't/ Hesitate to ask someone else first/ I'm too busy acting like I'm not naive/ I've seen it all, I was here first [1]
All the points resonate with me and my experience (actually, they're all quite well put), but this one is the biggest. Bootstrap isn't quite brilliant in terms of CSS architecture (which is a tricky subject per se, due to many factors such as the global nature of CSS). And the biggest issue is that CSS architecture is very much snowball-like: a bad decision will imply future bad decisions or practices. The example given in the article is quite demonstrative: an excessively-specific selector which, to be overridden, would need a even more specific one.
In my opinion - and I've had the bad luck to join two big projects which used Bootstrap from the beginning - if your project is to be maintained or has at least a medium-ish size, forget Bootstrap. It doesn't give you that much. A normalization solution, typography, buttons and a grid system, just roll your own, with your own presets and much less bloat. It's not a big effort at all, you can look at what Bootstrap and others have done (to borrow what you like), and your team will have a firm understanding of their code.
I back up what you say 100%. Bootstrap is not acceptable for production code, its supposed to be a rapid prototyping tool.
I have found whenever it is added to a project, the technical debt it bring that you have to keep fighting is never worth whatever the initial savings was. I build without it wherever possible and avoid a lot of problems and maintenance.
For smaller projects why shouldn't I be able to use it? If I'm building a 5-10 page website for a small business it's a prefect fit. I can customize the colors and use the image sliders and other features already given to me. Add what I need and I have something that's easily to remember at a later point.
If I created a larger app why would I want to rewrite everything for prod. It makes it easier if multiple people are working on the UI because we are all working with bootstrap. Newer people are able to get up to speed on the project faster since it's a common framework.
It's not that hard to build really lightweight HTML and then just only write the CSS you need. I specialize in taking sites and making them responsive, and the first thing I do is go in there and get rid of all the classes extra tags everywhere clogging up the works.
With tools like Bootstrap you end up using bloated, heavy HTML to get a few mediocre responsive breakpoints, but it's no comparison to a properly responsive page.
Here's some button and input styles in a single-file HTML5 app: http://staticresource.com/encode
Here's a set of responsive content blocks where the breakpoints are measured based on the width of the block, not the browser: http://staticresource.com/block-styles.html
Or check out the CSS of http://elementqueries.com to see how a simple, easy to read layout can be done with just a touch of CSS at the top of the page.
None of these use Bootstrap, and if I had even so much as linked to them, I'd be working against the defaults they bring in.
Here's what I use as my 'reset' that I bring in to every project, it's a much smaller set of opinions and leaves me more free to just build what I want: https://gist.github.com/tomhodgins/c4988b9d9878763ae861
I've gone with the "ala carte" solution and just grab a minimal grid system, a minimal css framework for buttons and other smaller components, and a normalization tool. I've found by being able to pick and choose my tools, it still takes a lot less bloat than BS.
Having said that, I still find it useful. For example, I've been working on a large enterprise billing application. We used BS out of the box and although we ran into a few issues, it saved us months in design work and allowed us to start writing the services and UI pages much faster than if we had we taken a more "ala carte" approach like the kind I prefer.
The people paying my bills would rather have functionality that looks good enough now than the same functionality that looks beautiful three months from now.
My pet peeve with Bootstrap, however, is its usage in larger applications, in applications with very customized styles and/or a defined styleguide. If you're spending a minimum effort in developing a web app and/or specific styles, then Bootstrap will - very, very soon - be a liability (performance and mantainability-wise).
Requirements gathering is hell though, which is where my team actually earns their money.
Let's have a little chat about "how people misuse measurements to talk themselves into premature optimization"...
I run a bootstrapped product and would LOVE to create my own css rules from scratch but bootstrap gives the team flexibility to build on top of it quickly and just about good enough that our clients give us money. That is what matters to us. Could we care a bit more about the selectors defined by bootstrap ? Sure. Does it matter to our paying clients. Not a single bit.
This isn't a good premise to start with. I think a lot of people would be surprised that plain HTML, CSS and JavaScript is a great solution to small- and medium-sized problems. Overuse of frameworks and libraries is why the modern web is such a horrible place, especially on mobile or slow networks.
That said, I agree with the author that it's not the best tool for every, or even most, jobs. You could use it to run a blog, but why? You could build an online e-commerce site out of it eventually, but dear God why?
And that's the beauty of the modern Web. There are so many awesome frameworks out there that do a few things very well, and others that do just about everything decently enough; it's an embarrassment of riches for anyone involved in the industry.
For those more experienced and possessing sound design knowledge and more complex/detailed development goals, there are better choices.
If I'm primarily a coder who doesn't really understand CSS and doesn't have time to become a front-end designer, what should I be using? Ideally I want something that will look pretty enough for end users, and have customizable themes that they can play with--without involving me.
Is there a better out-of-the-box solution than Bootstrap?
Although there are lightweight grid solutions such as skeleton[0] which I personally really like, which make layout easy, you would still probably need to override some of the presentation styles.
Bootstrap was never meant to be used as a website development framework
This seems odd. Most Bootstrap styles aren't namespaced, so it's a nightmare to add Bootstrap to existing projects of moderate size. In my experience, it only makes sense to incorporate Bootstrap at the early stages of a project as a "web development framework."For the latter use-case, I am consider using inuit.css[1] which provides the components but without any defaults which seems perfect for my use case.
If nothing else, it raises the bar of mediocrity.
I default these days to building up CSS from scratch. The decision to use a framework has always bit me bad in the past. I do not want to have to become an expert in a framework, but it seems you need to just to be able to use it effectively.
All that to say, there is value in "becoming an expert" in a framework.
You can spend time learning Bootstrap's eccentricities, or you can learn something useful like OOCSS. One will make you really productive at making websites that are instantly recognizable as Bootstrap-based, the other will make you productive implementing any kind of design.
Time spent fighting Bootstrap is wasted time from this perspective. Time spent fighting your own designs is time spent learning valuable lessons about front-end coding. You may gain a marginal speed improvement with Bootstrap, especially (and perhaps only, I find Bootstrap slows me down) if you're new at front-end, but you're paying a steep price for it down the line, if you ever plan on building a site that doesn't work with the framework.