Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Alright, to start off, I have experience as an amateur Obj-C/Cocoa and Ruby w/Rails programmer. These are great, but they aren't really helpful for writing cross-platform applications (hopefully GNUStep will one day be complete enough for the first to be multi platform, but that day is not today).

C++, from what I can gather, is extremely powerful but also a huge, ugly behemoth that can take half a decade or more to master. I've also read that you can very easily not only shoot yourself in the foot, but blow your entire leg off with it since memory management is all manual. Obviously, this is all quite intimidating. Is it correct?

Python seems to provide most of the power of C++ and is much easier to pick up at the cost of speed. How big is this sacrifice? Is it meaningful or can it be ignored?

Which will have me writing fast, stable, highly reliable applications in a reasonable amount of time?

Also, is it better to use Qt for your UI or instead maintain separate, native front ends for each platform?

EDIT: For extra clarity, there are two types applications I want to write: one is an extremely friendly and convenient database frontend and the other, which no doubt will come much later on, is a 3D world editor.

share|improve this question
    
You are asking questions to which the answers will be highly subjective - IMHO that's not constructive, thus voting to close. You also asking at least 4 different questions in one. How can anyone else but you know if C++ or Python is the better choice for you? I suggest you try to build a small GUI application with Python (which should take you not more than a day), and the same application with C++, and compare by yourself. –  Doc Brown Sep 23 '12 at 7:11
    
I guess what I'm really trying to ask is given what I'm looking for, which is objectively the better choice? –  John Wells Sep 23 '12 at 7:30
    
Can you give some extra context - what does your desktop app need to do? Lots of maths? Productivity app? Database access? A game? –  JBRWilkinson Sep 23 '12 at 7:49
    
Added edit to clarify want I want to do. –  John Wells Sep 23 '12 at 7:54
    
I'd opt for using the same language of the operating system and/or GUI library. You can do much more in depth manipulations to the UI more easily. Try simulating something as simple as full screen (press F11 in your browser) in a high level lang like Java or C#. I rest my case. Native solutions are portable to a wider variety of devices than high level solutions like java (ironically). –  Lord Tydus Sep 23 '12 at 12:26
add comment

closed as not constructive by Doc Brown, JBRWilkinson, Thomas Owens Sep 23 '12 at 12:10

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

up vote 5 down vote accepted

C/C++ is fast. The reality is, most apps wont need that performance with the state of the current hardwares. The usual way is to develop the application in a high level language, like python, than optimize when needed with lower level languages, like C/C++.

Python will give you a big productivity boost, it's easy to learn and reasonably fast. There is Cython, which you can use to write C extensions to use in your python app with python-like syntax to speed up bottlenecks.

For standart GUI apps, python can give you enough performance. And python has something very cool called Kivy, a GUI framework that runs on Mac, Windows, Linux, Android and iOS, and supports multi touch. The bonus part is, the performance critical parts are optimized with C, using Cython.

share|improve this answer
1  
You're probably right about speed. Kivy seems very capable, but can it draw system-native widgets? –  John Wells Sep 23 '12 at 7:36
    
Nope, it uses it's own graphics engine for widgets, using OpenGL ES. Qt will probably be your best bet for cross platform native widgets. –  Hakan Deryal Sep 23 '12 at 7:51
add comment

The Qt way of C++ is great and clean, so please, drop the "ugly behemoth" part, I've tried them both, and personally I'm much more productive/comfortable with Qt/C++ than with Python's Qt binding. That's my advice if you choose to go with Qt. Plus and beside the native experience that Qt widget provide, Qt5 and QtQuick2 with QML technology and the ability to embed JavaScript and HTML5 within your app, give you a modern web-like look & feel, if you choose to do so.

So, why I don't like Python in desktop apps and I prefer to keep it for scripting or server side things ?

  • Python breaks a bit the cross-platform joy, your client have to install Python to run your app (especially on Windows), and the different Python versions that are on the python's official website now make the client confused, which one to download/install.

  • Python to exe, make bigger apps (in term of size).

  • Python apps, eat more memory.

That's a personal point of view. Qt's parent system, smart pointers, wont let you shoot yourself in the foot, neither legs, the C++11 will give you even more features.

share|improve this answer
3  
"your client have to install Python to run your app" - you can distribute python dlls with your app, there is no need for the user to install python manually. You don't need to use py2exe or other buggy exe makers (from my experience), see Python Embedding, it's only a few lines of c++ code, replace PyRun_SimpleString with PyRun_SimpleFile, you can easily compile it yourself, that should make no overhead in size of your app. "Python apps, eat more memory." - use Cython to optimize memory demanding parts of your app. –  Czarek Tomczak Sep 23 '12 at 9:51
add comment

I would go with Python, as it gives you big productivity boost. You can still write portions of your app that need speed in C++, there is a Cython project that allows to use C++ libraries directly in Python. If you're concerned about security of your sources, Cython can also help with that, you can use it to compile your normal python code to C++ code.

I would recommend to embed Chrome engine and use technologies like: HTML5 + CSS3 + Javascript + JQuery + Canvas for the UI.

There is a framework that makes it easy to embed Chrome engine in your C++ app, it's called CEF - Chromium Embedded Framework. It supports Windows, Linux, Mac OS.

If you like Python, have a look at CEF Python, it's a project that provides python bindings for the CEF framework (by using Cython). CEF python currently supports only Windows, but there are plans for other OS'es.

Here is a list of applications that have been successfull using CEF (taken from here):

  • Adobe Brackets - code editor for the web
  • Adobe Edge - multimedia authoring tool
  • AppJS - build desktop applications using Node.js
  • AOL Instant Messenger - windows client uses CEF
  • Cubiez - integrates your favorite content into the desktop
  • Desura - online game platform
  • Dish World IPTV - streaming video platform
  • Evernote - notetaking software
  • ExeOutput - allows you to deploy html5/php applications as desktop applications
  • GitHub for Windows - GitHub client software for Windows
  • Janetter - twitter client software
  • mChef - mIRC browser plugin
  • MediaMan - organizer software
  • MetaVR - geographic simulation software
  • MTG Studio - game organizer software
  • OpenSpace3D - 3D development platform
  • Rdio - streaming music platform
  • Spotify - streaming music platform
  • Steam Client - online game platform
  • Tencent QQ - instant messaging program and web browser
  • Trend Micro - internet security software
  • WBEA Desktop - allows you to deploy html5 applications as desktop applications

Also have a look at this blog entry: Building a Desktop-Quality App on Web Technologies - Brackets editor team explaining how they built it using CEF framework and web technologies like: jQuery, Bootstrap, LESS CSS, requireJS, Jasmine for Unit testing, JSlint.

Disclaimer: I'm the author of CEF Python project.

share|improve this answer
    
Thanks for your input! CEF looks quite nice, but I'm hoping to provide a native experience on each platform if at all possible, which is difficult to reproduce with HTML, CSS, and JS. –  John Wells Sep 23 '12 at 7:34
    
@JohnWells, why native? People are used to web experience. Look at Windows 8, each next OS from microsoft has less to do with native, they're forcing web technologies and this is the future, there is no such thing like "native experience", it's a thing of the past. –  Czarek Tomczak Sep 23 '12 at 7:42
    
It depends on what software you're talking about. Consumer-oriented applications might be alright with a "web" feel, but that doesn't fly so well with software centered around content creation. Also, while Windows 8 might be geared towards web tech, Mac OS is still firmly grounded in native-land and its users tend to dislike software that deviates away from that. –  John Wells Sep 23 '12 at 7:46
    
Don't confuse 'is native' with 'looks and feels like other apps on the platform'. GUI styling for a specific platform can give you what you need here. –  JBRWilkinson Sep 23 '12 at 7:54
    
Quite right JBRWilkinson, but I really do not want to write widget-mimic CSS (in the case of CEF) for each platform if I don't have to. –  John Wells Sep 23 '12 at 7:59
show 3 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.