C, C++ and C# – A Reality Check
Posted On May 16, 2015 by Anish S filed under Enterprise
Dilip Gupta and Karan W
It is almost 45 years since Ken Thompson and Dennis Ritchie wrote a program that is said to be the first C compiler. Fifteen years from that date, in the year 1985 we saw the first commercial C++ compiler in the market place. And exactly 15 years from that date, we saw the advent of C#.
Five years hence, we take a look at where the three prominent ‘C’ languages stand. Well, we have missed out on Cobol another famous language that incidentally starts with C. But there seems to be a pattern that affects the fortunes of these three languages— C, C++, C#.
In this article we take a look at the state of the three languages that have inspired millions of developers that has captured the imagination of coders who have created some of the most amazing programs.
While proponents of each language will paint a future where every other language will disappear and his/her favorite language will be the most popular, it is important for us to look beyond the hype and try to understand where each language is positioned and what lies ahead of each of these languages.
For the moment we will ignore all the other languages and check these three ‘C’ languages.
Plain old C
If you consider all the commercial and non commercial applications available globally, and manage to browse through the code base of each application, you are likely to find more C code than any other language. Take for example Linux, average Linux distributions have on an average 71% of C code. 85% of all code contributed by Berkeley University is written in C.
There is so much of C code out there. And more importantly there is no application where C cannot be used. Applications written in C run faster than those written in any other language.
C still makes sense
1) Writing some parts of your code to run faster ( can be embedded and extended with many languages such as Perl, Python, Ruby)
2) Writing most system level applications
3) Most hardware related and embedded applications
In fact for sheer efficiency most software has a few lines of code in C.
A Reality check
ANSI and the ISO ratified the newest draft of the C standard in 1999 and unleashed the biggest changes to the language to date. New keywords, library functions, and macros are just the tip of the iceberg when it comes to the new improved C. In fact, the language is so different it is no longer compatible with C++. This article attempts to give an overview of the major changes made to the C language and also attempts to discover why no one yet seems to be affected by the new standard.
The C programming language began to be standardized some time around 1985 by the ANSI X3J9 committee. Several years of effort went by, and in 1989 ANSI approved the new standard. An ISO committee ratified it a year later in 1990 after adding an amendment dealing with internationalization issues. The 1989 C standard is known officially as ANSI/ISO 9899-1989, Programming Languages - C, and this document refers to the 1989 C standard as C89. The 1990 ISO revision of the standard is known officially as ISO/IEC 9899-1990, Programming Languages - C, which is referred to in this document as "C90".
The next version of the C standard was ratified by ISO in 1999. Officially know as ISO/IEC 9899-1999, Programming Languages - C, it is referred to in this document as "C99".
The C++ programming language was based on the C programming language as it existed shortly after the ANSI C standardization effort had begun. Around 1995 an ISO committee was formed to standardize C++, and the new standard was ratified in 1998, which is officially known as ISO/IEC 14882-1998, Programming Languages - C++. It is referred to in this document as "C++98" or simply as "C++".
Though the two languages share a common heritage, and though the designers involved in the standardization processes for each language tried to keep them as compatible as possible, some incompatibilities unavoidably arose. Once the programmer is aware of these potential problem spots, they are easy, for the most part, to avoid when writing C code. Due to popularity of GC compiler for writing C code, most vendors have stayed away from commercial C compiler markets. Instead they have focused on the more lucrative C++ and Java IDEs.
The future of C
There is little doubt that C will survive and will be around for a long time. There is no solution to replace the huge chunks of code in applications today. And these code base need to be maintained.
Since C++ is the object oriented version of C, it is likely that more projects will be written in C++. The threat from Java is very real. The presence and growth of languages like Perl, PHP and Python presents a threat and opportunity. With faster computers writing even mission critical applications in these languages is no more a risk. At the same time C is used to extend these languages.
Two decades of C++
C++ was in many ways almost killed by Java. Once up on a time 76% of developers were writing code in C++ and was coming to terms with this language, which was at best an updated version of C. However Microsoft and Borland backed the language during the nineties and the language was used once upon a time to build almost all the products from Microsoft.
The advent of Java saw tremendous amount of C++ bashing. It became a fashion to ridicule the many warts and predicaments surrounding C++. In fact during the heights of the Dot Net Boom, many C++ conferences which used to run to packed audiences where cancelled.
Suddenly C++ became a language that was disliked by many. However in the past couple of years, the interest in C++ has returned as reality struck many developers. We will sketch the return of C++ and where it is positioned in the new world where it is challenged by C# in the next article.
History of C/C++