There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Omega_Haxors , (edited ) in Functional bros be like

Why even use variables in the first place? Just place the values directly into your code. If you need to change a value, that’s just bad planning. Hell, why even use values either? Just run a loop on the INC instruction until you get the value you need. It’s just efficient programming.

lemmesay , in Functional bros be like
@lemmesay@discuss.tchncs.de avatar

I oscillate between using more functional paradigms and more object-oriented ones. is that normal?
I use a linter BTW(TypeScript) if that is a useful info.

DickFiasco ,

I use a combination of both. Objects are declared const, all members are set in the constructor, all methods are const. It doesn’t really work for some types of programs (e.g. GUIs) but for stuff like number crunching it’s great.

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

I heavily use classes while working on back end, and when I’m making a really self-contained logic, such as a logger or an image manipulation service.
but since most frontend stuff heavily leans on functional side, I go with it

jkrtn ,

I think using both is normal. Closures and objects are duals of each other. Do whatever is understandable and maintainable, neither paradigm is magic.

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

that’s a nice way to look at it. thanks!

kogasa ,
@kogasa@programming.dev avatar

Is the duality statement meant to be true in a technical sense?

jkrtn ,

Yeah! For example, if the language allows closures to capture state, they can act like properties on an instance.

kogasa ,
@kogasa@programming.dev avatar

I don’t see the duality

jendrik ,

A closure is a function with captured state. An object is state with methods.

crispy_kilt ,

Avoid shared mutable state like the plague in any paradigm and you’ll be fine

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

state management crying in the corner

crispy_kilt ,

Functional state management is fine

ZILtoid1991 OP ,

I also do that. Very simple stuff, especially of those that are easy to optimize for the compiler, are often very close to functional programming paradigms.

IWantToFuckSpez , in Every damn time.

Yeah but have you ever coded shaders? That shit’s magic sometimes. Also a pain to debug, you have to look at colors or sometimes millions of numbers trough a frame analyzer to see what you did wrong. Can’t program messages to a log.

CanadaPlus ,

Can’t you run it on an emulator for debugging, Valgrind-style?

Spesknight , in Every damn time.

Computers don’t do what you want, they do what you tell them to do.

Aurenkin ,

Exactly, they’re passive aggressive af

phorq ,

I wouldn’t call them passive, they do too much work. More like aggressively submissive.

GregorGizeh ,

Maliciously compliant perhaps

They do what you tell them, but only exactly what and how you tell them. If you leave any uncertainty chances are it will fuck up the task

Aurenkin , in Every damn time.

Stupid code! Oh, looks like this was my fault again…this time

ObviouslyNotBanana ,
@ObviouslyNotBanana@lemmy.world avatar

Must’ve been chatGPT’s fault

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

My experience is that: If you don’t know exactly what code the AI should output, it’s just stack overflow with extra steps.

Currently I’m using a 7B model, so that could be why?

Ephera , in True Story

Gotta love the

short loop = 0; // loop counter

and then just:

short amt;

What the hell is “amt” supposed to abbreviate?

RecluseRamble ,

“amount” maybe?

Ephera ,

Ew.

I mean, I was gonna respond with that, no matter what it might mean, but that’s such an unnecessary abbreviation.

Lemminary , in W3C pls give us :focus-visible-within

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

Strawberry OP ,

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

Lemminary ,

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

Skullgrid , in W3C pls give us :focus-visible-within
@Skullgrid@lemmy.world avatar

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

aeharding ,
@aeharding@lemmy.world avatar

That’s wizards chess

F04118F ,

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

joshcollinsworth.com/blog/devaluing-frontend

firelizzard ,
@firelizzard@programming.dev avatar

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.

F04118F ,

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.

firelizzard ,
@firelizzard@programming.dev avatar

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.

Skullgrid ,
@Skullgrid@lemmy.world avatar

I see you are a thin skinned idiot that can’t understand your own fucking link

I find what most of those people actually mean is: HTML and CSS aren’t scripting languages. Which: a) of course they aren’t; and b) is not really the point at all.

F04118F ,

Well, ehm… Thank you for the feedback I guess?

I appreciate your clarification: you mean that the logic part of conditional appearance should be handled by, for example, changing a property on an HTML node, and styling that property in CSS, did I get that right?

If I may offer some feedback in return, I would recommend you work on your phrasing. Insulting people can easily lead to being ignored or having low-value interactions. Asshole. 😉

Strawberry OP ,

CSS has always combined the styling and the logic for the styling. CSS selectors implement logic to determine where to apply styles

Witchfire , (edited )
@Witchfire@lemmy.world avatar

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

idefix ,

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.

F04118F ,

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 ,

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.

sacbuntchris ,

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.

Skullgrid ,
@Skullgrid@lemmy.world avatar

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?

Strawberry OP ,

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: larsmagnus.co/…/focus-visible-within-the-missing-…

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

Skullgrid ,
@Skullgrid@lemmy.world avatar

thanks for the explaination!

Strawberry OP , (edited )

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

wise_pancake , in W3C pls give us :focus-visible-within

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

Strawberry OP ,

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

wise_pancake ,

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

ornery_chemist , in Functional bros be like

you mean let.

and then letting Hindley-Milner do the rest

Magnetar ,

let there = “light”

BaardFigur , in Well....well...well...

deleted_by_author

  • Loading...
  • Ziglin ,

    GCC uses both C and C++ so maybe you’re partially correct. Which others?

    Hammerheart , in CSS

    I am struggling with using flex for the first time and holy cow do i feel this

    LinearArray , in Functional bros be like
    @LinearArray@programming.dev avatar

    Me irl

    klisurovi4 , in As someone not in tech, I have no idea how to refer to my tech friends' jobs

    I am partial to “code monkey”

    On a serious note, I usually refer to myself as a developer or a software engineer when I wanna sound a bit more important.

    SaltyIceteaMaker , in True Story
    @SaltyIceteaMaker@iusearchlinux.fyi avatar

    I decide to learn C++ and suddenly everything and everyone mentions C++… Is that a sign?

    Scoopta ,
    @Scoopta@programming.dev avatar

    That you should turn and run like hell? Probably lol…

    SaltyIceteaMaker ,
    @SaltyIceteaMaker@iusearchlinux.fyi avatar

    Well i don’t really have a choice as i want to code some stuff for my smartwatch (pine time) and also wanted to take a look at the code of the hyprland window manager (wich is written in C++ afaik)

    Scoopta ,
    @Scoopta@programming.dev avatar

    Ah…well fair enough. I personally prefer plain C but I know nothing about the pine time or what languages are available and even then Hypr and Hyprland are C++ so you are trapped there…sway ftw lol. Also my pedantic side dictates I must say this even though it’s irrelevant…but technically Hyprland is a Wayland compositor and while they do manage windows a window manager is an X term…

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines