C++ Programming Map in your brain
Introduction to C++ Programming Language
Some of the features & key-points to note about the programming language are as follows:
- Simple: It is a simple language in the sense that programs can be broken down into logical units and parts, has a rich library support and a variety of data-types.
- Machine Independent but Platform Dependent: A C++ executable is not platform-independent (compiled programs on Linux won’t run on Windows), however they are machine independent.
- Mid-level language: It is a mid-level language as we can do both systems-programming (drivers, kernels, networking etc.) and build large-scale user applications (Media Players, Photoshop, Game Engines etc.)
- Rich library support: Has a rich library support (Both standard ~ built-in data structures, algorithms etc.) as well 3rd party libraries (e.g. Boost libraries) for fast and rapid development.
- Speed of execution: C++ programs excel in execution speed. Since, it is a compiled language, and also hugely procedural. Newer languages have extra in-built default features such as garbage collection, dynamic typing etc. which slow the execution of the program overall. Since there is no additional processing overhead like this in C++, it is blazing fast.
- Pointer and direct Memory-Access: C++ provides pointer support which aids users to directly manipulate storage address. This helps in doing low-level programming (where one might need to have explicit control on the storage of variables).
- Object-Oriented: One of the strongest points of the language which sets it apart from C. Object-Oriented support helps C++ to make maintainable and extensible programs. i.e. Large-scale applications can be built. Procedural code becomes difficult to maintain as code-size grows.
- Compiled Language: C++ is a compiled language, contributing to its speed.
Applications of C++:
C++ finds varied usage in applications such as:
- Operating Systems & Systems Programming. e.g. Linux-based OS (Ubuntu etc.)
- Browsers (Chrome & Firefox)
- Graphics & Game engines (Photoshop, Blender, Unreal-Engine)
- Database Engines (MySQL, MongoDB, Redis etc.)
- Cloud/Distributed Systems
Some interesting facts about C++:
Here are some awesome facts about C++ that may interest you:
- The name of C++ signifies the evolutionary nature of the changes from C. “++” is the C increment operator.
- C++ is one of the predominant languages for the development of all kind of technical and commercial software.
- C++ introduces Object-Oriented Programming, not present in C. Like other things, C++ supports the four primary features of OOP: encapsulation, polymorphism, abstraction, and inheritance.
- C++ got the OOP features from Simula67 Programming language.
- A function is a minimum requirement for a C++ program to run.(at least main() function).
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 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.
It is one of the most important programming languages because almost all the programs/systems that you use have some or the other part of the code base that is written in C/C++. Be it Windows, be it the photo editing software, be it your favorite game, be it your web browser, C++ plays an integral role in almost all applications that we use.
Uses/Applications of C++ Language
After exploring C++ features, let's have look at some interesting areas where C++ is popularly used.
Operating Systems
Be it Microsoft Windows or Mac OSX or Linux - all of them are programmed in C++. C/C++ is the backbone of all the well-known operating systems owing to the fact that it is a strongly typed and a fast programming language which makes it an ideal choice for developing an operating system. Moreover, C is quite close to the assembly language which further helps in writing low-level operating system modules.
Browsers
The rendering engines of various web browsers are programmed in C++ simply because if the speed that it offers. The rendering engines require faster execution to make sure that users don’t have to wait for the content to come up on the screen. As a result, such low-latency systems employ C++ as the programming language.
Libraries
Many high-level libraries use C++ as the core programming language. For instance, several Machine Learning libraries use C++ in the backend because of its speed. Tensorflow, one of the most widely used Machine Learning libraries uses C++ as the backend programming language. Such libraries required high-performance computations because they involve multiplications of huge matrices for the purpose of training Machine Learning models. As a result, performance becomes critical. C++ comes to the rescue in such libraries.
Graphics
All graphics applications require fast rendering and just like the case of web browsers, here also C++ helps in reducing the latency. Software that employ computer vision, digital image processing, high-end graphical processing - they all use C++ as the backend programming language. Even the popular games that are heavy on graphics use C++ as the primary programming language. The speed that C++ offers in such situations helps the developers in expanding the target audience because an optimized application can run even on low-end devices that do not have high computation power available.
Banking Applications
One of the most popularly used core-banking system - Infosys Finacle uses C++ as one of the backend programming languages. Banking applications process millions of transactions on a daily basis and require high concurrency and low latency support. C++ automatically becomes the preferred choice in such applications owing to its speed and multithreading support that is made available through various Standard Template Libraries that come as a part of the C++ programming kit.
Cloud/Distributed Systems
Large organizations that develop cloud storage systems and other distributed systems also use C++ because it connects very well with the hardware and is compatible with a lot of machines. Cloud storage systems use scalable file-systems that work close to the hardware. C++ becomes a preferred choice in such situations because it is close to the hardware and also the multithreading libraries in C++ provide high concurrency and load tolerance which is very much needed in such scenarios.
Databases
Postgres and MySQL - two of the most widely used databases are written in C++ and C, the precursor to C++. These databases are used in almost all of the well-known applications that we all use in our day to day life - Quora, YouTube, etc.
Embedded Systems
Various embedded systems like medical machines, smartwatches, etc. use C++ as the primary programming language because of the fact that C++ is closer to the hardware level as compared to other high-level programming languages.
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 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.
Comments
Post a Comment