184

you are viewing a single comment's thread
view the rest of the comments
[-] grue@lemmy.world 88 points 1 day ago

Less fucked-up than Javascript.

[-] Solrac@quokk.au 3 points 20 hours ago

I did not wish to believe... but then I saw.

image

[-] NateNate60@lemmy.world 41 points 1 day ago

This diagram is nonsense. JavaScript programmers know to simply never use == but to use === instead. Half of JavaScript is like this. Oh, there's a feature, but it behaves in a super weird way so we don't use it to avoid the weirdness.

[-] ParlimentOfDoom@piefed.zip 9 points 1 day ago

As someone trying to learn Javascript, it just makes me mad that at this garbage heap of a language is so widely used.

[-] victorz@lemmy.world 1 points 1 day ago

The problem is that you can't break compatibility.

Only in some exceptional cases. ๐Ÿ™ƒ

[-] ParlimentOfDoom@piefed.zip 3 points 22 hours ago
[-] victorz@lemmy.world 3 points 19 hours ago

Personally, I'd love to break compatibility for better features and consistency. We should be able to declare the version at the top of the file or something. Nothing at the top = legacy crap. ๐Ÿคทโ€โ™‚๏ธ I dunno.

[-] GeirGrusom@lemmy.world 15 points 1 day ago

Where's the >== operator? Because they also have the exact same problem.

[-] nykula@piefed.social 2 points 1 day ago

== has never, ever caused me a single issue. Parsing all server input with type-safe schemas makes sure that where I expect a string, I get a string; where I expect a number, I get a number. Bad data must result in an error before it reaches logic.

[-] NateNate60@lemmy.world 11 points 1 day ago

"I have no problem living in a house of cards as I make sure to never bump against the walls."

[-] nykula@piefed.social 1 points 15 hours ago

Opposite, living in a house of cards is when you blindly trust data that comes from user. Regardless of the language. eqeqeq isn't in the recommended linting presets because if you end up needing it, you're probably already in big trouble because of insecure software design.

[-] NateNate60@lemmy.world 1 points 8 hours ago

Nobody is advocating for blindly trusting data from the user.

[-] grue@lemmy.world 1 points 19 hours ago

I wonder how many millions of programmer man-hours have been wasted working around JavaScript's design mistakes that could've been saved simply by putting Scheme or Python (which were actually being considered) in the browser instead.

[-] dan@upvote.au 12 points 1 day ago

The recommended ESLint rules catch most of the bad stuff, and these days this is all you need in your ESLint config to enable them:

import {defineConfig} from 'eslint/config';
import js from '@eslint/js' 

export default defineConfig([
  js.configs.recommended,
]; 

There's one use case where == is still commonly used: == null matches both null and undefined. Lint rules that block == usually allows the null case as an exception.

[-] BradleyUffner@lemmy.world 8 points 1 day ago* (last edited 1 day ago)

So you're saying the jank has become structural?

[-] Venator 3 points 1 day ago

I wonder how much bandwidth is wasted on the extra =, since it survives minification ๐Ÿ˜…

[-] ignotum@lemmy.world 6 points 1 day ago

But if every single comparison used in a file is a triple =, then any compression algo worth its weight in salt will compress that bloat away during transmission

The real issue is all the precious precious RAM those extra = use on the client device once received and unpacked!

[-] 9point6@lemmy.world 2 points 1 day ago

Gzip (any properly configured static server will serve compressed assets) probably compresses them down so probably a single extra byte per file

[-] dan@upvote.au 2 points 1 day ago* (last edited 1 day ago)

Gzip is old-school. The majority of modern sites use Brotli now. It's slower to compress, but that's not normally an issue for static resources (CSS, JS, etc) because they can be pre-compressed during the build and the web server serves the pre-compressed files instead of dynamically compressing them.

[-] 9point6@lemmy.world 4 points 1 day ago

IIRC modern linter rulesets generally just outright error if you do anything remotely like this.

[-] diaphragmwp@discuss.tchncs.de 0 points 1 day ago

When I had to use JS I wrote JS 1.2 because why not. Fun how I had strings of numbers instead of actual numbers in some for loops, yet it all sort of functioned until something didn't. I then decided to add Number() to random values just in case.

this post was submitted on 02 Nov 2026
184 points (97.4% liked)

Programmer Humor

33973 readers
231 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 3 years ago
MODERATORS