Why might a C++ programmer say “I could never write Python”?
jvns.ca
jvns.ca
Still I would not necessarily recommend against it.
Dynamic vs static typing, I have programmed in dynamic languages and for small projects there is a benefit to not having to worry about strict typing.
For large projects, you end up having to worry about strict typing anyways except manually (of course, there is a degree of this that is always true no matter what, and C++ is not the best example of "strong" typing, but it's a continuum). For that reason, I can definitely see the virtue of static typing for a large project, it does not solve all type related checks, but it at least reduces them, which can save some time.
What was your experience? What tools would you recommend, if someone were to start there today?
It seems like no matter where you choose to start, learning C or C++ is going to be an inevitable necessity. So I wonder, why not just start there?
I would definitely like to talk to you further about it, if you're willing.
He does state "by default" this would not be detected, which is true. Yes, the compiler isn't always on your back, but Jenkins is ;)
What the title should say is "Why might a C++ programmer find Python tedious"- Answer, because he/she has to write tests.
> Tests that wouldn’t tell you very much at all in Scala (that just run the code and don’t check the result) suddenly become incredibly useful!
I don't really know what that means. A Python programmer doesn't (shouldn't?) go out of their way to write insane tests like this because they are scared of the "uncertainty" of dynamic typing. Just write unit tests, and make sure your code is sufficiently covered. Use flakes/frosted to find low hanging fruit like this.
Hell, most of the world's C code was written basically that way. Often with a lot less testing and most of the testing that was actually done included no edge cases.
Or in C++ you forget to add "=0" to a method in a virtual class and you get a weird link error. Or in the not so distant past, forgetting to add a semi colon to a class definition... Or a simple mistake that makes the compiler emit 40+ errors on non-fitting candidate templates.
mumble mutter "pot" mutter mumble "kettle"
http://i.imgur.com/TVkU8KS.png
I'm sure most editors would complain about this. There are also IDEs like PyCharm that give you tab completion for Python.
If a C++ person says they could never write Python it is because they don't understand there is plenty of tooling that will verify your code.