Live data from Hacker News

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

feeds.resonaterecordings.com

41–50 of 109 posts

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

#41

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.

I mean.. technically it's still a simple, easy to learn language,... but doing stuff with it, requires a lot of knowledge about 'stuff' (mostly math in your case).

To steal from some other comments here... a (wood) chisel is an easy tool to learn and use.. a lot easier than a CNC machine... but building a wooden boat with a chisel is still hard.

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

#42
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 copy a design? Can I jump into an existing page and tweak it?

Not trolling. It’s the kind of stuff that stumps me. Or am I just making excuses to myself why I can’t figure CSS out? (beyond tweaking margins, padding and maybe background-color and the real basics)

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

#43

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,…

For sure, the stuff 10+ years ago was pretty goofy and the amount of hacks required even further back to make it work across 4+ different browsers was super annoying. I guess I'm not thinking about all those growing pains today.

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

#44

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.

[deleted]

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

#45
To join the chorus: I have learned assembly on the Z80 still behind the Iron Curtain. It was long ago. It's logical and as such it's real easy. Sure, it's a bit more tedious than higher level programming languages but oh well. Now, what little I know of CSS made me very firmly refuse to work with it. I do backend work, I let the frontend people make their magic.

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

#46

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…

That's not at all true - it took ages before CSS added multi-column layout.

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

#47

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.

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 systems). So this means that there’s a left and a right edge, which means that centring something horizontally makes sense – the mid-point between those edges is the centre. But it also means that there’s no real bottom imposed upon the text – the text starts at the top and just keeps flowing downward until it runs out. So centring something vertically isn’t the same sort of thing as centring something horizontally.

Or to put it another way, the horizontal edges are imposed by something external to the content (often the viewport), and the bottom vertical edge is defined by the length of the content. The two axes are treated differently by CSS because they are fundamentally different.

If our writing system were turned 90° on its side and we wrote downward until we reached the bottom of the page then moved back to the top and right one line, like some traditional Asian writing systems, our browsers would scroll left and right by default and you would be complaining that `margin auto` expands top/bottom margins but not left/right margins. It’s the writing system that works this way, CSS just does what is sensible for that writing system.

Later on, more layout systems like grid were introduced by CSS that weren’t based upon the flow of text, but things made logical sense before then as well.

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

#48

I think the fundamental lesson for me was to utilize the cascading nature in small, very clear logical units of tags. And don’t try to implement a grand unified theory of style for your website where everything is based on a brittle chains of selectors. It’s okay to give tags ids and select by the id instead.

CSS definitely gives you plenty of rope to hang yourself with if you aren't careful about how you choose to apply it! I've been in a few codebases with lots of !important overrides and deeply nested selectors which quickly becomes unmanageable.

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

#49

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 but it's extremely intuitive to me

I mean... yeah?

That's the benefit of doing something for 15 years, it's intuitive and no longer confusing.

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

#50
post #27

Earlier quoted context omitted.

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.

I'm not sure about that, flexbox has a major and minor axis, which you can define with flex-direction.
Post reply on HN