Live data from Hacker News

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

feeds.resonaterecordings.com

51–60 of 109 posts

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

#51
post #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 Rea…

> I ended up just playing around with putting attributes on various components until I found what worked.

It's sometimes hard for me to wrap my head around flexbox as well. If you haven't already seen it, this page [0] is imo the flexbox bible. There's one for grid [1] too.

[0] https://css-tricks.com/snippets/css/a-guide-to-flexbox/

[1] https://css-tricks.com/snippets/css/complete-guide-grid/

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

#52

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.

That’s not inconsistent, that’s just reflecting how our writing system works. CSS was designed around the idea that there is a document consisting of text, which implies the X and Y axes work differently – because they work differently for our writing system. Text goes from left to right, then wraps back around to the left moving vertically down (obviously this is for RTL languages; adjust for different writing syste…

This doubles as a perfection explanation of why the web is such a terrible technical platform for rich client applications. All of the assumptions baked into the foundational design of HTML & CSS were based around the idea these would be used for creating lightly styled documents.

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

#53
post #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 Rea…

Box model + flex box + the display modes + "positioning" (stacking contexts) are typically the most confusing parts of CSS, I feel.

Add maybe margin and padding, and how they interact (margin collapse, no margin collapse in flex or grid context, box model again, auto values).

But then, that's basically all the hard conceptual parts. But they are mostly intuitive and well-designed! I know I'm alone with this opinion.

Naming + global scope is the rest of the problem, but even without this, here is where the problem of creating design system shows up, too. Harder than CSS probably :)

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

#54

slightly OT but can someone recommend how to learn CSS in 2023 for a backend web developer, who 30ish years ago grokked mainframe Assembly reasonably well (and since then developed in c, php, python, ruby, bash, etc etc)? Can/do I start with tailwind? Do I start with old-school CSS or jump straight into flexbox? Do I need to care and learn about BEM, Sass, etc? Do I start with an empty page and build it? Do I need to…

I would probably start by opening the browser dev tools on web pages and use inspect element to see how an element in the page has been made to look the way it is. You can edit properties to see what effect they have when changed.

The domain of styling html is so large that there's no chance of learning everything in theory then applying it, I think it's best to learn by doing.

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

#55

Assembly is not trivial lol. The instruction set is easy to learn yes, but the kind of bit manipulations that occur at ASM are not easy or simple. Look at optimized division sometime. Try reverse engineering, it's an art that takes decades to learn. I do agree with "Anyone who can learn CSS can learn assembly" though, anyone can learn pretty much anything with enough time and effort.

sensationalist title, ASM is much more complicated than CSS

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

#56

Earlier quoted context omitted.

That’s not inconsistent, that’s just reflecting how our writing system works. CSS was designed around the idea that there is a document consisting of text, which implies the X and Y axes work differently – because they work differently for our writing system. Text goes from left to right, then wraps back around to the left moving vertically down (obviously this is for RTL languages; adjust for different writing syste…

This doubles as a perfection explanation of why the web is such a terrible technical platform for rich client applications. All of the assumptions baked into the foundational design of HTML & CSS were based around the idea these would be used for creating lightly styled documents.

No, because like I said, CSS later introduced other layout systems that weren’t based upon this.

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

#57

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.

Ok here’s one. If you have two inline-block divs with no border or margin and you give them both 50% width, they should evenly split their parent div, right? Wrong! You need to set the font size to zero on the parent otherwise the html formatting adds extra space after the first div.

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

#58

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.

> maybe because I've been doing it for 15+ years yea, that's about right, except the maybe part

Anything anyone's been doing for 15+ years starts to feel easy, because any component that takes a year to learn how to do (which is, by any measure, something quite difficult to learn) you've known for 14 years.

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

#59
post #54

slightly OT but can someone recommend how to learn CSS in 2023 for a backend web developer, who 30ish years ago grokked mainframe Assembly reasonably well (and since then developed in c, php, python, ruby, bash, etc etc)? Can/do I start with tailwind? Do I start with old-school CSS or jump straight into flexbox? Do I need to care and learn about BEM, Sass, etc? Do I start with an empty page and build it? Do I need to…

I would probably start by opening the browser dev tools on web pages and use inspect element to see how an element in the page has been made to look the way it is. You can edit properties to see what effect they have when changed. The domain of styling html is so large that there's no chance of learning everything in theory then applying it, I think it's best to learn by doing.

I’ve been doing that for over a decade, without making tangible progress.

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

#60
post #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 Rea…

Box model + flex box + the display modes + "positioning" (stacking contexts) are typically the most confusing parts of CSS, I feel. Add maybe margin and padding, and how they interact (margin collapse, no margin collapse in flex or grid context, box model again, auto values). But then, that's basically all the hard conceptual parts. But they are mostly intuitive and well-designed! I know I'm alone with this opinion.…

Something I don’t like about the way grid and flex has been implemented is the seemingly random application of naming conventions. Memorising the differences between justify items and align items, the argument order for repeat including min and max content variables. The odd naming convention for grid area.. There’s a lot going on.

Oh yeah and debugging a broken sticky because some parent has stacking context stuff going on, also fun.

Post reply on HN