C++ - Introduction

C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell LabsC++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. This C++ tutorial adopts a simple and practical approach to describe the concepts of C++ for beginners to advanced software engineers.

WHY TO LEARN C++

C++ is a MUST for students and working professionals to become a great Software Engineer. I will list down some of the key advantages of learning C++:

  • C++ is very close to hardware, so you get a chance to work at a low level which gives you lot of control in terms of memory management, better performance and finally a robust software development.

  • There are many modern day databases such as MySQL, MongoDB, MemSQL, etc. that are written in C++. This is because C++ is quite modern and it supports features like exceptions, lambda expressions, etc. Many of the databases that are written in C++ are used in almost all of the in-use applications such as YouTube, WordPress, Twitter, Facebook, etc.

  • C++ is one of the every green programming languages and loved by millions of software developers. If you are a great C++ programmer then you will never sit without work and more importantly you will get highly paid for your work.

  • C++ is the most widely used programming languages in application and system programming. So you can choose your area of interest of software development.

  • Although much of the C++ projects on GitHub might not have been used for C++ development itself, C++ has a long history of being used to develop games and graphics-related programs. The Unreal Game Engine, which was used to develop many AAA title games, is known to have very powerful tools that will make your life easier. It is also particularly good for developing FPS games.

  • As a statically typed language, C++ is generally more performant than dynamically typed languages because the code is type-checked before it is executed. Java is gaining ground in terms of speed, but in the end, depending on how talented the C++ developer is, C++ can still be faster than Java. 

There are 1000s of good reasons to learn C++ Programming. But one thing for sure, to learn any programming language, not only C++, you just need to code, and code and finally code until you become an expert.

HELLO WORLD USING C++

C++ is a superset of C programming with additional implementation of object-oriented concepts.

#include<stdio.h> 
using namespace std;
int main()
{
cout << "Welcome to C++ World";
}

There are many C++ compilers available which you can use to compile and run the above mentioned program

  • Apple C++. Xcode
  • Bloodshed Dev-C++
  • Clang C++
  • Cygwin (GNU C++)
  • Mentor Graphic
  • Microsoft Visual C++
  • Oracle C++
  • HP C++

It is really impossible to give a complete list of all the available compilers. The C++ world is just too large and too much new is happening.

C++ Language Features

Some of the interesting features of C++ are:

  • Object-oriented: C++ is an object-oriented programming language. This means that the focus is on “objects” and manipulations around these objects. Information about how these manipulations work is abstracted out from the consumer of the object.
  • Rich library support: Through C++ Standard Template Library (STL) many functions are available that help in quickly writing code. For instance, there are standard libraries for various containers like sets, maps, hash tables, etc.
  • Speed: C++ is the preferred choice when the latency is a critical metric. The compilation, as well as the execution time of a C++ program, is much faster than most other general-purpose programming languages.
  • Compiled: A C++ code has to be first compiled into low-level code and then executed, unlike interpreted programming languages where no compilation is needed.
  • Pointer Support: C++ also supports pointers which are widely used in programming and are often not available in several programming languages.

APPLICATIONS OF C++ PROGRAMMING

As mentioned before, C++ is one of the most widely used programming languages. It has its presence in almost every area of software development. I’m going to list a few of them here:

  • Application Software Development – C++ programming has been used in developing almost all the major Operating Systems like Windows, Mac OSX, and Linux. Apart from the operating systems, the core part of many browsers like Mozilla Firefox and Chrome have been written using C++. C++ also has been used in developing the most popular database system called MySQL.

  • Programming Languages Development – C++ has been used extensively in developing new programming languages like C#, Java, JavaScript, Perl, UNIX’s C Shell, PHP and Python, and Verilog, etc.

  • Computation Programming – C++ is the best friend of scientists because of the fast speed and computational efficiencies.

  • Games Development – C++ is extremely fast which allows programmers to do procedural programming for CPU intensive functions and provides greater control over hardware, because of which it has been widely used in the development of gaming engines.

  • Embedded System – C++ is being heavily used in developing Medical and Engineering Applications like software for MRI machines, high-end CAD/CAM systems, etc.

  • Telephone Switches

    Because of the fact that it is one of the fastest programming languages, C++ is widely used in programming telephone switches, routers, and space probes.

  • Compilers

    The compilers of various programming languages use C and C++ as the backend programming language. This is because of the fact that both C and C++ are relatively lower-level languages and are closer to the hardware and therefore are the ideal choice for such compilation systems. These are a few uses and applications of the C++ programming language. Now, let’s know more about C++ advantages over other programming languages.

    Advantages of C++ Language

    C++ has the following 2 features that make it a preferred choice in most of the applications:

  • Speed: C++ is faster than most other programming languages and it provides excellent concurrency support. This makes it useful in those areas where performance is quite critical and the latency required is very low. Such requirements occur all the time in high-load servers such as web servers, application servers, database servers, etc. C++ plays a key role in such servers.
  • Closer to hardware: C++ is closer to hardware than most other programming languages like Python, etc. This makes it useful in those areas where the software is closely coupled with hardware and low-level support is required at the software level.

This list goes on, there are various areas where software developers are happily using C++ to provide great software. I highly recommend you to learn C++ and contribute great software to the community.