Quote:
Originally Posted by auspex
Vice versa, but you're right. Anybody who flat out states that if you want a program to run as fast as possible you use C++, (a) has never programmed in assembler and (b) doesn't understand C++. If I wanted to trim milli-seconds, I'd use C, not C++, but replacing every bit of Python in calibre with C++ would save you almost nothing.
|
I was referring to development effort since a previous post seemed to imply that C++ is also more work. With respect to execution speed, PyQt wraps C++/Qt so you wouldn't get any improvement in Calibre, at least where Qt is used.
Having said that, Python is indeed generally slower than C and C++ although there are things you can do about that. I also disagree with your statement regarding C and C++. You can write proper C++ that is as fast or faster than C (see the shootout for a couple of examples). Of course you can also abuse either to make any speed comparison between them meaningless.
In general, it is better to just go with what you are comfortable with - faster development, less errors. Using well-designed libraries like Qt instead of reinventing the wheel also helps. If it turns out that something is slow then you can do some local optimizations (e.g. replace some python code with C or change a container type).