

A Tale of Two Bootstraps: Lessons Learned in Maintainable CSS - timf
http://blog.pamelafox.org/2012/12/a-tale-of-two-bootstraps-lessons.html

======
spion
My takeaway from this story is slightly different - we need better tools.
Especially better refactoring tools.

IMO, using larger names is only a symptom of the main problem - the fact that
we're still using plain old text search and replace. We're relying on it way
too much. And its not a very precise, very fine tool.

Code organization solutions don't seem to fully solve this either.

1) Whoops, we need to change this style everywhere:

"Lets just use classes, then when we want to change the style of our buttons
we can change it at a single place (the class)"

2) Whoops, we need to change the class name

"Lets just use templates containing the class name, then when we want to
change the class name we simply change it in the template"

3) Whoops, we need to change the template... and so on.

I think there is a clear need for better code maintenance tools, for all
languages. Especially the search (and replace) problem. Perhaps search tools
that are based on the language parsers would help.

~~~
mike_esspe
Intellij supports CSS refactoring to some extent:

[https://www.jetbrains.com/editors/html_xhtml_css_editor.jsp?...](https://www.jetbrains.com/editors/html_xhtml_css_editor.jsp?ide=idea#Refactoring)

------
daigoba66
Is it possible that bootstrap was really only designed to "bootstrap" the
design of a web project? I think that eventually the project will mature into
its own. I would not expect a mature project to ever "upgrade" to a new
version of bootstrap as that doesn't really make sense to me.

~~~
sopooneo
I have wondered the same thing all along. And whenever I complain about the
non-semantic nature of bootstrap use, people justify with that same, "but this
is just to get started" argument. So that's what everyone says. But I don't
think it's what anyone actually does.

~~~
daigoba66
I think if semantic markup is important, then don't use bootstrap. Once you
use it, bootstrap will always be part of the project's DNA unless you do a
true rewrite. But, to your point, that almost nevers happens.

------
waxjar
> For a longer article that also recommends that technique for semantic more
> than maintenance reasons, read Stop Embedding Bootstrap Classes in your
> HTML.

I feel so dumb for never having thought of this myself. It really irked me
that my HTML was no longer semantic, which is why I putted off using Bootstrap
for a very long time. I don't have to feel guilty any more :P

------
stagas
I feel like all the tools that allow you to do X or Y faster, actually make
maintainability and debugging magnitudes slower.

Which is why I've started avoiding anything I feel it's going to be difficult
to read and maintain in the future by me or another person. I now always
assume it's going to be another person, even if it's not, but this has helped
me write more clear and concise code.

Even if the initial effort is more time consuming, it makes up for it in the
end. Bootstrap and CoffeeScript are two tools that I feel suffer from that
effect greatly.

Maybe it's a fallacy, because I have nothing to back my claims, but it's only
my personal opinion, feel free to use whatever makes you happy.

------
Beckham
coursera.org passes the first test of a successful Bootstrap site: i've
visited dozens of times and didn't know it was Bootstrap!

