Live data from Hacker News

"CSS is dramatically more difficult than learning assembly language" [audio]

feeds.resonaterecordings.com

31–40 of 109 posts

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#31

I don't understand the CSS confusion. Maybe because I've been doing it for 15+ years but it's extremely intuitive to me and I love working with it. Tailwind annoys me because it removes some of that flexibility / freedom for me to just solve a problem immediately with a new class or something.

It's because of the inconsistency. For example, `margin: auto` expands left/right margins but not top/bottom margins. ....and 50 other such cases.

I never thought of that as an inconsistency, but rather of a feature. My thought is: Layout is left-to-right so why should something work top-to-bottom? Same as text-align: center will center horizontally, and (/s) vertically centering something is impossible.

But I agree with the basic sentiment. The small irregular things [1] make it really weird to get, but once you'll get it, it's crazy cool. However, that does not make a language great.

[1] https://stackoverflow.com/a/17468803

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#32
I cannot look at a UI design and intuitively know what CSS attributes would generate that exact output.

I think part of it for me is that I do not have an intuitive understanding of the box model and how layouts are calculated. On top of that, since CSS cascades, you have to be able to mentally keep track of all the parent attributes to understand how they affect a specific element on the page.

I was working on a React Native project the other day and I could just not get flexbox layout to do what I wanted. I ended up just playing around with putting attributes on various components until I found what worked.

I have an ADHD brain that quickly discards information I don't use frequently, so since I don't use CSS often, I never remember it well enough to be good at it.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#33

I don't understand the CSS confusion. Maybe because I've been doing it for 15+ years but it's extremely intuitive to me and I love working with it. Tailwind annoys me because it removes some of that flexibility / freedom for me to just solve a problem immediately with a new class or something.

For a long time, simple things like vertically centering dynamic text were impossible to do except with JavaScript or weird hacks. Or how do you push a page footer to the bottom of the viewport on pages where the content is only a few lines? Or create a two-column layout where the left column has a different background color that always stretches to the bottom of the viewport?

There have always been a ton of common, simple things that CSS just didn't support, or required bizarre hacks for -- like reusing "floats" intended for inset images as the basis for layout. Over the years it's gotten better, but if you've been doing this for 15+ years, surely you remember the old horrors. I don't want to have to insert "clear: both;" at the start of every new section ever again...

Not to mention that back in the day, browsers weren't nearly as standards-compliant, so your designs would just show up wrong in some browsers, and you'd rip your hair out trying to write CSS that would work in all of them.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#34

Ok I dont have time to listen to the podcast, and could not figure out which one it refers to. But I'll bite on the headline. CSS is difficult because it was not designed with logic as input as a programming language. It was designed from expected print output. "I want to do this thing that is popular in New York Times magazine". Floats, run-in, first line, multi column. Static papers that were never meant to move ar…

This is a really interesting perspective. It does seem like CSS is "reverse engineered" from expected output rather than the other way around.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#36
post #27

Earlier quoted context omitted.

It's because of the inconsistency. For example, `margin: auto` expands left/right margins but not top/bottom margins. ....and 50 other such cases.

Not a CSS guru but I'm pretty sure that's because display: block (the original document layout strategy?) grows vertically, so it doesn't really make sense to have an auto value for top/bottom. And I believe margin:auto only applies when there is a width constraint in the element.

There are Reasons(TM) for it.

And yet when flexbox was created, there was no horizonal/vertical difference.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#37

Earlier quoted context omitted.

It's because of the inconsistency. For example, `margin: auto` expands left/right margins but not top/bottom margins. ....and 50 other such cases.

I never thought of that as an inconsistency, but rather of a feature. My thought is: Layout is left-to-right so why should something work top-to-bottom? Same as text-align: center will center horizontally, and (/s) vertically centering something is impossible. But I agree with the basic sentiment. The small irregular things [1] make it really weird to get, but once you'll get it, it's crazy cool. However, that does n…

Same sentiment here. The way margin works makes sense to my brain that lives in an HTML/CSS world.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#38
All of CSS may or may not be more complex overall than x86 assembly, but learning CSS is waaaayyy more immediately accessible and simpler. Write a bit of code, immediately see results in your browser and play around/iterate.

To be an effective assembly programmer you need to understand computer architecture to a decent extent, be familiar with assemblers and related toolchains, be able to debug and reason about code execution, etc.

Re: "CSS is dramatically more difficult than learning assembly language" [audio]

#39
post #6

What does learning assembly language mean? So right now, learning CSS is pretty difficult. But luckily CSS specs have gotten pretty similar over different browsers, so its not terribly difficult even though some things are not exactly perfect. But Assembly Language is rather straight forward, but the difficulty is that "assembly" is really a hundred different languages that depend on the specific processor architectu…

Pedantic nit: CSS specs are consistent across everything, because there's only one spec. (ignoring previous versions) Specs generally aren't the problem. It's implementations. But those are mostly pretty good now too.

When I started in webdev around a decade ago I remember having to work around all sorts of annoying cross-browser inconsistencies (floats, margins, box-sizing, etc). I haven't kept up with all the latest updates (need to brush up on grid layout) but I feel like I rarely if ever find myself in those situations anymore.
Post reply on HN