The Artima Developer Community
Sponsored Link

Heron-Centric: Ruminations of a Language Designer
C++ Preconceptions
by Christopher Diggins
March 7, 2005
Summary
A lot of programmers have preconceptions about C++, and very fixed ideas about what can and should be done with it. I plan on shaking this up a bit with an upcoming column called Agile C++, as well as through my work on the Object Oriented Template Library.

Advertisement

At the behest of one of my colleagues, I wanted to outline my short and long term plans with regards to the OOTL (Object Oriented Template Library), and an upcoming column on C++ called Agile C++.

It seems that almost every programmer has a set of opinions on C++, and on what can and should be done with it. Most of it is superstitious nonsense. This is almost as true for experienced C++ programmers as for people who have never tried using the language at all. It is my goal to shatter some of the misconceptions.

People unfamiliar with C++ get the impression that it has to be obfuscated but that is an entirely artificial problem, which I think is mainly due to teachings by popular C++ gurus. I commonly see many problems with C++ code: overuse of the generic programming at the highest level of abstraction, avoidance of traditional OOP techniques, designs which do not reflect the problem domain, insufficient use of abstraction, designs which are too loosely coupled, and the list goes on. You can write C++ which is as clean and elegant as Java.

Many inexperienced programmers say things like you can't do functional programming in C++. I plan on completely destroying this particular myth, by releasing a very powerful functional programming language which is entirely a subset of C++. I've already written a prototype for the language, called Unimperative, which I plan on re-releasing sometime this month.

Another misconception is that C++ is not good for high-level programming. When people use a language like Python, they see it has built-in lists of untyped objects and are impressed with how powerful that is. The fact is that with the right library (a future release of the OOTL. for instance) you can have the same type in C++ with precisely the same semantics and almost identical syntax. This is true for many types and features found in all of the so-called "high-level" languages.

This appears to even be a popular preconception of experienced C++ programmers. Many professional C++ programmers resort to using other languages like Python/Ruby/Perl/etc. to do simple tasks rather than writing small programs in C++. This seems to be primarily due to the fact that there are tradtionally no good high-level libraries in C++, and for some reason C++ programmers always require their C++ code to be maximally efficient, whereas their expectations are considerably loosenesed when using another language. I think this is a quirk of programmer psychology.

I guess the theme is pretty obvious here, C++ has the potential to make an excellent high-level programming language and over the next while (until I get Heron stable enough for my full-time C++ replacement language) I plan on showing techniques, and writing libraries for more rapidly producing easy to understand, debug and maintain C++ programs.

Talk Back!

Have an opinion? Readers have already posted 7 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Christopher Diggins adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.

This weblog entry is Copyright © 2005 Christopher Diggins. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us