4 ms·
Python let's you get stuff done fast, but it's almost more dangerous than C in some respects. Without a compiler, you run the risk of deploying code that will n
by bluejekyll 10y ago
Python let's you get stuff done fast, but it's almost more dangerous than C in some respects. Without a compiler, you run the risk of deploying code that will not run, and you don't know until that section of code is actually executed. Requiring a massive set of tests to actually validate your code.
On top of the additional testing, you also will have a performance problem at some point after success. And then people will discuss or even plan for a rewrite in a more performant, language. But we all know that rewrites usually fail to materialize. PoC's turn into products, products turn into companies, and companies bottom lines can't generally spare time and money to rewrite the entire service.
I'm not advocating for C, but I wouldn't put Python up as a comparable thing.
- witty_username 10y agoHaving the correct type doesn't guarantee correctness. As a noob C programmer, in my programs segfaults often occur along with undefined behaviour (which is much worse, as your program will silently give the wrong output). While in Python, you'd get a traceback which is much easier to debug. > Requiring a massive set of tests to actually validate your code. Both require tests to validate your code. Sure, static typing can verify some trivial mistakes, but they can't check that array accesses are in bounds, integer overflow, etc.
- kruczek 10y ago> As a noob C programmer, in my programs segfaults often occur along with undefined behaviour (which is much worse, as your program will silently give the wrong output). > While in Python, you'd get a traceback which is much easier to debug. Well, C's segfault will also generate core dump, which is essentially the same thing as Python's traceback - it tells you where the program crashed.
- dragonwriter 10y ago> Python let's you get stuff done fast, but it's almost more dangerous than C in some respects. Without a compiler, you run the risk of deploying code that will not run C code that compiles can and does blow up at runtime. There are languages whose type systems do go a long way toward minimizing the risk of this happening, but C is not really one of them.
- bluejekyll 10y agoI completely agree. C sucks at runtime. I was trying to point out that Python sucks at runtime too. I personally wouldn't choose either language for a new project.
- StavrosK 10y agoYou're actually talking about typed vs untyped, which isn't so much about C vs Python. Python is slowly acquiring static type checking (and it's working rather well nowadays).
- bluejekyll 10y agoYes, I should have been clearer that this wasn't in support of C over Python. I'm commenting on the relative safety of Python and the downstream costs of using it. C is not typesafe either, and blows up for other reasons at runtime.
- StavrosK 10y agoYep, agreed. I'm very excited about the optional type checking in Python, and can't wait for it to improve so I can use it in all my projects.