DEV Community

Discussion on: Pitch me on Python

 
codingjlu profile image
codingjlu

Wait, the "problem" TS solves is implementing static type checking, but there's no type checking in Python, so I'm not sure where you're coming from. Besides that, could you tell me some of the pitfalls you (or you've heard others) encounter when trying to JavaScript? What parts of it do you think are bad designed? I've worked with JS for a long time, and I love Rust, but I like JS even better. For me, Python is way down there next to PHP. And yes, JavaScript, in my opinion, is the best language out there (even ML).

Thread Thread
 
tusharsadhwani profile image
Tushar Sadhwani • Edited

Python has type checking support (in a way that Javascript is planning to add now, there was a TC39 proposal for it this year)

Consider properly trying python then I guess, don't know what else to say.

Ref: tshr.me/mypy

I guess Javascript also has a way to do type checking (jsdoc), but it's awful to write imo.
Apart from that, the weak typing (any data type can turn into strings if you use the wrong operator), the weird rules about how == works, and the baggage of es3 and older standards (eg. array.sort() doesn't do what you'd expect) is enough for me to hate the language as it is.

Thread Thread
 
codingjlu profile image
codingjlu • Edited

Well, I guess it comes to how experienced you are with each language. I've never had any problems with anything you mentioned in JavaScript, so it's probably specific to how much you learned (although I've seen SO posts where people completely crash everything). Sure, JavaScript has its quirks, but I've learned how to avoid the hectic ones and love the others. Python, on the other hand isn't the strange behavior, but more about its misuse (beginner usage—someone made a brute force password guesser in Python), abuse, and overuse that makes me slightly despise it. For me, too, I've never struggled with the untyped language JavaScript, it works perfectly for me. Let me also ask, do you actually use mypy?

Thread Thread
 
tusharsadhwani profile image
Tushar Sadhwani

Javascript is much more misused (given that it's even more popular with beginners), you probably just haven't found the cases :P

I do use mypy, on every project I work on personally and at my workplace.

Thread Thread
 
codingjlu profile image
codingjlu

Okay, good for you.