Using D is a win

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Jun 10 08:47:30 PDT 2007


"Daniel Keep" <daniel.keep.lists at gmail.com> wrote in message 
news:f4h5em$uhf$1 at digitalmars.com...
>
> I'd have to say that D makes a good *second* language, but not so much a
> good first language.  Something like Python definitely makes a better
> first language since it allows people to focus on learning how to solve
> problems.  I personally think it's more important to get them used to
> problem-solving than "now, do I need a 32-bit or 64-bit int for this?
> Should I use a struct or a class?"
>
> But then, maybe that's just me :)

I totally agree.  I worked last semester as a sort of "tutor" for the 
lower-level computer science classes at my university, so I'd help the 
students who were in some of the intro classes with their assignments and 
such.  What always amazed me was that CS0007, the basicest of basic 
programming courses, used Java.  Doing _anything_ in Java is a verbose 
chore, and I realized that you really have to know a lot about programming 
already in order to do anything worthwhile in Java.  The most common 
questions I'd get were things like "what does 'public static void' mean?" 
and "why do I have to use this 'new' thing?"

Just compare the code to ask the user for their name and print it back out, 
in Java:

import java.util.*;

public class Program
{
    public static void main(String[] args)
    {
        System.out.print("Enter your name: ");
        Scanner input = new Scanner(System.in);
        String name = input.nextLine();
        System.out.println("Hi, " + name);
    }
}

And in a simpler language, say MiniD (though it'd look similar in JavaScript 
or so):

write("Enter your name: ");
local name = readln();
writefln("Hi, ", name);

No types, no protection attributes, no obscure syntax, no knowledge of OOP 
necessary -- just pure, simple logic. 





More information about the Digitalmars-d mailing list