4 ms·
Ok, let's admit it, writing bad Python code is very easy, as it is in every dinamically typed language, like Javascript... ... but I think you're forgetting th
by Lucasoato 5y ago
Ok, let's admit it, writing bad Python code is very easy, as it is in every dinamically typed language, like Javascript...
... but I think you're forgetting the real motivations that drive people to use Python: it's easy to learn, it's very readable, there's a large (and not so much toxic) community behind, it's versatile.
No one is saying that it will replace every other language, but it still can find its space even among large projects.
- taeric 5y agoI think the "dynamic" jab is a bit of a trap, itself. It is easy to write bad code in most any language. Anyone that tells you otherwise is trying to sell you something.
- capitainenemo 5y agoReadable varies by person. Myself, I find the decision on significant whitespace to make reading Python like reading English with no punctuation or capitalisation.
- BiteCode_dev 5y agoIt's not that easy actually. Python already does so much for you, and provides so much tooling to do even more, it's hard to write bad code if your daily job is to be a coder. The iterator protocol means you rarely get off by one errors, context managers and GC deals with resource handling, the GIL, for all its faults, helps a lot of concurrency errors... Now, add a good IDE, and syntax errors, names errors and attribute errors go away. Play a little in the REPL, and use cases become more obvious, behaviors more clear. Want more security? You can add type hints and unit tests (which are incredibly easy to write, thanks to pytest). Even without all that, the size of the ecosystem means you won't write most of the code anyway, and less code, means less potential for mistakes. Adds to that the language bare bone syntax, and you really has something that actively helps with writing good code. Not to say you can't write bad code in Python, but unless you are not a professional dev (in that case, you can write bad code in any lang), you have a lot to help you there.
- dragonwriter 5y ago> Ok, let's admit it, writing bad Python code is very easy, as it is in every dinamically typed language Writing bad code is easy in most statically typed languages too.