Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Tale of Two Bootstraps: Lessons Learned in Maintainable CSS (pamelafox.org)
71 points by timf on Dec 16, 2012 | hide | past | favorite | 12 comments


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.


Intellij supports CSS refactoring to some extent:

https://www.jetbrains.com/editors/html_xhtml_css_editor.jsp?...


IDEs like Eclipse have this problem solved for languages like Java, so it's doable. I don't know why I've never seen an equivalent solution for HTML/CSS.


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.


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.


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.


Why? If I'm putting out a C++ app on Qt, surely I'll upgrade occasionally to squash bugs, improve platform integration, and use new toolkit features to make my new application features.

Just because my application now gains traction, I wouldn't throw out or fork the GUI toolkit. Maybe add some extensions and helper libs, maybe throw some patches upstream, but not NIH the whole thing.

Passing a common maintenance burden off to FOSS is a glorious win. When you fully appreciate Bootstrap, you'll see that's what it does.


It guess it depends on whether you consider bootstrap a framework or a template. I know the bootstrap website banner uses the word "framework", but I definitely consider it a template.


However, at the same time a bootstrap lays the framework for a project and the stronger a framework is the easier it is to build off of it. Creating a new version of a bootstrap is to allow developing to be easier in the long run.


> 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


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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: