Super-dee-duper D features

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Mon Feb 12 09:23:01 PST 2007


Bruno Medeiros wrote:
> I disagree. I've seen these arguments over and over, that Java takes a 
> lot of code to write the simplest things, that Java is verbose (consider 
> the Kingdom of Nouns article/rant), etc.. It is true that Java is like 
> that, but I disagree that it is a bad thing. The design of the Java 
> language is optimized for large programs, not for small ones.
> 
> Sure, Java's hello world is one the largest compared to other languages, 
> but should we rate languages based on simple code like hello world's? 
> That's not quite correct. It's like bemoaning D or similar languages 
> because a shell scripting language allows writing a hello world with 
> much less code. It does, but shell scripting does scale well for larger 
> projects.
> 
> I've been reading and coding a lot of Java recently (as part of a 
> Descent related Eclipse IDE project), and frankly the more I do it, the 
> more I like Java, despite some standing flaws(*). I've been reading and 
> trying to understand a lot of the Eclipse Platform's and JDT's source 
> code, and I'm able to do that fairly well, in good part because the way 
> one writes Java code is both very verbose and very standard. There are 
> no strange or kinky features that obfuscate the code. No MyDSL's for 
> each developer in the team. If Eclipse and JDT were written in C++ (or 
> even in D!) I wonder if my job wouldn't be much more difficult.

I entirely agree with this feeling. I also don't mind reading Java, but 
IMHO the features of the language that make it nice and readable are not 
verboseness or obsession with objects. Let's not forget that Java has a 
very well thought-out type system with no holes (barring the array 
covariance that is now assuaged by generic). This means that all Java 
code is free of a certain category of errors - guess which: the most 
intractable. This alone has determined a ton of researchers to focus on 
Java, and further improve it (e.g. threading, generics, optimizers, 
analyzers...). The language has gotten threading absolutely right - it's 
the envy of all other imperative languages, barring probably Ada. Java 
also has the exact features needed for component development (GC, 
reflection). All these contribute to Java code being writable and 
readable without a lot of effort, and make up for its minuses.

So I disagree that Java should be seen as a hack pushed by a marketing 
muscle. (That would be Basic, and look at what happened to it :o)). It's 
a good language developed on a sound basis, and it's that that makes it 
reasonable to work with. But that shouldn't mean that things can be 
largely improved; D is slated to have the sound basis and also have 
things that put it way ahead from other languages.



Andrei



More information about the Digitalmars-d mailing list