For me, Octave is noticeably slower than Matlab. I don't care. I use it only for small projects/prototyping as heavy stuff would be programmed in C++. I never seriously tried Python, I'm too used to C++. Maybe I will someday, if I have some free time for experimenting.
If someone switched from C++ to Python, what's your feelings and opinion on that?
Python will help you rapidly prototype logic and supports multiple inheritance like C++. You can also create python bindings for C++ modules and then implement them in tandem with python's useful libraries to maintain most of the speed of C++. They are a great pair and using python will get you access to a lot of cool tools for building quickly.
That said, pure python is really slow at runtime compared to C++ and is lacking in a few areas like GUI development. Dynamic typing can create some hard to trace bugs and the all public variable schema might bother hardcore fans of the public/private model.
The final say is really what you wanna do. Pythons great for data science if you use it right and makes quick work of building the backend for web apps (and can be used for front end stuff too, it's just not super impressive). Or if you want to script and automate tasks or interact with common APIs without using javascript, python is a great place for you.
It's also super easy to learn, so no harm in trying.
I respectfully disagree about Python lacking in the GUI department. Python ships with tkinter out of the box, and there are nice Python bindings for every major GUI toolkit. Meanwhile C++ ships with bumpkis but, of course, also has bindings for every major GUI toolkit. In my personal opinion, it’s actually a lot easier to do GUI development with Python, because I don’t have to worry about memory management.
I think the problem is, GUI development isn’t very good anywhere.
True, things do exist for gui development in python, but I'm just not impressed by them. Tkinter is only really meant for simple gui dev, so I dont think shipping with it is such a boon that it qualifies python as a great source for front end work. Also pyqt, one of the more popular python libs is written in C++ - just like wxPython and libavg. So yeah, pythons got bindings for libraries for gui development and not all of them are terrible, but none of its very impressive. I guess kivy is a thing, but its optimized for mobile apps and game development.
On top of the libs, there's the lack of tools. Like, what ide can you use to graphically drag and drop interfaces for python? Zero. Java's swing lib has eclipse and visual studio works with C++ and vb.net and C# (windows only), but python is straight coding which is a pain in the ass and slower to prototype even if the language is easier to write.
Lastly, python isnt compiled which means C++ will outperform it by a mile, especially for gui dev.
I love python but I dont deny its shortcomings. Gui dev in python is almost certainly one of its deficits, especially when considering performance.
We can agree to disagree, though! your tools your choice.
Like, what ide can you use to graphically drag and drop interfaces for python?
Ah, you can do this with Qt. Take a closer look at PySide or PyQt. It might be the thing you’re missing in your Python life. I tend to write GUI’s in Python precisely because it’s just drag and drop and then filling in the event handling code. It feels like Visual Basic did back in the day.
C/C++ will always be more performant that Python. But GUI stuff is exactly the kind of thing you can use Python for and get away with. What kind of GUI stuff are you doing that you need so much speed?
4
u/Raiptwice Aug 06 '19
For me, Octave is noticeably slower than Matlab. I don't care. I use it only for small projects/prototyping as heavy stuff would be programmed in C++. I never seriously tried Python, I'm too used to C++. Maybe I will someday, if I have some free time for experimenting.
If someone switched from C++ to Python, what's your feelings and opinion on that?