this post was submitted on 25 Jan 2025
1480 points (99.1% liked)

Programmer Humor

20251 readers
1598 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
 
(page 2) 35 comments
sorted by: hot top controversial new old
[–] MITM0@lemmy.world 21 points 1 week ago (1 children)

I wish I could like this thrice

load more comments (1 replies)
[–] NekoKamiGuru@ttrpg.network 19 points 1 week ago (1 children)

This has been a problem for a very very long time

[–] luciole@beehaw.org 12 points 1 week ago (1 children)

I agree with you that failing to support multiple browsers is an old problem, but I think the cause has shifted.

Back in the last century, supporting both browsers amounted to sniffing the browser and implementing the same feature twice. document.layers vs document.all for example.

Nowadays I think the problem is different: we just don't know what's going on. The site is transpiled from TypeScript, written on top of React or Vue which drastically switches paradigm (bonus for Tailwind), packed with building tools, and the average dev has little understanding of what actually comes out. It's a tall stack of leaky abstractions on top of the already tall one of the web. The dev is pretty sure it works on Chrome so they say it does work there, but it was not even a deliberate choice.

[–] sunbeam60@lemmy.one 5 points 1 week ago

For most sites it’s a testing matrix issue. Most testing teams look at browser stats and choose how to apply their limited resources based on that. So the dev probably doesn’t even see the bug that exists for an old Firefox version as there’s no testing done on it.

[–] BroBot9000@lemmy.world 16 points 1 week ago (3 children)

I’m going to have to go down the rabbit hole of making my own website soon. Just curious but would there be an easy way to show a pop up just to people using chrome?

No reason in particular… 😏

[–] RedStrider@lemmy.world 18 points 1 week ago (1 children)

lol i did something like what i assume your goal is on my neocities when i detect !!window.chrome === true

[–] Faresh@lemmy.ml 7 points 1 week ago (2 children)
[–] rektdeckard@lemmy.world 12 points 1 week ago (1 children)

It's a handy way to convert any value to a Boolean. If window.chrome is defined and done non-empty value, double negation turns it into just true.

[–] Faresh@lemmy.ml 6 points 1 week ago (3 children)

I've been wondering why not window.chrome == true or Boolean(window.chrome), but it turns out that the former doesn't work and that == has essentially no use unless you remember some completely arbitrary rules, and that JS developers would complain that the latter is too long given the fact that I've seen javascript code using !0 for true and !1 for false, instead of just true and false because they can save 2 to 3 characters that way.

[–] marcos@lemmy.world 6 points 1 week ago

== has essentially no use unless you remember some completely arbitrary rules

If you make sure the types match, like by explicitly converting things on the same line on that example, then you can use it just like if it was ===.

In fact, there are people that defend that if your code behaves differently when you switch those two operators, your code is wrong. (Personally, I defend that JS it a pile of dogshit, and you should avoid going to dig there.)

load more comments (2 replies)
[–] CorvidCawder@sh.itjust.works 5 points 1 week ago

JS "idiomatic" way to cast to boolean. But could just be written as !window.chrome instead.

[–] Supervisor194@lemmy.world 15 points 1 week ago

Not sure if serious, but there's a million ways to do this, some that require importing thousands of lines of code and none of which are guaranteed to work in all possible circumstances. But here's a simple one.

[–] gamermanh@lemmy.dbzer0.com 5 points 1 week ago (1 children)

Im stupid Stones but I think it's in the user agent information, browser and version and other shit

[–] ClassifiedPancake@discuss.tchncs.de 6 points 1 week ago (1 children)

User agents cannot be fully trusted anymore since every browser puts every possible word in it so they are not excluded by anything.

load more comments (1 replies)
[–] wowwoweowza@lemmy.world 15 points 1 week ago

Greatest format ever. I present you with the Demi-God of memes award for best use of THEY LIVE if you originated the template. If you did not originate you get the cool assed dude award for sharing. Many thanks.

[–] muntedcrocodile@lemm.ee 13 points 1 week ago (1 children)

In most cases yes.

However I did find this really weird bug where Firefox was caching something to do with sockets (that would disallow connecting a new socket) that could only be cleared by restarting Firefox itself.

[–] towerful@programming.dev 9 points 1 week ago

Is that http2? Cause http2 allows for reuse of a connection for additional requests.

This caught me out with envoy reverse proxy doing a few subdomains using a wildcard cert.
The browser would reuse the connection cause the cert authority and IP was the same, but envoy couldn't figure out how to route the request correctly. Absolute head scratcher!

load more comments
view more: ‹ prev next ›