• 0 Posts
  • 15 Comments
Joined 3 years ago
cake
Cake day: June 20th, 2023

help-circle

  • Javascript’s type coercion is rather insane, yes, but there is an actual, practical reason it’s done. JS, having been designed to be run in web browsers, wants to avoid blowing up and crashing at all costs. If it gets an unusual type comparison, usually the result of a bug, it tries to return something, such that the script can continue running if at all possible. In JS’ mentality, keeping a page running, even if it might not completely function properly, is preferable to throwing an unhandled exception and completely crashing it.

    Whether or not that is the right approach is debatable, but there is at least some logic to it. Personally, I think that the proliferation of Node letting JS run outside of browsers exacerbates a lot of JS’ issues, but TypeScript does a lot to make it look like a more sensible language.


  • The whitespace doesn’t bother me. Any IDE worth a damn will manage that for you. As for the type system, yeah, I strongly prefer static typing, but for simpler projects I can see the convenience of it.

    My real issue with Python comes with managing a development environment when multiple developers are working on it. Dependency management in Python is a headache, and while in theory, virtual envs should help with synchronizing environments from machine to machine, I still find it endlessly fiddly with a bunch of things that can go wrong that are hard to diagnose.

    Python is great for small scripts, proofs-of-concept, and such, but I wouldn’t write anything more heavy-duty than that in it.













  • It does some funky things with type coercion and comparison which I don’t particularly like, but I generally understand why it does things that way.

    A lot of the weird quirks of JS come from the desire to avoid completely blowing up and crashing as much as possible, which makes sense in a web dev context. Forcing weird operations to at least return something can prevent an unhandled error state in a single component from causing an entire page to crash, even if that component ends up malfunctioning as a result.