Hacker News new | past | comments | ask | show | jobs | submit login

I don't think the "Don't use too many floats" is meant to say anything about performance, but about maintenance.

I think the point is, that if you have to put "float" in lots of declaration, you're missing some abstractions in your css. Most likely a grid plus some classes for inline lists.

Again, CSS Lint is very opinionated, and some of it opinions are contrary to various best practices (especially the fundamentalist approach to not let any classes in the HTML have anything to do with presentation). But from the perspective of these opinions based on how to write maintainable CSS and HTML for large sites, the rules makes a lot of sense.




I don't think maintenance difficulties are related to number of float declarations.

I could make layout a ticking time bomb just by using one shrink-wrapped floated column without clear.

I could make mess of an entire site with just:

    .left {float:left}
(which I've seen used in practice)

And I can write perfectly maintainable code with lots of floats if I have them sized and cleared properly.


Having too many floats is the canary in the coal mine. It's there to help you have a sense of how well you are structuring your CSS.




Registration is open for Startup School 2019. Classes start July 22nd.

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

Search: