top | item 36415666

(no title)

Antoniocl | 2 years ago

Seemed like most of the examples would just be due to sloppy implementation / a lack of testing edge cases? This is a good lesson to take away I guess, but "defensive CSS" isn't how I see it. It just sounds like thoughtful, intentional, and correct CSS is what's missing in those examples.

Maybe this is obvious to me from having built website builders and themes for them, but when making a product that displays unknown, potentially user-generated content, it's to be expected that the content will be different from the boilerplate designs. Working around edge cases like image aspect ratios and words/sentences of varying length are a core part of the UI's development process.

discuss

order

pornel|2 years ago

There's never enough time to test everything. Problems like text length are pretty much guaranteed to happen, so you may as well code "defensively" for it from the beginning.

dqft|2 years ago

Defensive as in defensive driving, I assume, which would also be better described as thoughtful, intentional, and correct driving. The metaphor follows for me.