this post was submitted on 23 Mar 2024
111 points (94.4% liked)

Programmer Humor

19804 readers
320 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 24 comments
sorted by: hot top controversial new old
[–] [email protected] 54 points 9 months ago (3 children)

what the fuck am I even looking at? Css is to make styles not cure cancer

[–] [email protected] 24 points 9 months ago (2 children)

Interestingly, focus states are used in accessibility. So while this code isn't to cure cancer, it likely does improve the lives of those with different needs.

[–] [email protected] 10 points 8 months ago* (last edited 8 months ago)

bingo, i made this meme while doing accessibility improvements at work

[–] [email protected] 5 points 8 months ago (1 children)

it's starting to make sense, what exactly does the meme want me to do about focus states so it can be read properly by screen reader software/used by keyboard navigation?

[–] [email protected] 17 points 8 months ago* (last edited 8 months ago) (1 children)

CSS has a pseudo-class, :focus-visible, that matches when an element is focused using keyboard navigation. It also has :focus-within, which matches when the current focused element is the selected element or one of its descendents. However, this applies not only for keyboard navigation but also mouse and tap focus. A pseudo-class that combines the two, :focus-visible-within, would be useful, but does not currently exist. Here's an article about it: https://larsmagnus.co/blog/focus-visible-within-the-missing-pseudo-class

The code in the meme implements the logic of :focus-visible-within using the new :has() functional pseudo-class, and has a snippet of fallback behavior for slightly older browsers

[–] [email protected] 2 points 8 months ago

thanks for the explaination!

[–] [email protected] 16 points 9 months ago (4 children)

I see you too are a backend enjoyer who is tired of modern frontend development. I highly recommend reading this:

https://joshcollinsworth.com/blog/devaluing-frontend

[–] [email protected] 6 points 8 months ago* (last edited 8 months ago)

Thanks for posting this.

Good frontend work is HARD. It requires both design and engineering knowledge, and it's very easy to write unmaintainable or inaccessible code. It also requires a high amount of backend work via BFFs, load balancing, hosting and serving, credential management, and more. The cherry on top is that it's basically all async code.

To be clear, I'm talking about the types of FEs used by thousands internationally, fully adherent to WCAG 2.2 (and above), and with rich interactivity. I'm not talking about someone's hobby project with a couple dozen users at best.

Seeing backend elitists diminish its worth is tiring as all hell. To me, it indicates that the person is either new to the industry or looking for a sense of superiority because they don't understand FE work. It's meaningless and exhausting to read.

Tldr: I agree

[–] [email protected] 5 points 8 months ago (1 children)

The first part of this article is taking about naming, and then heavily implies “CSS/HTML is not a programming language” is equivalent to devaluing front end developers. But that’s not the case, at least not for me.

Front end is hard. It is obnoxiously hard and requires both artistry and technical skill. And it’s critical to the success of anything that has a front end.

But I still say, “CSS/HTML is not a programming language”, because they’re not Turing complete. A programming language is something you can write a program in, without any other languages. It’s a matter of definition, not a matter of valuation. CSS and HTML are difficult and critical to get right but they’re a different kind of thing from programming languages.

[–] [email protected] 7 points 8 months ago (1 children)

And semantically, logically, you are 100% correct. But there are other, subjective, emotional, layers to language. Billionaire, business magnate, and oligarch can mean the exact same thing, but they have very different emotional meanings and associated contexts.

I think the author may have a point that by spreading the "HTML is not a programming language" meme, we may be contributing to its lower subjective status.

But this thesis is, by its very nature, subjective, of course.

[–] [email protected] 2 points 8 months ago

To me that ‘meme’ is like someone making an “Eggs aren’t meat” meme. Technically correct, I agree with the factual part of the statement, but the meme is dumb and pointless, like a bad joke. Unless the point is to belittle, in which case the poster deserves to be forced to do front end dev and deal with irrational user complaints until they repent or end up huddled in a corner mumbling incoherently, either or.

It’s like sexism. I don’t have time for that shit. If people were being sexist, bigoted, or belittling frontend devs at my job I’d tell them to get their heads out of their asses, or find a new job and then tell them. Fortunately I currently work with people who don’t suck.

[–] idefix 2 points 8 months ago (1 children)

I feel like this article is completely missing my point. I've done my share of programming websites but not for the past 2 decades. And now I'm completely lost at reading CSS. I can't make sense of the code shown in the picture. And that's always been my trouble with CSS: the tendency to unnecessarily over-complicate things while reinventing the wheel. They have created a huge barrier for entry to the world of website programming and I think it's a shame.

[–] [email protected] 3 points 8 months ago* (last edited 8 months ago) (1 children)

That's an honest criticism that does not intend to devalue frontend. But there's an overlap where "over-complicate" may imply that frontend (tools) should be uncomplicated.

Having only done a few frontend projects in recent years, I see obvious value to new, more powerful CSS selectors and even things like Tailwind. I can't read Tailwind yet, but making intuitive user interfaces that work well on all kinds of devices for all kinds of people (screen readers?) is difficult and should not be expected to be simple, IMO. But this is a matter of opinion.

The ones most qualified to deal with that issue are, obviously, experienced frontend devs and they build these things.

[–] idefix 2 points 8 months ago

I agree with everything you said, that's fair. But I do not remember having to much difficulties coding UI interfaces in Qt while supporting numerous end-user configurations.

[–] [email protected] 10 points 9 months ago

That’s wizards c~~he~~ss

[–] [email protected] 17 points 9 months ago (1 children)

I miss when CSS was tables. Now I don’t even recognize it with variables and compilers.

[–] [email protected] 4 points 8 months ago (1 children)

It's so much more fun now though! Things like grid layout and flex box have really changed the game. Also idk if you were saying otherwise but this has no variables and is vanilla CSS

[–] [email protected] 2 points 8 months ago

I do like flex layout, it’s very cool!

I’ve been out of the css game for a while though, so now I’m totally lost

[–] [email protected] 6 points 9 months ago (1 children)

Now try that but inline! Tailwind gang, where you at

[–] [email protected] 2 points 8 months ago (1 children)

I have not used tailwind personally and I'm a fan of keeping the markup simple but to each their own

[–] [email protected] 2 points 8 months ago

I suggest trying it out in a project first to get a good idea of why it's so popular