TechnoparkToday.com > C/C++ programming model and it’s execution model is one of the most versatile model invented till date. The pointer arithmetic, dynamic memory management,register level access,deterministic memory management etc. have been mapped to Micro-controllers to Mainframes.No other high level language can claim such a pedigree. Some might argue that C subset of C++ is responsible for that. For the sake of discussion, let us treat C/C++ as C++
Being designed between 1979 and 1994, language carries the culture of those times. In those times, bulk of the activity was to write libraries,system software, operating systems, compilers, CAD programs, Engineering visualization etc. The constructs necessary for those systems and small footprint of memory became the primary concerns of the language designers. .
Even though the language had higher level constructs like Object Oriented Programming, Generic programming, Standard Template Library etc, the language was not higher as most Application developers would want it. They need to focus on writing business logic rather than to worry about compilation hacks, memory management, system calls, operating system specific code. For moist of the Business application developers, C++ did not offer anything in those times.
Emergence of Xbase (Dbase/Clipper/Foxpro) platform with excellent interface to C programming language ruled the roost in the MS DOS world as an alternative to C/C++. In the Unix world, things were hacked by programmers or expensive tools were available.
Some of the business logic got written using C/C++ because there were no alternatives. Thus C++ became preferred language for writing CGI applications, writing Embedded SQL applications ( using Pro* C and other pre-compilers), Batch processes, Console and Desktop Business software etc.
When GUI components made it’s debut, Xbase moved out and tools like Visual Basic, Delphi, PowerBuilder,Oracle forms etc. became the mainstream of Application development. Barring Delphi, none of them could match C++ in negotiating territories of Run time, OS version, memory models, portability etc.
Delphi would have been a match to C++, unfortunately, Learning Object Pascal and Learning C++ has roughly the same effort. So, people who cannot learn Pascal or C++ stayed back with Powerbuilder, Visual Basic and Oracle forms.
Once again C++ became the most popular language because of the lack of alternatives or alternatives did not become popular. People were learning to write Object Oriented Programs, Windows Programming/X-Windows Programming, 32 bit bit programs in those days.
Following problems were noted
C++ Objects can only be re-used at the source level
C++ Objects produced by two compilers did not agree on semantics
C++ Objects cannot be consumed by other languages directly
C++ do not have Dynamic Loading of Arbitrary classes
C++ lack meta data facility to support Dynamic loading
Memory management is error prone because of rampant Aliasing
No explicit support for Interface based programming
To solve a language problem, Microsoft and OMG brought two technology solutions. COM/DCOM from Microsoft and CORBA from OMG were proposed as a solution to C++ Object anomalies. DCOM and CORBA has got bindings for all popular programming languages. These technologies gave Object inter-operability between languages (language neutral IDL), support for interface, Dynamic Invocation (IDisptach in COM and Dynamic invocation Interface in CORBA), Platform interoperability ( ORPC and IIOP), good memory management semantics etc.
Then, a political battle started, Are you in the COM camp or CORBA camp? The battle were raging.Among this cacophony, Java was introduced by Sun Micro systems.
By 1999, Java had support at the language level for
Interface based programming
Reflection API for meta data management
Dynamic invocation
Garbage collection
Suddenly, Java became C++ + COM on stereroids or C++ + CORBA on steroids. That means, the technology solutions like DCOM/CORBA became redundant as a programming language supported all of these features. In that process, Java gained the moniker of “Internet time C++”. Then, there was no look back.
Microsoft did play with their COM Programming model a bit longer and finally threw in the towel by creating their own version of “Java” ( C#) and a platform to emulate JVM (.NET) . This showed C++ it’s chosen position.
Popularity of PHP and Python ( a higher level C++!) along with the popularity of JVM/.NET practically made it irrelevant for Enterprise Application Development arena.
C++ has only lost it’s prominence in Enterprise Application Development. There is still a living to be made writing Compilers,Virtual Machines, Engineering Visualization Software, Computer Games, Device Drivers, Middle Wares, Database Engine, Cross Plaform code, Embedded Systems etc.
Jesus Christ has got more probability to resurrect in real life than a resurrection of C++ in the Enterprise world.. It is a fact and reconciliation to this fact is the only way to get out of delusion of superiority of C++. C++ is superior only in certain contexts. Choose the language and tools for the context.
An excellent article with lot of insights and information.
Good read. c plus plus programmers are not a breed awaiting the extinction. but modern languages are having its own purpose and need in the industry
This article discourages peoples from learning C++… In fact I am working in C++ for last 6 years.. I worked with AMD, Airbus and Microsoft..80% of the projects in these companies are in C,C++…Same goes with Google,Yahoo,NetFlix,EA,Goldman Sachs etc…All semiconductor ( like Qualcomm, Intel) and Core Telecom ( Cisco,Nokia) works on C,C++….All these companies are high payers … Only low paying enterprise/Banking/GUI developer working on JAVA and other new gen languages…
Dileep – I am not explicitly trying to dissuade people from learning or doing C++. The article is aimed at people who cannot come out of their (average/mediocre) C/C++ past, yet not comfortable with Enterprise Computing. To be a C++ developer, one needs to spend quite a while and If you are smart enough to do that, go for it. But, majority of the people whom I have come across cannot do C++ really well. They might be writing code using the C subset of C++. Very few write using Idiomatic C++.
As you age, C++ is vulnerable to law of diminishing returns. There is a world outside Technology and so called people with low paying jobs (Enterprise Java/.NET) are in a better position to exploit that. C++ programmers are too much obsessed with their language which is some kind of intellectual “jugglery”.
Learn C++ ( I have done well in the past, still a ardent student of the language for intellectual curiosity) to understand some advanced concepts. Btw, companies whom you are referring to are just execptional companies. As I used say, “Exceptions are never Good Examples”.
C++ developers are not sticking to it just becoz they are reluctant to learn new things…c++ is been used for mission critical applications like Aerospace, defence, Sub sea optical networks etc…. The new languages are not been certified by Authorized agencies to use in these kind of products ….
Also all major Operating Systems ( Linux, Mac and Windows) completely built on C,C++…. IOS sdk is in Objective C …All iphone developers are working on it,,
I agree that there is a deficiency of quality c++ prgrammers…. That makes the differentiating factor for c++ guys and they are paid well..!
C++ is the best language, but not everyone can program in it, for that you have to have good understanding about computing and object orientation concepts. but when we say c++ most people think like its the same BALAGURUSWAMY book they studied for their engineering clasess. but the actual industrial c++ is far different from the balaguruswamy kind of c++.
still many of the leading platforms, and tools or software is written in c/c++ language, including the operaing systems, photoshop or any other adboe products, many of the modern programming languages and their IDEs and made in c/c++ languages.
Java is just a second grade language for less competent people. first quality people will always go with c/c++.
well said….all leading operating systems built on c++ code base line… Java is only good for webapps/GUI apps….Java rely on its compilers Memory management and it lead to trouble in embedded systems.
If Java or C# is good , then y don’t game developers write code using them..So that same game can be run on PC, Xbox and PSP…..in that case Game companies dont ve to spend million dollars on porting their code to different platforms….
Answer is Java /C# is not an Orginal or Native language…
Dileep – I have not said C/C++ is not useful. C++ was projected as a Application development language by Microsoft in the 90s and deserted it for C#. People who wanted to move to the Internet economy rightly deserted the language as well.
With the advent of better programming models, C++ looks like an arcane language stuck in it’s machine centric past. At least, in Enterprise computing, for the user code, C++ is practically dead
Sharan – Why you say that Java is a second class language? Java 8,Scala and Groovy is a very good combination to work with most of the Enterprise system. I feel, C# is the best programming language out there ( it can inteface with C/C++ through P/Invoke and Com Interop) as it has got support for all programming paradigms you can think of.
Even C++ 11, is inspired by some features of C#, as Herb Sutter is working for Microsoft.