D vs Java as a first programming language

Janderson ask at me.com
Sun Sep 28 16:06:04 PDT 2008


Nicolas Sicard wrote:
> Hi,
> 
> I am new to D, and I think I have discovered a programming language 
> close to my ideal one...
> 
> On the web site, it is said: "Who D is Not For [...] As a first 
> programming language - [...] Java is more suitable for beginners.".
> Is this based on experience?
> 
> I am a teacher in a field where my students don't know what a 
> programming language is! I need a language for a first approach of 
> programming. I would say that Pascal, or BASIC even if a bit outdated, 
> or even D would fit, but not Java.
> 
> I can imagine my first lesson with Java:
> 
>     public class HelloWorld {
>         public static void main(String[] args) {
>             System.out.print("Hello world!");
>         }
>     }
> 
> I would have to explain what a class is. What a method is. What a public 
> or private visibility means. What a static method is. What the dots in 
> "System.out.print" mean... :) Then how to compile it. Why you can't run 
> it without a virtual machine. A virtual what?
> 
> It seems the main argument why Java is a good first language is that it 
> lacks complexity (namely C++ complexity). I think it also lacks 
> simplicity for absolute beginners. D can be both simple and complex, and 
> it shares other features with Java that could make it a language for 
> beginners: object-oriented, no pointers necessary, garbage collection, 
> strict type checking, portable...
> 
> What feature would make D a worse choice than Java for a first language?
> 
> Nicolas

On of the nice things about D is that its a multi-paradigm language. 
That is it has a bit of everything in it.  That should make for learning 
other languages easier once one knows D.  Also hello world is a lot 
simpler in D:

import std.stdio;

void main(string[] args)
{
	writefln("Hello World!");
}

I think you could craft tutorials that have small enough steps to make D 
a very easy language to learn.

-Joel



More information about the Digitalmars-d mailing list