DEV Community

jones268
jones268

Posted on

What is better for Linux desktop app development between Python, C, and C++?

Hey, Developers! We all know Python is a great language for quickly prototyping, and that it scales beautifully to large code bases. But what's the best choice for desktop application development (Linux, macOS, or Windows)?

I have a preference for Python because it is already installed on the machines I use (and this way I will save some time) but you could be a bit concerned about its performance. On the other hand, C and C++ were kind of standards when it comes to programming for desktops.

Python is faster to learn than C or C++. C/C++ is more oriented for low-level programming on electronics like operating systems or drivers. Linux itself is written in C.

Which toolkit?

Once in a while, I see someone wondering whether PyQt or QT is the right framework to use for their desktop application. Should you use Qt or PyQt? The short answer is, it depends! Qt is a C++ framework, so if your application will be written mostly in C and C++, then you can use it.

If your application will have a Python part, there are frameworks for that too.

qt toolkit

On the other side, PyQt is a Python framework. So if your application will be written mostly in Python, then it's probably the right choice for you. But what about everything else?

For me, it's always been easy: I used PyQt because I was writing everything in Python and I didn't want to start messing with C++ just yet. That made my life a bit easier.

Also, PyQt and Qt are available on multiple platforms (Linux, BSD, OS X and Windows).

If you are new to PyQt, this is a great start:
Create GUI Apps with Python PyQt5

Other toolkits?

Another toolkit you can use is GTK or tkinter.

GTK is the default used on the Gnome desktop, which has it's own set of issues. Gnome while primarily installed on desktop computers, is designed for tablets. It doesn't have a start menu, the file manager can't display images (Windows 95 called, they have new features), no taskbar, no toolbar etc. Sure, you can use GTK without Gnome on i3 or window manager. However, many users prefer a complete desktop experience and KDE/QT provides one.

gnome desktop

Tkinter used to be the default for Python. It's basic and easy to learn, however it may not have all the widgets you need for developing your desktop program and it has an old interface. For example, you cannot build a webbrowser with Tkinter like PyQt unless it get's very hackish.

Top comments (0)