Live data from Hacker News

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

news.ycombinator.com

161–170 of 358 posts

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

#161
CSS is the worst.

Git and CSS are the two hardest things anyone will ever try to learn in computers.

To the extent I've had some success with CSS, I've used bootstrap, and went back and did some CSS 101 stuff because none of it is intuitive -- actually learning how they did CSS helps a lot b/c trying to figure it out will never work -- it's all back-asswards at best.

and that's before you get to browser differences.

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

#162
My feeling about CSS is similar to asm/Assembler. It gives you ultimate handles, but it's very much low-level down to pixels. Same about peculiarities of the underlying platforms and browsers.

While I see great uses for asm directly within parts of an application constructed with higher-level languages, yet building a whole system using asm is unnecessary. Compiler does this job.

With CSS from scratch or not, you need to move, store, add, clear, and jump on your own. And let's not think of how many losely coupled variables a real-life web-design presents to deal with. There's no compiler for this, only a debugger (Firebug, etc.) CSS frameworks simplify some aspects of this, but fundamentally it's still low-level.

That's what makes this CSS chase a somewhat futile exercise in a long run. Assembler is at least is more concise to memorize.

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

#164

Earlier quoted context omitted.

> hey, just center this thing Step 1: On your container div... display:flex; justify-content:center; align-items:center; Step 2: There is no step 2.

this won't work on bootstrap elements

Are you using the bootstrap’s utility classes?

.d-flex.align-items-center etc

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

#165

Yes, it is horrible. It's got a little bit better (think flexbox and CSS grid) but it still feels clumsy, unintuitive, unpredictable, inelegant, frustrating. You learn to live with all it's painful shortcomings, but you'll never learn to like or love it. Interesting aside: what would the creators of CSS do differently today? Bert Bos: - Feels there was too little detail in the first CSS spec (but Håkon Wium Lie think…

Interesting comments from those guys.

I taught myself CSS by reading the CSS 1 spec back in the late 90s (mainly aimed at IE 4 - Netscape 4.6 sucked bad) before there were any books on it. I think the CSS 2 spec was also out by then too, but the browsers didn't support it yet (that took a surprising long time).

I found learning CSS 1 from the spec pretty easy as it wasn't a large spec and was fairly easy to read. The CSS 2 spec was a lot larger (5-10 times?), and a lot more complex with all the new stuff. Learning that took some help from the old Eric Meyer book from O'Reilly with the pair of trout (?) on the front.

The Eric Meyer book helped a lot with understanding fundamentals like how flow worked etc and properly grokking inline vs block etc. There wasn't really any of the tooling (eg Firebug and successors) to help back then.

Of course, I wasn't reading the specs to implement a rendering engine - just to use it.

I stopped doing any CSS about 8 yrs ago just as CSS 3 was starting to happen and never really learnt that. It seems way more powerful/complex/useful these days.

One tip that really helped back then was to try and do what you wanted with the very minimum of selectors/declarations to avoid conflicts, ambiguities and debugging difficulty. So creating lots of scratch empty test pages to explore one specific technique before including it with all your other CSS/HTML.

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

#166

My feeling about CSS is similar to asm/Assembler. It gives you ultimate handles, but it's very much low-level down to pixels. Same about peculiarities of the underlying platforms and browsers. While I see great uses for asm directly within parts of an application constructed with higher-level languages, yet building a whole system using asm is unnecessary. Compiler does this job. With CSS from scratch or not, you nee…

This is a great way of putting it.

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

#167

Earlier quoted context omitted.

> Some (unlucky) programmers entire job was turning PSDs into HTML and CSS. That was my entry into programming many years ago. But I wouldn't call it unlucky - early web devs like me (we didn't really call ourselves programmers back then) had front-row seats at the beginning of a revolution, and it certainly was entertaining to watch and be part of. > CSS has nothing to do with design CSS works the way it does becaus…

> CSS works the way it does because it was created to make the kind of designs that designers wanted possible Well, not originally. Later that became a thing, yes - but all the design that was already there at that point (circa CSS 2) remained, as did the overall approach with cascading styles. A styling language designed for HTML5 today from scratch, accommodating modern use cases, would likely look a lot different.

It would probably be written in JS, maybe something like JSSS [1]. I remember playing with it when it came out and thinking it was very cool. Pity it never went anywhere.

If we were going to start from scratch though, we wouldn't do HTML5, we'd use some other format. JSON maybe?

1. https://en.wikipedia.org/wiki/JavaScript_Style_Sheets

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

#170

I was like this 5 years ago. It's trite and no one wants to hear it, but the basics go a long, long way. All of that stuff you hear about in front-end interviews ( like the box-model and relative vs absolute positioning ) comes in handy. I do admit that pre-flexbox CSS did require some wizardry and hacks here and there. I think "modern CSS" is quite enjoyable and we're able to enjoy a time where we no longer need CSS…

I remember times of supporting x-platform css for IE5/5.5/6 and FF1. IMO everything that people complaining right now is nothing with the Wild West that was back then.

Indeed, I think times and CSS has gotten much better. MDN's documentation is great, and browsers are finally starting to standardize.
Post reply on HN