• 0 Posts
  • 114 Comments
Joined 2 years ago
cake
Cake day: June 30th, 2023

help-circle






  • Javascript has a tendency to “just work” even when it might be a better idea not to. That is achieved by making assumptions and defaulting to certain pre-defined behaviors where most other languages would just stop. Unless something truly catastrophic happens, JS always tries to find a way to keep the code running. Good or bad, that’s by design just how it works.

    That is an example of this tendency. Normally the " ‘a’ + + ‘a’ " bit should be an error case, because that does not make sense. Where most programming languages would throw and error and stop execution, javascript just soldiers on. It assumes the center bit is an addition of numbers. Except since there’s no number there, it automatically injects the value that represents invalid numbers, which is “nan” for “not a number”. Then, since that “number” is surrounded by letters, it parses that number into a text value, which is the string “nan” itself. And then finally it adds all the letters together to form a banana.

    There are plenty of weird ways to get JS to give you stupid results back. Shit like these are not bugs with the language, it’s just JS working as intended. Except the way language works as intended can lead to actual bugs very easily, is the problem.



  • Twice, because usually it’s two sticks.

    In any case, RAM failure is rare enough that quadrupling its chances is not gonna make any meaningful difference. Even if it does, RAM is the easiest thing to replace in a PC. Don’t even need to go offline while waiting for a new stick. Someone who’s got the cash to build that thing in the first place won’t be too upset by the cost of another 32gb stick either, I don’t think.




  • I’ve always found it super interesting that Disney made a kids’ thing out of that particular book. Because that’s a bleak fucking book full of nasty filthy disgusting terrible people doing nasty filthy disgusting terrible things. Someone went “you know the classic where a couple of city officials drool after a gypsy woman and violently rape her in a cathedral and then hang her in the street? And a grotesque monster rampages against them for it? Wouldn’t the kids just love that one but as a musical and instead of hanging her they burn her at the stake?”