Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Not Much to 'C' in C#

Danny Kalev, DevX's C++ Pro, says Microsoft's newest language lacks the maturity to be a real competitor to C++




Application Security Testing: An Integral Part of DevOps

# is getting a lot of attention these days—so much attention that some DevX readers have begun to remonstrate on what they consider excessive coverage, especially for a language that is still in its beta stage. I can agree with some of the points raised. Personally, I find C# (at least in its current shape) disappointing, technically crippled, and extremely over-hyped. Secondly, the software industry has already heard the "greet the perfect languages that will change the world" slogan one time too many. However, I don't believe that C# is utterly irrelevant.

The Original Sin
On the one hand, C# is a Windows-only language. Its focus seems to be on graphics and Windows specific programming tasks, which make it less useful in other application domains—say embedded systems, infrastructures, and numeric applications. In addition, C# is a proprietary language whose evolution is steered by a commercial company. If judged from our experience with Java in the 1990s and Ada in the 1980s, this is a recipe for an immature and pretentious language. Sun's bias toward SPARC/Unix affected Java's design in many subtle ways, to the chagrin of Windows users.

Worse yet, recent legal actions against Microsoft pushed it to jettison Java altogether. Thus, Sun's arrogant and aggressive policy yielded a Pyrrhic victory. Instead of enabling some flexibility and leeway—which are inevitable when dealing with a general-purpose programming language—it decided to twist Microsoft's arms. This has turned out to be a huge mistake. Once you try to dictate a language's evolution by lawyers and injunctions, you lose the programmers. And what's a language without programmers?

Why Bother?
C# is of interest to C++ programmers not because of its engineering merits (or lack thereof) but for other reasons. Although you'll never hear it from Microsoft, C# is meant to serve as an alternative to Java on Windows. Secondly, my prediction is that C# will turn into a superset of C++. It will support standard C++ syntax, libraries, and concepts, in addition to its proprietary APIs and keywords. Finally, even if you're not going to use C# any time soon, you don't want to miss a rare opportunity to observe and take part in the fascinating process of a language evolution. Will past mistakes be repeated, or will the C# designers learn from history?

What History Can Teach Us
The formation of a programming language is a very long and tedious process. A full 10 years after the creation of C, its standardization process began. It took an additional five years to complete the C ANSI standard. The C++ standardization process wasn't much different; the language was christened C++ in 1983. Six years later, its standardization process began, and that lasted nine years (1989-1998). Why do standardization processes take so long? From my acquaintance with both the C and C++ standardization committees, I can assure you that it's not due to laziness or procrastination—quite the contrary.

While it's easy to define a rash, half-baked standard, such a standard is doomed to be completely ignored (the OSI model of communication protocols is a good example of this). The C and C++ committees were well aware of this. They wanted to ensure that the standards they were forming would last for years, and that it would serve as the basis for all future implementations. Since a good standard is based on proven practice and real world experience, it can be created only after the language has been used for several years in real world projects by a large number of users. C# is now at this evaluation stage.

Maturity Has Merit
In terms of engineering merits, C# fails to impress me. On the positive side, it supports operator overloading and thus has avoided the rash and unfortunate decision made by Java creators, who removed this feature only to learn the hard way that it was indispensable. C# permits C-style structs and raw pointers. This is a well-boding sign, showing that its designers are free from "if it's not pure object-oriented, we won't allow it" egotism. Still, C# designers have made several gaffes, such as removing template support. Considering the tremendous benefits of STL and generic programming in general, this decision seems questionable. Does anyone miss the horrid MFC container classes?

Of course, much of the antagonism toward C# can be attributed to an anti-Microsoft atmosphere. Others simply are reluctant to learn a new programming language, fearing their existing C++ skills and experience might become obsolete. This fear is unfounded. C++ is still the only mature, stable, non-proprietary, multi-paradigm, general purpose programming language around. At the moment, I don't see any other serious competitor to it.

Will C# ever become a serious language, other than simply a quick replacement for Java? Only time will tell.

Danny Kalev is the C++ Pro for DevX.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date