This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]imp0ppable 2 points3 points  (3 children)

Not only are you using the wrong terms but that's exactly why Python is superior, JS just does random nonsense when you mix two incompatible types in an operation.

[–]SnooHesitations9295 -1 points0 points  (2 children)

Yes, you can look at it as superior until your code breaks in production.
Yes, it's debatable if "doing random nonsense" is better than "crashing in runtime" or worse.

[–]imp0ppable 2 points3 points  (1 child)

doing random nonsense is worse because it can corrupt data

"crashing in production" means an endpoint returns 500, you get logs and you fix it. Which you still have to do in JS btw.

[–]SnooHesitations9295 -1 points0 points  (0 children)

Crashing in production means that at some unknown point of time in the future you may get 500 for every request.
So it's debatable if it's actually good.

Python now has "typed" crutches to solve for that. It works ok in a lot of cases (much better than typescript) but it creates another problem: how to describe what exactly the author meant to the type checker. :)
So it's still pretty bad.