4 ms·
Indeed, the given strawman alternative languages (Ruby and Python) are far, far worse for productivity. Python changes are totally unreviewable since one canno
by thrownaway2424 11y ago
Indeed, the given strawman alternative languages (Ruby and Python) are far, far worse for productivity. Python changes are totally unreviewable since one cannot in any way reason about the correctness of a function call without reading the definition of the function itself, and all the functions to which it passes the arguments, all the way down, which of course takes forever. At least with C++ you can reason that if a change compiles it has not made any dramatically stupid type errors. You still need to think about whether any unnecessary temporaries or copies were made, or questionable assignments, but you need only think about that one level deep. Is seems to me far more dangerous to suggest writing new code in Python.
- mathgenius 11y agoType declarations in python have another name: unit tests.
- CyberDildonics 11y agoI don't know why this is controversial, in Julia type annotations to expressions are basically asserts
- hifier 11y agoUmmm, unit tests? The compiler offers a false sense of security. Type safety is not correctness.
- avita1 11y agoNot to dredge up this debate for the umpteenth time, but the same can be said of unit tests: they are not a proof of correctness, and they often give you a false sense of security.
- thrownaway2424 11y agoThe Internet has, indeed, conducted this argument thousands of times. My point here is only about the difficulty of reviewing Python code. I find myself sometimes having to hold up a piece of paper to the screen to see if the indentation has been done right, in addition to the aforementioned function-body-reading chores. Of course my opinion is of no concern to people except those who work with me, from whom I refuse to review Python code. It's just not worth my time.
- hifier 11y agoMy point is that there are tools and techniques that will solve these problems in ways that are more valuable than the compiler's type system. If you seriously "refuse to review Python code" because you feel you need to visually check indentation, I think you might want to take a step back and evaluate your methods.
- pcwalton 11y ago> At least with C++ you can reason that if a change compiles it has not made any dramatically stupid type errors. And with Python you can reason that if code parses it isn't going to have undefined behavior (for example, segfaults randomly thousands of lines away from the actual problem due to heap corruption, or exploitable use-after-free vulnerabilities). Type safety only has the benefits you describe if the language is actually type safe.