Live data from Hacker News

Ask HN: Is it just me, or is CSS too damn hard?

news.ycombinator.com

211–220 of 358 posts

Re: Ask HN: Is it just me, or is CSS too damn hard?

#211
as someone who is intimately familiar with CSS and doesn't have a problem using it - it's still poorly designed. I think the problem you have with it (and the one I have with it) is that it is in no way systemic. It's like PHP - it's evolved over time not by iterating on the foundations, but by tacking new features on. Flexbox/grid have solved a lot of the layout issues that required messing around with display:inline-block/margin:auto/float/clear for so long (by basically pretending none of it ever existed), but other issues are still around. The fact that box-sizing:border-box is not the default is basically down to netscape winning the browser wars. Shadows overlap even when they logically shouldn't. It's not nightmare-level but it is hard to mentally model at first.

I don't think it helps that most of the CSS I've seen in the wild is vastly over-complicated.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#212
post #208

I work as a frontend architect and UX lead (yes, it's tiring), and you're encountering a common problem. Javascript is logical (sort of...), and a lot like learning math. It's fairly easy to validate your output. It works well with the logical side of your brain. Learning CSS is a lot like learning English. There's the basic grammar, but also tons of edge cases, dialects, and straight up absurd rules (Buffalo buffalo…

> Javascript is logical (sort of...), and a lot like learning math. It's fairly easy to validate your output. It works well with the logical side of your brain. No, it really isn't. Some languages are, JS definitely isn't. It's mostly illogical / broken / mental.

That isn't an argument, you're just expressing your disagreement.

Even if it were an argument I'm not even sure it would be an argument worth having because it's likely entirely orthogonal given the context of the original statement (i.e. contrasting JS with CSS and HTML -- where whatever esoteric programming language you're thinking of is not an option to begin with).

Re: Ask HN: Is it just me, or is CSS too damn hard?

#213
post #189

Earlier quoted context omitted.

Good comment. CSS is actually pretty simple, as long as you start with the smallest elements and work up. It becomes a nightmare if you try and address everything individually. It’s not really a programming language, but a series of guidelines. I’ve seen this simplicity actually throw developers as they’re used to something much more complex and systematic. Preprocessors like SASS are great, but I wonder if they’re d…

Pixel perfect is not possible in HTML/CSS. Stop spreading this. But it is very possible to make websites look very good and inline with what was designed. But good luck making an input, button and select the same height. It's just not going to be pixel perfect. What is pixel perfect in your browser isn't in others. But what designers should now is it doesn't matter as long as it looks good for everyone.

The key part of my point was "as long as the designer is aware of the constraints and opportunities of the medium they’re working in."

Designers coming from print often get caught out when designing for the web as they tend to think of a webpage as a fixed layout, rather than a flexible system of components.

It's also important to understand where the design and development budget should be effectively spent. For example, unless there's a real business or usability reason for doing so, there's little point in trying to custom-style form elements like selects as doing so is difficult and time consuming and system defaults look better and provide a more consistent experience.

We demand pixel-perfect accuracy at work between design and code – but the developers must approve the designs first to confirm that it's achievable.

I guess it comes down to what we define as 'pixel perfect'.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#214

Earlier quoted context omitted.

Oh wow. I'd always just assumed it was a US idiom along the lines of yada yada or something. Buffalo buffalo... doesn't work in British English as it is only a noun. Nearest English silliness I can remember hearing is: police police police police.

Don't tell me you can't verb a noun in English English? "police police police police" - please...

FWIW I'm an ESL speaker from a non-English speaking country and despite having had endless exposure to (mostly American and British) English since a young age, I've never encountered the verb form of "buffalo" outside that one sentence. It's an informal North American idiom and by international standards apparently a fairly obscure one.

Policing OTOH seems to be a fairly widespread verb form with a clearly understood meaning (i.e. what the police conceptually is supposed to be doing). Unless you have close experience with buffalo, you probably can't infer buffaloing means "intimidating".

EDIT: Also as mentioned elsewhere, not everyone outside the US knows there are places actually called Buffalo or makes that leap when hearing the word "buffalo". So "Buffalo buffalo" is more likely to be read as "buffalo(n) buffalo(v)" (which already sounds weird if you don't already know what "to buffalo sb" means) which breaks down as soon as you add more buffalo to the sentence.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#216
post #126

1) CSS is for implementing designs; being able to use it doesn't require design sense for things like colors 2) I'm fascinated by the fact that so many of my fellow programmers - often the smartest ones - have so much trouble with CSS. I'm not sure exactly what the reason for that is, though I did write an article hoping to address it in some capacity: https://css-tricks.com/css-is-awesome/ I think part of the proble…

`I think CSS is beautiful` first thing which comes to my mind.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#217

Earlier quoted context omitted.

Don't tell me you can't verb a noun in English English? "police police police police" - please...

Of course nouns have been made verbs in English. You'll find no British English dictionary listing where buffalo is, unless noting US usage, where it is both. Police police police police is grammatically correct, but of little meaning : (the) police police(v) police (of) police (ie overseers of the police).

I read it as: police police (Internal Affairs) police(v) police.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#218
post #126

1) CSS is for implementing designs; being able to use it doesn't require design sense for things like colors 2) I'm fascinated by the fact that so many of my fellow programmers - often the smartest ones - have so much trouble with CSS. I'm not sure exactly what the reason for that is, though I did write an article hoping to address it in some capacity: https://css-tricks.com/css-is-awesome/ I think part of the proble…

CSS is not a real constraint language. If it really were a constraint language, it would be better. There's no constraint solver. Just a bunch of rules applied sequentially. I'd like to have a real constraint system, like the one in Autodesk Inventor sketch mode. You select two things and apply a constraint - parallel, tangent, horizontal, collinear, etc - and the constraint system enforces those constraints. The lay…

> CSS is not a real constraint language. If it really were a constraint language, it would be better. There's no constraint solver. Just a bunch of rules applied sequentially.

> I'd like to have a real constraint system, like the one in Autodesk Inventor sketch mode

Here you go: https://gss.github.io/

> GSS reimagines CSS layout & replaces the browser’s layout engine with one that harnesses the Cassowary Constraint Solver

Re: Ask HN: Is it just me, or is CSS too damn hard?

#219
post #208

I work as a frontend architect and UX lead (yes, it's tiring), and you're encountering a common problem. Javascript is logical (sort of...), and a lot like learning math. It's fairly easy to validate your output. It works well with the logical side of your brain. Learning CSS is a lot like learning English. There's the basic grammar, but also tons of edge cases, dialects, and straight up absurd rules (Buffalo buffalo…

> Javascript is logical (sort of...), and a lot like learning math. It's fairly easy to validate your output. It works well with the logical side of your brain. No, it really isn't. Some languages are, JS definitely isn't. It's mostly illogical / broken / mental.

if you avoid the absurd parts, JS is perfectly acceptable. The standard ways people write modern ES6+ CSS is fine.

Re: Ask HN: Is it just me, or is CSS too damn hard?

#220
Speaking as someone who has no problem with either CSS, SQL, C++/java/perl/python/assembly or Jan Tschichold, the problem with CSS doesn't seem art-like, but rather SQL-like. People expect CSS/SQL to be like those other languages that also have indentation and (){}[], but they are based on other concepts.

C++ and Python may be different from each other, but they're both imperative block-structured languages with a strong emphasis on time and happens-before.

SQL is set logic expressed as ABNF. If you want to write good SQL you have to let go of assignments that happen-before other assignments. Instead there are sets, unions and other concepts from logic.

Debugging javascript is a little different from debugging C++. Debugging SQL is fundamentally different.

CSS is like that. It's Jan Tschichold's design rules expressed using ABNF and has nothing to do with von Neumann machines. You might achieve Zen by reading one of Tschichold's books, and ignoring all of the syntax and tricks and howtos for a while.

Post reply on HN