724
JavaScript (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] firelizzard@programming.dev 51 points 1 week ago

Sure. But in a sane language doing something totally nonsensical like that is an error, and in a statically typed language it’s a compiler error. It doesn’t just silently do weird shit.

[-] morgunkorn@discuss.tchncs.de 13 points 1 week ago

Agreed! Unfortunately these maddening behaviors were kind of set in stone several decades ago, and it has been (correctly) decided "Don't break the web", these weird quirks are kept in modern interpreters/compilers.

It's actually quite interesting to read through the logic to follow when implementing an interpreter:

https://262.ecma-international.org/13.0/#sec-object.prototype.tostring

[-] leftzero@lemmynsfw.com 4 points 1 week ago* (last edited 1 week ago)

a sane language

JavaScript

Pick one.

[-] firelizzard@programming.dev 1 points 1 week ago* (last edited 1 week ago)

I thought it was clear I was saying JavaScript is not a sane language for this very reason

[-] jcg@halubilo.social 1 points 1 week ago

What's a sane, dynamically typed language?

[-] firelizzard@programming.dev 3 points 1 week ago

I was trying to make a point without starting a flamewar that was beside the point. Personally I’d never choose a dynamically typed language for a production system. That being said, Python and Ruby complain if you try to add an array, dict/hashmap, string, or number to another (of a different type) so they’re certainly more sane than JavaScript.

this post was submitted on 23 Jun 2024
724 points (96.4% liked)

Programmer Humor

18253 readers
720 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