r/programming • • Jan 26 '15

Why a C++ programmer might say "I could never write Python"

http://jvns.ca/blog/2015/01/24/why-a-c-plus-plus-programmer-might-say-i-could-never-write-python/
0 Upvotes

8 comments sorted by

5

u/industry7 Jan 26 '15

I'm a C++ programmer and I have written some Python before. So I can do it, although I'd rather not have to. Mostly for the reasons listed in the article. I feel like it's an enormous waste of time having to write code (unit tests, runtime asserts, etc) just to make up for the lack of compile time checks.

2

u/htuhola Jan 26 '15

If you write python like you're writing C++, there is indeed nothing gained from writing python.

3

u/industry7 Jan 26 '15

If you write python like you're writing C++

I don't.

-1

u/htuhola Jan 27 '15

You can as well substitute that with "I don't know".

The inconvenience I get from writing C++ is so huge that I spend hundred times longer working on the same project. If you manage to achieve that inconvenience in python then you're writing it like C++, not using the language as leverage.

I've seen this to happen even if the runtime code is restricted to strict, C++ -like subset, such as it is in rpython. The size reduction came from the fact that I could put the script generate large part of the runtime.

And if you're going to argue that it's all different in some modernized version of C++, I haven't seen any significant improvements. It's all just imitation of syntax in other languages, but not bringing any of the qualities along.

3

u/industry7 Jan 27 '15

You can as well substitute that with "I don't know".

You seem to be assuming that I have no idea what Python code is supposed to look like, or how it's supposed to be written.

The inconvenience I get from writing C++ is so huge that I spend hundred times longer working on the same project.

That's hard to believe. Maybe if you're already really good at Python and you're just starting to learn C++...

If you manage to achieve that inconvenience in python then you're writing it like C++

Oh ok, then I must not be writing Python as if it were C++. Because there's definitely not a 100x difference for me.

0

u/htuhola Jan 27 '15

I don't need to assume that anymore. You cast away the doubts I had. That's a pity because I'd have been interested about some good reasoning that goes against mine.

3

u/SuitSilver Jan 26 '15

As a Python programmer, I'm pretty sure I could never learn C++

1

u/Cuddlefluff_Grim Jan 27 '15

I once heard a C++ programmer say “oh no, Python, that’s so hard, I could never write that. I’m so used to having a compiler!”

/r/thatHappened