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  Tags:   Posted in: Programming

10 Responses

  1. Martin Wildam - November 20, 2008

    > 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.

  2. larsivi - November 20, 2008

    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.

  3. Rick - November 20, 2008

    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.

  4. Caligula - November 20, 2008

    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.

  5. BioTronic - November 20, 2008

    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.

  6. Arpad - November 21, 2008

    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.

  7. Martin Wildam - November 21, 2008

    > 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.

  8. Robert Thomson - January 17, 2009

    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.

  9. Lenny Hursh - June 5, 2009

    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?

  10. polesen - June 5, 2009

    @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

Leave a Reply