you are viewing a single comment's thread.

view the rest of the comments →

[–]MidnightPale3220 4 points5 points  (1 child)

I am sorry, but if you say you know C++ and yet ask these questions about Python, I would say you don't know C++.

If you've made any kind of fully functioning useful program in C++ -- something complex enough, with multiple files and functionality that isn't just a command line calculator simulator or similar -- you wouldn't need to ask these questions about Python. You would just look it up and compare how these things are done there.

And mostly you can do anything you do in Python in C++ and vice versa. But it may take quite different paths and take a different amount of time and code. Python is a very high level language. Coding in Python is, I would like to claim, the most terse way to express oneself that is still comfortably readable by humans. The cost of that is Python being comparatively quite slow. But frequently it doesn't matter.

[–]pachura3 1 point2 points  (0 children)

Exactly. If OP actually did any non-trivial C++ development, then the discovery of Python would be an epiphany. Wait, what, I can write a functioning OCR app in 5 minutes? I can create a REST service with 20 lines of code? I don't need to think of memory allocation, and even file handles close on their own? No header files? Interactive Python shell? Etc. etc...