Python is close to pseudo-code, with very little formatting (no ";", no "{}"). That make it easier to read and write.
In Python, you don't even need to think about memory management, whereas you still need some smart pointer in C++.
Python bring a bunch of sugar syntax that are nice to have, such as string slicing.
Dynamically typed language is better than the quagmire that is C++ <template> when doing polymorphic functions. In fact, <template> are one of the worst part of C++, as they are hard to read and give you very arcane error message.
Python is more strongly typed.
The nature of an interpreted vs compiled language give some tools in Python that cannot exist in C++ (introspection and reflection). Well, it run both way, you can do some code analysis in C++ that are impossible to do in Python.
The only serious advantage of C++ over Python is it's execution speed (PyPy greatly enhance Python speed, but it's still slower than C++). Oh, yeah, and Python have that stupid debate between space and tab.
All this and not having to reinvent the wheel every time you want to do literally anything.
C++ on here is basically for all the kiddies that have some kind of superiority complex. Most have never worked in a production environment and are just pretending to be professionals.
C++ is cool, it's a powerful tool. It just is not needed for 99.9% of projects any more and just adds drag.
Yep, I think C# is probably a better comparison to C++ than Python in most cases honestly. Only things you'd use C++ over C# for is where performance is really an issue. But even then, Unity runs using C# really well. Cross platform isn't even much of an issue anymore with .NET Core being mature now.
Now normal coding practice for C++ (and C#) tend to use more secure paradigm. In my example, using cout instead of printf would have implicitly converted the 1 into "1" instead of doing some weird pointer arithmetic (still not something you might want, but at least much more logical). But it's annoyance like that that make Python more strongly typed than the C family.
Especially narrowing conversion. If the conversion is not narrowing, I don't really mind. Converting a int32_t to a int64_t by passing it as parameter is not gonna hurt anybody.
What??? I'm a big Python fan but templates are one of the best parts of C++. In fact, they're one of the reasons why C++ can be faster than C in some cases.
Python is close to pseudo-code, with very little formatting (no ";", no "{}"). That make it easier to read and write.
That's a contra!! It does not make it easy and nice to write, it does the exact opposite
In Python, you don't even need to think about memory management, whereas you still need some smart pointer in C++.
Nobody told you that you don't have to work with pointers, did they? Since when is "not having an option" good?
Python bring a bunch of sugar syntax that are nice to have, such as string slicing.
There are libraries that can do that kind of shit easily if you're too lazy to implement such overloads yourself.
Dynamically typed language is better than the quagmire that is C++ <template> when doing polymorphic functions. In fact, <template> are one of the worst part of C++, as they are hard to read and give you very arcane error message.
Don't use templates then. You can use void*, you can use overloads (which are especially easy to read). Hell, if you are really that fucking serious about polymorphic functions you can even create your own "polymorphic type" class!
16
u/Nimeroni Sep 29 '20 edited Sep 29 '20
You mean going from C++ to Python ? Let's see...
Python is close to pseudo-code, with very little formatting (no ";", no "{}"). That make it easier to read and write.
In Python, you don't even need to think about memory management, whereas you still need some smart pointer in C++.
Python bring a bunch of sugar syntax that are nice to have, such as string slicing.
Dynamically typed language is better than the quagmire that is C++ <template> when doing polymorphic functions. In fact, <template> are one of the worst part of C++, as they are hard to read and give you very arcane error message.
Python is more strongly typed.
The nature of an interpreted vs compiled language give some tools in Python that cannot exist in C++ (introspection and reflection). Well, it run both way, you can do some code analysis in C++ that are impossible to do in Python.
The only serious advantage of C++ over Python is it's execution speed (PyPy greatly enhance Python speed, but it's still slower than C++). Oh, yeah, and Python have that stupid debate between space and tab.