Hacker News new | past | comments | ask | show | jobs | submit login
A review of the D language by someone who has worked in it (timburrell.net)
26 points by sah on June 23, 2008 | hide | past | favorite | 9 comments



I've also used D for various tiny scale projects over the last year and have found the documentation wanting - D ain't Robinson Crusoe here though.

Once you get past the Tango/Phobos dilemma, you'll find a great little language if you put some effort into it.


Returning value types by value (structures) is a compiler bug? C++ and D both try to be binary-compatible with C, they MUST return a structure by copying it. An excellent article, but this little example was weird.

I haven't done any serious development in D, but I absolutely agree with his complaints about Walter's leadership, he needs to loosen up a little and let it go: I haven't checked if he changed his mind, but it used to be a case where you couldn't just host binaries of D compiler on your site, they had to be downloaded from Digital Mars page in a form of two confusing ZIP files with two intersecting directory trees.


"C++ and D both try to be binary-compatible with C, they MUST return a structure by copying it."

Only for code that has C linkage. For normal C++ or D code the calling convention can be whatever the compiler wants, it's not restricted by the C calling convention.

(C linkage is specified in C++ with 'extern "C"', and with 'extern (C)' in D.)


I'd like to hear from D practitioners, what the real benefit they experienced by coding in D. Couldn't I just use related subset of C++ or C# to achieve the very similar effect?


You can probably achieve similar effects in c++ some way, as well as you could with any system programming language. The point is how fast those can be achieved.

For example c++ is very hard to parse, that does not make implementing tools impossible, but it's slowing down the process enormously.

Btw. I'm still mostly a c++ programmer, but D is one of the languages I'm watching really close.


No. C++ is too obtuse and doesn't have many of the features of D. C# is not a systems programming language (it runs in a sandboxed VM).


Too obtuse? I worked in C++ several years professionally, and didn't have that feeling. I was able to code anything I wanted.

I consider myself an average programmer, and from my experience it takes at least one year to understand C++ to reach the level of being proficient in it. I was asking my question above since in many cases, I found that the critique of C++ comes from people who didn't put enough effort to understand it thoroughly. (but I am not talking about anyone here, it's just a general observation of mine).


- What is the destruction order of virtual base classes in C++?

- Write a noncopyable class template that takes one typename argument.

These aren't just trivia questions. You actually need to know this stuff to be able to plan and design correct C++ code.

FWIW, I'm a recovering C++ Language Lawyer[1], and I still consider myself to have an "expert" level of proficiency at C++. The problem with C++ is that you need to be an "expert" or you'll make subtle and complicated errors. Errors that may not show up later until you have some sort of interoperability problem. Yes, you can write great code in C++, but it shouldn't be as hard and complicated as C++ makes it. Tools should help, not hinder.

1. http://www.catb.org/jargon/html/L/language-lawyer.html


Too obtuse?

C++ can be used for systems programming, so I don't think there's any good argument that it's not a sharp enough tool. I agree that "obtuse" is a poor criticism.

[...] from my experience it takes at least one year to understand C++ to reach the level of being proficient in it. [...] I found that the critique of C++ comes from people who didn't put enough effort to understand it thoroughly.

But this is a much better one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: