this post was submitted on 25 Sep 2023
328 points (94.1% liked)

Programmer Humor

31995 readers
301 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 39 points 11 months ago (1 children)

Listen. I just don't like that they replaced glass with TV screens that show what's behind

[–] [email protected] 20 points 11 months ago (1 children)
[–] [email protected] 24 points 11 months ago (1 children)

They replaced glass with screens that show what they think the product is.

In stores run by the particularly stupid.

[–] [email protected] 29 points 11 months ago* (last edited 11 months ago)

The screens are there to play ads sometimes, and if you get there while an ad is playing, you either have to know the store and remember which screen the thing you want is behind, or you have to wait until the ad is over. Or you can go open every door until you find what you want. I prefer the latter because it makes the company have to pay more to cool their drinks.

If enough people do it enough, maybe it'll negate the advertising profits.

[–] [email protected] 37 points 11 months ago (3 children)

Svelte my man, I barely have to read the docs, just guess how things should be done because that's how it would work in vanilla JS, and most often it just works.

[–] [email protected] 14 points 11 months ago (1 children)

Svelte is very good. If I had to use a frontend framework I would either pick svelte or soldijs both are great.

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

svelte or soldijs both are great

What would you say is the most important difference between the two? I feel like I should dip my toes into Svelte, but I haven't had a reason yet

[–] [email protected] 7 points 11 months ago (2 children)

Svelte is for if you hate React and like vanilla JavaScript. Solid or Next is if you like React.

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

HTMX I guess, lol

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

Never used React, I went straight to Solid, but I quite like vanilla, I mean, you'll always be using "vanilla" in some form or another

[–] [email protected] 6 points 11 months ago (3 children)

Been a react dev for about 4 years now, I’ve heard good things about Svelte. But like from a career perspective would it be worth the switch now?

[–] [email protected] 16 points 11 months ago

It's good to play around with different frameworks from time to time, even if it's just to form an initial opinion on. I've been programming for 15+ years and the only constant is learning new things.

[–] [email protected] 3 points 11 months ago

From a career perspective using it enough to know whether you'd like to or be willing to work with it in the future is probably enough. Then when you're looking you know whether you want to apply for jobs focused on it.

On that topic I've been on the market and haven't seen Svelte mentioned a single time when searching, granted I've probably only looked at a couple hundred listings (most being WFH).

[–] [email protected] 1 points 11 months ago

From a career perspective, think of languages and frameworks as tools. Knowing how to work with more tools broadens your horizon about what you can achieve and how efficiently. Sure, you can specialize on certain tools, but these come and go.

[–] [email protected] 1 points 11 months ago

Svelte is the way to go

[–] [email protected] 34 points 11 months ago (2 children)

I thought HTMX was a joke, but they're serious.

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

and don't call me Shirley.

[–] [email protected] 5 points 11 months ago* (last edited 11 months ago) (1 children)

C'mon, what's not to like about bonding every UI action against a remote server? What's a few milliseconds anyway? I'm sure it works fine over cellular networks. I mean, it works great on my dev machine! /s

[–] [email protected] 3 points 11 months ago (1 children)

What kind of you UI action are you talking about? Most of the time you need data from the server and if you want have some animations with css it will be client side anyway also it's not like you cannot write JS. I mean downloading thousands of lines of js for some web framework over cellular does not sound better tbh.

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

That's a strawman. I don't need 1000s of lines of JS to swap a UI. I can do it in 1 line with Web Components: oldElement.replaceWith(newElement). And those modules can be lazy loaded like anything else.

This is just DX in name of UX, which is almost never a good idea.

And maybe you're fine with throwing a server computation for every single UI change, but I'm not made of money and I much rather have stuff on a CDN.

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

I think i missunderstood you I thought you were arguing for modern web frameworks. Nothing wrong with replacing elments with js and not sending it as a request to a server I would do the same for stuff that doesn't need data from the server. If you are really worried about latency you could throw your code in a cloudflare worker but I don't think it matters that much average loading time of websites on desktop is 2.5 seconds . So it doesn't really matter if the server is on the other site of the world latency will not be the biggest factor.

[–] [email protected] 25 points 11 months ago (2 children)

I personally don't like the htmx style of coding. It often feels like having to explain what I want to do to someone else using only a limited set of custom words, instead of just doing it myself.

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

I understand you but for me it's the opposite I am not bound to using js for everything and can just return html from the server like I want. Also everything else still works I can write js if I want to. Htmx gives me more words I can use in html not less. Also I can manage the state via the url and the server. In other frameworks I often had the problem that I was writing the same logic twice in backend and frontend.

[–] [email protected] 7 points 11 months ago

Exactly. Not everything needs to be a goddamn SPA!

[–] [email protected] 4 points 11 months ago

I just peeked at the docs and right off the bat I don't like how they have conflicting attributes like hx-get and hx-post. What happens if both are set at the same time? Why not just have hx-method?

[–] [email protected] 12 points 11 months ago (4 children)

Reject Web technologies - embrace native mobile app development

Compose feels like React but without the bad JavaScript parts, really pleasant experience!

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

Ah, yes, let's have thousands of specialized apps, each with uniquely expiring dependencies and vulnerabilities, instead of one browser that can work with apps that are standardized for OSS, UI, accessibility, performance, inspection by humans and machines, and security.

[–] [email protected] 6 points 11 months ago

Funnily enough, I've found JavaScript to be by far the worst offender for expiring dependencies and vulnerabilities.

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

I love Compose, creating UI is actually fun. The whole ViewModel thing though I don't love

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

I love Compose, creating UI is actually fun.

It's a good time, for sure. That being said, I've stopped working with UI, and I don't really miss it. I still do some side projects in Compose though, and it's always way better than XML.

The whole ViewModel thing though I don't love

When it clicks, it's actually not that bad imo. I think the main problem is that Google aren't really explicit enough about how to leverage them effectively, and as such they can be pretty hard to get right.

load more comments (2 replies)
[–] [email protected] 12 points 11 months ago (2 children)

I'm good with my Vue, thanks. I hate React though. I can see htmx simplifying some things and being adopted by front-end frameworks. The same way improvements in HTML and CSS have been adopted.

[–] karmiclychee 4 points 11 months ago (1 children)

Fellow Vue enjoyer! I love Vue, it's so friendly. Maintaining a complex React app feels like getting dragged behind a truck down a one way road.

(Did you like my two way data binding joke there?)

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

Hello sane friend! You used your joke to great effect!

Did you like my useEffect joke haha

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

When you say "and", do you mean together?

I love Vue, first time I've heard of AlpineJS. From my quick searching, they seem pretty similar. What advantages does one have over the other? Thanks :)

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago)

Ah, sorry, that was a bit confusing on my part. I use them entirely separate. Here are some real world examples:

Vue: new projects that will require multiple components, state management, etc.

AlpineJS: when I have a tiny project/demo that needs reactivity, or if I have an existing HTML setup that needs state management and reactivity bolted on after the fact (like an old site or something like that).

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

sveltekit: this is the way

[–] [email protected] 3 points 11 months ago

[email protected]

There’s quite a few of us :) Looking forward to Svelte 5.

load more comments (1 replies)
[–] [email protected] 4 points 11 months ago

I love HTMX ❤️

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

I don't really get what htmx is... does it make things like modals easier? Is it a full framework, or does it just add extra features to html?

load more comments
view more: next ›