FAQ: Why choose C++ and Qt for a programming beginners tutorial?

For the first series of programming tutorials for people new to computer programming, I have chosen the combination of the C++ programming language and the Qt library and tools. Given the slightly complicated installation procedure and seeing that C++ is not specifically designed for beginners, people often ask me why I made this choice.

I will try to answer this shortly in the following paragraphs.

The Pros

I mainly see the pros of the combination of C++ and Qt in its flexibility, as well as its usability for programming on different operating systems without changes to the code:

  • C++ is a widely used and highly flexible programming language, which offers more options for programming all kinds of systems than most other programming languages.
  • C++ development tools are available for free on all current major operating systems, so you don't have to use a new programming language when using another operating system.
  • The Qt library and tools offer advanced functions for graphical user interfaces in a single, operating-system independent way. You do not have to change the code of your program in order to be able to use it on a different operating system.
  • The Qt SDK is maintained as open source software and can be downloaded and used for free.
  • Because C++ and Qt are available for all major operating systems, you can follow the tutorials and use the programs within no matter if you are using Windows, MacOS X or Linux.
  • The tools which are part of the Qt SDK make it easy to create good looking and useful interfaces for your programs without limiting you to a single operating system.
  • C++ can be used for very structured, high-level programming, but also offers mechanisms for low-level hardware programming. This gives us a lot of possibilities when developing software solutions for any kind of problem. While you can do similar things in other programming languages, you usually have to combine two or more of these in order to achieve a similar level of flexibility.
  • I have gathered a lot of practical knowledge in C and C++ programming, so it is relatively easy for me to teach the language to you.

The Cons

  • The installation of both the C++ development tools and the Qt SDK requires more steps than some other development tools, even if you install everything with the default settings.
  • You have to use the Qt Creator tool instead of other integrated development environments in order to use all available Qt development tools conveniently, even if other IDEs have been installed during the installation of the basic C++ programming tools.
  • You have to be somewhat more careful with your coding because errors during the usage of pointers can cause your program to crash on runtime.

The possible crashes when not using pointers properly are not really a big deal in most of todays operating systems. If your program crashes, this will only affect the process and the part of the memory which has been used by this process. Where in older operating systems this might have caused the whole system to crash, requiring you to restart the system, current multitasking systems are usually not affected by this.

Other options

Of course I also thought about other options for programming languages for programming beginners, as well as different development environments etc.

The BASIC progamming language was an easy first choice - it has been designed to be used for learning purposes right from the start. The problem was that I did not find satisfying solutions for BASIC development tools which were free to download and use and at the same time available for all major PC operating systems (Windows, Mac OS X and Linux).

I could have started a tutorial using Visual Basic Express for example, but this would not have been that useful for budding programmers with MacOS X or Linux as the programs could only be used within a virtual machine running Windows and not the native operating systems themselves.

As a cross-platform programming language with cross-platform development tools, Java also would have made a good choice. I did not use this because first I am not that too proficient in Java programming and second Java does not offer options for direct, low-level hardware programming (only by calling external, usually in C or C++ developed functions from precompiled libraries).

Conclusion

In my mind, the advantages in using C++ and the Qt SDK for a programming tutorial (and programming projects) are bigger that the disadvantages. At the same time this offers more flexibility, while still being a cross-platform development environment.

So that is why I am using it here.


Enjoy this page? Please pay it forward. Here's how...

Would you prefer to share this page with others by linking to it?

  1. Click on the HTML link code below.
  2. Copy and paste it, adding a note of your own, into your blog, a Web page, forums, a blog comment, your Facebook account, or anywhere that someone would find this page valuable.