The D Programming Language Is Not For Me
Today at Øredev 2008, I learned about the programming language D, but also that D is not for me.
I had not had the chance yet, to sit down and take a look at D, so I thought it would be a nice idea for me to attend the session named “What Makes a Programming Language Productive?” by Walter Bright, one of the people behind D. So I had completely no knowledge of D before I entered the session.
Now, the conference material did not mention anything about D being a systems programming language, something I kind of found out half-way through the session. And now I also understand why the language designers thought they had done some great things with stuff like automatic memory management and garbage collection, no pre-processor, automatic documentation generation from comments in the source, type inference, etc…
But, being an application developer myself, working with languages like Java and C# in addition to easy access to dynamic languages on the VM, not many of the constructs seem new or that special to me. But I guess they will be for C and C++ programmers doing systems programming.
But this is not the only thing that I find not to be for me.
The D language is said to support multi-paradigm programming. What this means is, that you can write imperative code in the old C-style, object-oriented code, inline assembler, template meta-programming and soon also functional programming in the same language – namely D.
Walter said this to be an advange. If for example, you wanted to express a part of your program in another paradigm, you would not have to learn a new language and interface with that from your D program. True, I guess, to some extent, at least about the integration part. But these are completely different paradigms. Learning to program in a functional language aint that much about syntax, but very much about understanding problem solving in the functional paradigm. Likewise in an imperative or object-oriented paradigm.
But D tries to express multiple paradigms in D alone. That way you won’t have to switch programming language, to express something in another paradigm. I would really think that another design goal of D: “Have a short learning curve for programmers comfortable with programming in C or C++” would go against its goal of being multi-paradigm.
How can one syntax support all those paradigms in a nice and concise manner?
How can the semantics of interoperating code between several paradigms be done simple enough, for it to be understandable and usable?
November 19, 2008
·
polesen ·
11 Comments
Tags: D · Posted in: Programming

11 Responses
> How can one syntax support all those
> paradigms in a nice and concise manner?
I don’t have a single idea. And I either don’t know why people always try to reinvent the wheel. Why not just improve the existing? – And by this I do not think there is sooo much space for a program language to improve in the kernel. I don’t think that completely new ways to address software development can heal the developer’s wounds. Not everything new is necessarily better (often the opposite is the case – those things are just alpha things).
To talk about the wounds: They are at completely other locations – e.g. poor standard libraries or missing important methods in the standard libraries (don’t understand why .NET only accepts one character in the split method – so what if I have a string separated by two filter characters for instance).
Or another wound is GUI design which is always a lot of work and many IDEs do lack here. – Yeah, talking about the IDEs – a good IDE is very important for the efficiency in the software development process. Many languages lack of good IDEs. I have compared many languages searching for the one to use with the first priority of being very efficient and the second of interoperability with other languages and systems.
And there are several new ways – e.g. the aspect oriented programming where the big benefit is in doubt from my point of view.
When I look back the last 15 years it is very clear for me that the quality of the IDE, the efficiency of GUI building and the amount of existing good quality libraries (core libraries, self created during the years and 3rd party) are the major keys to efficient software development that customers are willing to pay.
So if you have to indent blocks or write brackets, if you write object oriented or functional does not make the real difference – you get used to the particular syntax after a few weeks of intensive use.
I have to admit to be a long time fan of D, but coming from Java and/or C# you apparently have limited experience to understand the benefits of a multi-paradigm language.
If you think D covers little more than what Java can offer (ignoring JVM/GC), then you haven’t got a true impression of D at all. C# is a much more similar language in that regard.
As pure languages go (ignoring available libraries and tools this time), I would take D over Java for _any_ type of development.
There are reasons to not use D if you don’t have time to get into it, or maybe contribute, but you appear to have no knowledge whatsoever to make a qualified statement about D.
I agree that the fundamental problem with D is the whole “everything and the kitchen sink” attitude. I’m worried that C# is headed in that direction as well.
I like the idea of separate languages that can share the same class library and can be easily linked together much better.
Take a look at Oz; it adds even more paradigms.
You only ask if it’s possible to do–you didn’t say D didn’t or couldn’t do it. Personally I think it does a pretty good job–and you never really enumerated *why* D isn’t for you. It’s just as suitable for applications as it is for systems programming.
The point of D is not so much to make C/C++ programmers learn how to write in other paradigms, as it is to allow people who are used to other paradigms to use the same language for several things.
In other words: If you know C/C++ and want to learn functional programming, go pick up Haskell, Scheme or whatever functional language you want.
If you’re a programmer who already knows several paradigms, use D and you can program imperatively when that’s the best solution, functional if that’s better, and so on.
D is unrestricted Java. There are some things i don’t like in the language, but its still much better than C++. The problem with D is that it has no good and free IDE (like there are for Java), and that the compiler optimizes poorly (worse than most C++ compilers). I was looking at some functional languages, but the inability to mix with procedural code was exactly the reason i didn’t went further into them. Functional programming in D would be a welcome feature for me.
> There are reasons to not use D if you don’t
> have time to get into it, or maybe
> contribute,
> but you appear to have no knowledge
> whatsoever to make a qualified statement
> about D.
Yes, I didn’t look at D so far, that is true. But I learned more than 10 programming languages in more than 20 years. I am simply tired of starting from fresh again and again taking months until you can get really productive. And I am even more tired of being the beta tester of another thing that is outdated when the first stable release is out.
And I evaluated different languages for months before deciding to go with Java for new projects. Not really got into action should I learn D now? What next? E? – My boss wanted me to learn C#. When I have choosen Java he told me that it is also ok – none of the two is an error because both have big market. If I now tell him I want to learn D he will be angry because he already wants to see results for the market.
I had also spent about half a day getting an idea of aspect oriented programming. Didn’t really understand some basic example and finally I didn’t either found out what that real benefit is. Maybe I am putting here too many things into the same drawer, but the point is: The customer doesn’t care about that. He wants working and stable software that is cheap. Hence IDE and libraries are much more important than
I think effort should go more into creating useful libraries for existing languages.
I have no doubt, that new languages with more features could evolve and maybe there will remain only a hand full of developers in the world understanding them completely. I do not assume that C#, Java, C++ or whatever is born to be the best programming language ever. But: Who cares? – If I tell a customer Java is the perfect language he will believe – same applies for C++. What matters is the results and the time that is needed to get there. – And also there are developers needed who understand the language and the code. Hence a programming language should also be kept simple so more developers can understand.
Multi-paradigm programming seems to be well designed in the Scala language (http://www.scala-lang.org/) .. although the developers definitely play favourites with functional programming. The fact that it sits on top of the JVM (and another port on top of the CLR) and interoperates nicely with the entire suite of existing Java/CLR libraries gives it an instant advantage. The newly released book Programming in Scala does a much better job of explaining the language than the various tutorials, I find.
I quite like D, but my major disappointment is the closed source 32-bit only compiler of Walter’s, and the slow development pace of the open alternatives. I think the language is great, and it’s certainly improving.. I’d choose it over C++ any day. Right now I’m waiting for the public releases to just “work” with both Phobos and Tango (competing base libraries, but historical conflicts) and some bugs in Tango to be worked out. The development tools for the majority are definitely lacking at this point, but they’ll get there, slowly but surely.
I can’t seem to get your RSS feed to work with my program. Do you mind telling me the url so I can read your posts on my own program?
@lenny:
That we can’t have
I guess I should provide direct links to rss too. Not much of a nice design this blog has yet.
RSS link: http://www.techper.net/feed/
Atom link: http://www.techper.net/feed/atom/
They all redirect to a feedburner url though, which is: feed://feeds2.feedburner.com/TechPer
Totally (have to) disagree with the posts.
First:
Good IDE is not the requirement to learn a language. I did learn MSVC++ starting with Studio v. 4.2 and IDE didn’t help at all. If you do not have idea what to do, better take pen and paper sheet. If you can’t write ANT/MAKE okay, any IDE can help (almost any). You think you are clever just because you have that IDE or another. Totally wrong. Good developer needs only few tools – good editor and good compiler+debugger, no IDE. You are blaming yourself only.
E.g. I’m using vi(gvim) and gdb – sufficient. The other people do use their smooth looking IDE… I do not see they are more productive than me, even more they are NOT because even best IDE lacks the power of emacs and vi. Having you first to think on all new classes(or files) you have to create – you are forced to think on the goal. IDEs present to you so many redundant information so you often miss the point. Believe me, I’m working on C/C++ projects medium and large scale. And still I have to work with no more than 10 classes at the time. If you need IDE to load small project and you see let’s say 30-40 classes listed. Tell me how to deal with those you are not interested in? Sorry, you are totally wrong at the IDE point.
Second: Here few important things: D lacks good debugger, but D has other features that make it better than C# or Java (anf better than C++). It is free! There is GDC compiler now. It still has the will to go the right direction. It doesn’t have the weak feature of C++ – e.g. context. It is “C++ done right”.
Sorry for sharp opinion, but the language that sucks is C# – I started looking on it firstly because I was Java developer at that time (2001). I find its syntax clumsy, redundant, unclear and the code full of uuids… What a hell! It is bound to the will of M$. You will go where greedy M$ decides and not where you are aimin’.
D is very suitable for second language, it has several memory management mechanism. Garbage collect is not the most important even. Java has GC, nice. But Java isn’t suitable for “real time”. You do not have control. D gives you control – it is suitable for system programming yet gives modern concepts like Ruby and even Java.
Three:
To M$ guys – have you checked how easy it is to create COM object in D? I’ll tell you – much more easy than in C#. Do check it yourself!
Four:
D is modern: it cares about multithreading, about synchornization and paralelism – and still there is no explicit locking. No more locking and interlocking hell…
Five:
About the syntax. Let’s take language C++. You have compiler to pass 5-10 times on each symbol to correctly interpret it, because of context. In D compiler has to do same ONCE. This means simple syntax. Of course to allow multiple paradigm be available you need some redundancy. This doesn’t add much to complexity. I’m quite sure you as C# developer can’t say what it has better than Java has for example… There are no new modern ideas, attempt was made, but not enough. C is mighty, but D goes further. It defines new ways of programming with good attitude. I’m speaking about the language alone, not the library. There are weak areas as XML e.g., good GUI library and similar. Luckily it interfaces very well with C libraries, so you can have almost any C library linked to your D binary executable. Isn’t that nice?
There are other points I just want to cover: managed environment comes at a cost, exceptions add complexity and do not solve problems. In D program correctness is achieved – scopes are defined. There is not error checking and still you have correct program.
I consider time spend learning C# as a waste, Java already had everything. D will enlighten you, because it introduces new concepts and ideas – Ideas that really get you into XXI century.
Leave a Reply