Wednesday, 30 April 2008

Enough of C++ !

I used to like C++ a lot but the more I use this language the less I like it.

I think I really definitively made up my opinion about this language when I started to look at the boost libraries.
First I though all those crazy meta programing stuffs were genius (and indeed the boost libraries are an impressive piece of work), but then I realize that if C++ didn't have so much drawback, the boost code would be quite simple.

All the boost libraries do is find tricky ways to do things that C++ hasn't been made for in the first place.

For me it is a clear sign that C++ is going nowhere. And the new C++0x doesn't look so good to me. They make the language very complicated, I wonder if people are actually going to learn all the new things they add to the language. Yet one of the most important feature (garbage collector) is still not planed.

I am getting very interested by the D language, I even made a small video game in D.
At first sight D looks similar to C++, cause it has the same syntax (I would have preferred a python like syntax though), but it corrects all the things that made me not want to write C++ again :
  • a garbage collector (you can disable it if you want more control on memory)
  • a foreach loop
  • dynamic arrays part of the core language
  • automatic type deduction (like "auto x = 10")
  • simpler and more powerful template system.
Well, and many other good stuffs.

So far the language is still new, and unfortunately not so many libraries have been created for it, but for me D may well be the future of compiled language.

No comments: