428
submitted 1 year ago* (last edited 1 year ago) by kuneho@lemmy.world to c/programmer_humor@programming.dev

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

Ugh, I just ran into this in Terraform. Why is this a thing?

[-] Swiggles@lemmy.blahaj.zone 8 points 1 year ago

It's just sorted alphabetically (technically it is the UTF16 code order). To be fair it's a sane default for most use cases. In JS case you can define a very simple callback to change the behavior to numeric sorting (a,b => a<b). Many other sorters provide a flag instead, but numeric sorting is seldom the default as it is not as useful most of the time in weakly typed languages.

[-] excel@lemmy.megumin.org 2 points 1 year ago

weakly typed languages

Well, looks like we found the problem right there

this post was submitted on 07 Jul 2023
428 points (98.6% liked)

Programmer Humor

19463 readers
770 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 1 year ago
MODERATORS