Super-dee-duper D features

Bruno Medeiros brunodomedeiros+spam at com.gmail
Mon Feb 12 08:30:08 PST 2007


Walter Bright wrote:
> kris wrote:
>  > Thus; shouting from the rooftops that D is all about meta-code, and DSL
>  > up-the-wazzoo, may well provoke a backlash from the very people who
>  > should be embracing the language. I'd imagine Andrei would vehemently
>  > disagree, but so what? The people who will ultimately be responsible for
>  > "allowing" D through the door don't care about fads or technical
>  > superiority; they care about costs. And the overwhelming cost in
>  > software development today, for the type of companies noted above, is
>  > maintenance. For them, software dev is already complex enough. In all
>  > the places I've worked or consulted, in mutiple countries, and since the
>  > time before Zortech C, pedestrian-code := maintainable-code := less
>  > overall cost.
> 

Overall, I agree with kris. Support for mundane code is just as 
important, if not more important that support for super features.

> Some comments:
> 
> 1) D has no marketing budget. It isn't backed by a major corporation. 
> Therefore, it needs something else to catch peoples' attention. Mundane 
> features aren't going to do it.
> 

Flashy super features may catch people's attention, but how good the 
mundane features are is what *keeps* the people in the language.

Oh, and killer apps are likely much better attractors than flashy super 
features. :)

> 2) I know Java is wildly successful. But Java ain't the language for me 
> - because it takes too much code to do the simplest things. It isn't 
> straightforward clarifying code, either, it looks like a lot of 
> irrelevant bother. I'm getting older and I just don't want to spend the 
> *time* to write all that stuff. My fingertips get sore <g>. I wouldn't 
> use Java if it was twice as fast as any other language for that reason. 
> I wouldn't use Java if it was twice as popular as it is now for that 
> reason.
> 

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'm not saying an ideal language should be like Java (and indeed I don't 
think that), what I'm saying is that the verbosity and the "herding of 
the crowd" mentality of Java are not as bad as most people complain it 
is. They have a very prominent good side. And Walter, frankly, I think 
you are very biased in this aspect: Correct if I'm wrong, but you have 
mostly written code for apps where you are the sole developer, which is 
very different from being part of a multi-developer team (or even of 
simply using libraries written by other people), which in turn makes one 
much more vulnerable to suffer language abuse (or simply different use) 
from other developers.

(*) I think Java 1.5 made a great difference in Java, making it much 
more palatable. 'foreach' had to be there, and I find that Java generics 
cover most of the cases where one would want metaprogramming. What I 
still consider annoying is checked exceptions, an obtuse function 
literal syntax (requires using inner classes), and not having free 
functions, but overall my opinion of Java still remains very positive.

> 
> 4) The more experience I have, the more it seems that the language that 
> got a lot right is ... Lisp. But Lisp did one thing terribly, terribly 
> wrong - the syntax. The Lisp experts who can get past that seem to be 
> amazingly productive with Lisp. The rest of us will remain envious of 
> what Lisp can do, but will never use it.
> 
> 5) Lisp gets things right, according to what I've read from heavy Lisp 
> users, by being a language that can be modified on the fly to suit the 
> task at hand, in other words, by having a customizable language one can 
> achieve dramatic productivity gains.
> 

I have a feeling there are some more things other than the syntax. But 
even the syntax alone is a thing very hard to get right: much of LISP's 
simplicity (specially in its macro system) comes from having a 
completely orthogonal syntax.

> 10) Your points about pedestrian code are well taken. D needs to do 
> pedestrian code very, very well. But that isn't enough because lots of 
> languages do pedestrian code well enough.
> 

Well, no languages do pedestrian code well enough AND allow to code 
speedy apps at the same time. Java, C#, Python, Ruby, etc. do the first 
thing, C/C++ does the second, but D is the only one attempting both.

> 11) Today's way-out feature is tomorrow's pedestrian code. I'm old 
> enough to remember when "structured code", i.e. while, for, switch 
> instead of goto, was the way-out feature (70's). Then, OOP was all the 
> rage (80's), now that's a major yawner. STL was then the way-out fad 
> (90's), now that's pedestrian too. Now it's metaprogramming (00's), and 
> I bet by 2015 that'll be ho-hum too, and it's D that's going to do it.
> 

True enough I guess.

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list