D vs Java as a first programming language
Bill Baxter
wbaxter at gmail.com
Sun Sep 28 17:40:39 PDT 2008
On Mon, Sep 29, 2008 at 9:12 AM, Chris R. Miller
<lordsauronthegreat at gmail.com> wrote:
> Sean Kelly wrote:
>>
>> Nicolas Sicard wrote:
>>>
>>> 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?
>>
>> The typical approach to this tends to be "just put this stuff in the file
>> and ignore it--I'll explain it later. I never understood why this is
>> considered a good teaching method :-)
>
> There are so many concepts and mechanics that are at work with even the
> simplest Hello World in wee simple C that it's completely irrational to
> expect a student new to programming to comprehend what's going on. Just
> think about it...
>
> #include <stdio.h>
>
> int main(){
> printf("Hello, world!");
> return 0;
> }
>
> Right there! More concepts than can even be explained! You have the
> concept of an include, and how the parser literally strings all the files
> together to create a processed source code, then how the compiler creates a
> new C run time in suspended animation which will then run the function
> main(), and how printf is supplied by the include directive earlier. We get
> it 'cause we've been trained. To a lot of kids it's a completely foreign
> thing. I mean... gee, this computer is hecka dumb 'n stuff if we need to
> tell it where to find out how to talk through the display! Not to mention
> the distinction of a constant character array, arrays in general, string
> literals, types, casting, return values, etc. It's a crazy world!
>
> At a certain point you have to pedagogically ask the student to take certain
> things on faith until you can better explain it all.
You forgot the "\n" in your printf, which is another thing to explain
to the poor helpless students.
--bb
More information about the Digitalmars-d
mailing list