Dynamic type systems are meant for beginner/toy languages. Hacks that don’t care about understanding their own code tend to use Python. Their code is often riddled with bugs that they are none-the-wiser about.
If you write your code in Python, you might as well admit that you don’t care to understand what your code is actually doing.
Go might be a close 2nd language wise but not the others. All of the above have a pretty narrow application range too. Even with a good lamguage, you would have to have the libraries too and pypi is pretty big.
All three of those languages have library ecosystems at least as good as Python’s. Typescript is just as easy to learn and as fast to write as Python. I don’t see why you’d think Python is faster. If I add up all the time I’ve lost to Python’s terrible tooling it’s quite a lot slower!
Rust is definitely harder to learn - I’ll give you that. But once you have learnt it it’s just as fast as Typescript and Python. Especially if your “fast to write” metric measures to when you program is correct.
Lazy is an overly harsh and judgemental way to put it (virtually all programmers start with some high level simplified language), but the sentiment arises because it’s syntax is designed to be easy for people writing code, but at the cost of people maintaining code.
The whitespace delimiters, the lack of type system, the lack of semi-colons … They’re all things that people who haven’t programmed before think make programming easier. In reality they all make in the wild production programs waaay harder to maintain.
There’s a reason that JavaScript has been surpassed by TypeScript for professional developers, and it did so remarkably quickly. All that ‘extra’ information that seems pointless for a new dev to express, in reality constrains your program, makes it more readable and understandable, reduces the amount of tests you have to write, and makes it easier for someone else to come in and make a change to it and be confident they haven’t broken anything.
Python’s type system is dramatically better than Javascript’s though. Try doing things like '' + True and Javascript will do incredibly stupid things. Python will just give you a type error. Also, look at things like == vs === in Javascript as well. That’s the biggest reason why Typescript replaced it overnight. Python has found a better balance between productivity and error safety.
In my opinion, the biggest shortcoming of Python’s dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn’t have semantic errors (a lot more than, say, Java). It has gotten better with the introduction of type hints, those I don’t have much experience with them, so I can’t say how much.
In my opinion, the biggest shortcoming of Python’s dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn’t have semantic errors
Sure, but as with all things, it can depend on a lot of factors. All code needs some degree of testing, though one could certainly argue that Python needs more than Java and Java needs more than Rust/Haskell/etc. So you could argue that the productivity gain of using Python is offset by the productivity loss of extra testing. It’s still hard to say which one wins out in the end.
What is so lazy about Python?
Dynamic type systems are meant for beginner/toy languages. Hacks that don’t care about understanding their own code tend to use Python. Their code is often riddled with bugs that they are none-the-wiser about.
If you write your code in Python, you might as well admit that you don’t care to understand what your code is actually doing.
You can write Python code about 5x faster then C. Add libraries even faster.
I mean… C is a low bar. You can write Typescript, Rust and Go code 5x faster than C too.
Go might be a close 2nd language wise but not the others. All of the above have a pretty narrow application range too. Even with a good lamguage, you would have to have the libraries too and pypi is pretty big.
All three of those languages have library ecosystems at least as good as Python’s. Typescript is just as easy to learn and as fast to write as Python. I don’t see why you’d think Python is faster. If I add up all the time I’ve lost to Python’s terrible tooling it’s quite a lot slower!
Rust is definitely harder to learn - I’ll give you that. But once you have learnt it it’s just as fast as Typescript and Python. Especially if your “fast to write” metric measures to when you program is correct.
Lazy is an overly harsh and judgemental way to put it (virtually all programmers start with some high level simplified language), but the sentiment arises because it’s syntax is designed to be easy for people writing code, but at the cost of people maintaining code.
The whitespace delimiters, the lack of type system, the lack of semi-colons … They’re all things that people who haven’t programmed before think make programming easier. In reality they all make in the wild production programs waaay harder to maintain.
There’s a reason that JavaScript has been surpassed by TypeScript for professional developers, and it did so remarkably quickly. All that ‘extra’ information that seems pointless for a new dev to express, in reality constrains your program, makes it more readable and understandable, reduces the amount of tests you have to write, and makes it easier for someone else to come in and make a change to it and be confident they haven’t broken anything.
Python’s type system is dramatically better than Javascript’s though. Try doing things like
'' + True
and Javascript will do incredibly stupid things. Python will just give you a type error. Also, look at things like==
vs===
in Javascript as well. That’s the biggest reason why Typescript replaced it overnight. Python has found a better balance between productivity and error safety.In my opinion, the biggest shortcoming of Python’s dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn’t have semantic errors (a lot more than, say, Java). It has gotten better with the introduction of type hints, those I don’t have much experience with them, so I can’t say how much.
That is a large shortcoming.
Sure, but as with all things, it can depend on a lot of factors. All code needs some degree of testing, though one could certainly argue that Python needs more than Java and Java needs more than Rust/Haskell/etc. So you could argue that the productivity gain of using Python is offset by the productivity loss of extra testing. It’s still hard to say which one wins out in the end.
People underestimate the cost of testing.
Removing the need for entire classes of tests cases is a huge win