Monday 30 May 2011

Why I like C++

I am no C++ expert. In fact, my knowledge barely goes beyond pointers, arrays and classes. I couldn't create a fully fledged desktop application with it to the same degree that I can do in Java or C#, but I am gradually learning the Windows Development Process - even if it is a nightmare at first, especially with no MFC (Microsoft Foundation Classes - you need the full version of Visual Studio to get these). However, I have found that learning and coding with C++ is actually quite enjoyable.

The Syntax makes sense

A Java programmer can look at C# or C++ and get it. A C# programmer can look at C++ or Java and get it. A C++ programmer can look at C# or Java and get it. The reasoning for this is the syntax is nice. Everything is tabbed, variable decelerations happen based on type, initiation is easy, classes are easy. Blocks of codes are surrounded by curly brackets {}. Everything is easy to code. Even a beginner can look at some C++ code and make sense of it - there are only really a few basics to learn before a programmer can do an awful lot.

It's extensible

Some programming languages are incredibly limited because they do not allow for easy extensibility. C++ is not one of these languages. The default libraries for C++ are incredible, and development with these is neat, tidy and professional. These libraries can be extended upon by libraries provided by either sources, such as Operating Systems or SDKs.

Programs are lightweight

When I compile a program that does something simple (say a simple Math game) it is only a few KB in its compiled form. In Java it can be a few times more and in C# it can be dramatically bigger due to the .Net framework. C++ is not like this. Not only are the files themselves lightweight, the strain on the processor is lower and C++ programs tend to run faster because they use less resources.

It's compatible

When I write a simple C++ program I can re-compile it for many systems purely because there are compilers for those systems, and in fact there are C++ compilers for almost every system. Even if I'm coding a UI based application I can still recompile it with little modification thanks to the huge number of libraries like GTK that allow for interfaces to be created easily.

People actually use it

If I have a problem with C++, I can easily go and Google for the solution because so many people use C++, support simply exists. After all, the less popular a language is, the less support there is because there are less people to support it, but as one of the most popular languages, C++ is instantly helpful.

Learning is easy

Once you have learned the basics of C++ you can easily extend your knowledge because there is a global understanding of how it works, and all C++ programmers know to write their code in an easy-to-read way so that continuing to develop in the language is easy. A good example of this is learning Windows development in C++. Creating a Window does bring in different libraries and classes, however there are no really complex requirements for initialising a Window.

No comments:

Post a Comment