Saturday, 15 November 2014

D language

I've studied D language. It's a kind of evolution from C++ as it says. The syntax is familiar to C++ programmer, but there are differences, some of them quite confusing (class vs. struct, immutable vs. const).

With long experience from programming I can clearly see where D is coming from. It's funny, but in a way D is a result of "bad" features of C and C++, yet I think it's wrong to focus only on those bad features. C++ is just doing things that way. Even C++ developers are breaking in constant pressure to become a "modern" language. Well, I guess those new features can't hurt.

Some features in D are nice as you would expect while others are less useful. For example assert seems to be a strong feature in D, but something I would never use myself. Not in C++ or D. Unit testing is also a waste of time in my opinion. D even has a unittest scope for that purpose. What I found nice is that D has built-in array slicing and easy to use string operations. D doesn't have header files which is one of the ancient structures in C++. It was also easy to start using D, because Code::Blocks has support for it, you only have to download the D compiler and point it to C::B.

I was thinking of programming a utility program with D, but it might be interesting to write a small roguelike just to see how different it is to maintain that kind of project compared to C++.

No comments: