Introduction to my "Learning C++" series - C++ a Better C

History of C++

 The C++ programming language has a history going back to 1979, when Bjarne Stroustrup was doing work for his Ph.D. thesis. One of the languages Stroustrup had the opportunity to work with was a language called Simula, which as the name implies is a language primarily designed for simulations. The Simula 67 language - which was the variant that Stroustrup worked with - is regarded as the first language to support the object-oriented programming paradigm. Stroustrup found that this paradigm was very useful for software development, however the Simula language was far too slow for practical use.

Shortly thereafter, he began work on "C with Classes", which as the name implies was meant to be a superset of the C language. His goal was to add object-oriented programming into the C language, which was and still is a language well-respected for its portability without sacrificing speed or low-level functionality. His language included classes, basic inheritence, inlining, default function arguments, and strong type checking in addition to all the features of the C language.

The first C with Classes compiler was called Cfront, which was derived from a C compiler called CPre. It was a program designed to translate C with Classes code to ordinary C. A rather interesting point worth noting is that Cfront was written mostly in C with Classes, making it a self-hosting compiler (a compiler that can compile itself). Cfront would later be abandoned in 1993 after it became difficult to integrate new features into it, namely C++ exceptions. Nonetheless, Cfront made a huge impact on the implementations of future compilers and on the Unix operating system.

In 1983, the name of the language was changed from C with Classes to C++. The ++ operator in the C language is an operator for incrementing a variable, which gives some insight into how Stroustrup regarded the language. Many new features were added around this time, the most notable of which are virtual functions, function overloading, references with the & symbol, the const keyword, and single-line comments using two forward slashes (which is a feature taken from the language BCPL). 

Why learn C++?

 Scalability

C++'s greatest strength is how scalable it could be, so apps that are very resource intensive are usually built with it. Graphics require a lot of resource, which is why the most beautiful 3D games you happily feast your eyes on are often built with C++.

Fast

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.

Control

As mentioned before, since you have a lot of control over how your app uses resources, your app can take up very little resource. All in all, since C++ can be very performant in the right hands, enterprises often use C++ to code functions that have a critical reliance on speed and resource usage.

Not Easy to Maintain

C++ needs a lot of code, which means you need a large team to scale a C++ app, and from a time and financial investment point of view, C++ not easy to scale. Also, since you have to do a lot of things manually with C++, it's easy for less experienced or less skilled developers to introduce errors into the code base. Java was developed because so many professional developers were making mistakes, so in terms of talent-recruiting, a very skilled and experienced C++ developer may be hard to find and also expensive to afford, which is why C++ is not so scalable.Of course, if your goal is to build a game using a game engine, this may still be a problem but less critical. 

Career opportunities

 

If you want to develop mainstream games, chances are you'd need to use C++. Many mobile best-seller games were built with Cocos2d-x, which is a free, open-sourced and cross-platform game engine. Cocos2d-x games are developed with C++, though Cocos2d also supports other languages now. However, as the support for other languages is a relatively recent addition, you'd likely find better documentation for Cocos2d-x.

Furthermore, large companies such as Facebook also may need C++ developers to help optimize their apps or work on their products.
 

Beginner Friendliness

Very Complex

Since C++ is rather lower level, the language is huge and you will need to handle a lot of complex things such as memory management and more. You also need to write a lot of code before you can get a working prototype if you're planning on building an app from scratch. Since it will be difficult to grasp how all features in C++ works, you can easily shoot yourself in the foot.As such, since it's easy for a coding beginner to go astray when learning C++, we strongly recommend learning C++ with a mentor. In addition, C++ has a longer history with game development in general, so there are a lot of proven good practices a C++ mentor from the gaming community can teach you. 




If you're new to computer science I recommend you to learn Python first!

https://steemit.com/programming/@pentest1002/learning-python-part-1-familiarise-yourself-with-the-python-console-and-write-your-first-python-program






Coin Marketplace

STEEM 0.23
TRX 0.26
JST 0.040
BTC 98004.63
ETH 3487.60
USDT 1.00
SBD 3.26