Re:Starting a tech startup with C++
by thrownaway2424 on Saturday January 02, 2016 @02:14PM
(#10827428)
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.
[ Parent
| on HN ]
> 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.
Ummm, unit tests? The compiler offers a false sense of security. Type safety is not correctness.
Not 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.
Re:Starting a tech startup with C++
by thrownaway2424 on Saturday January 02, 2016 @06:38PM
(#10828603)
The 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.
My 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.
Re:Starting a tech startup with C++
by mathgenius on Saturday January 02, 2016 @04:14PM
(#10827975)
Type declarations in python have another name: unit tests.
Re:Starting a tech startup with C++
by CyberDildonics on Saturday January 02, 2016 @08:07PM
(#10828963)
I don't know why this is controversial, in Julia type annotations to expressions are basically asserts