pouët.net

Java tutorial for elementary school students

category: general [glöplog]
I think QBASIC or similar is probably the best to start with. There are a few reasons:

1) The simplest program is just one line.
2) Except where colon is used, each line corresponds to one action.
3) Any one line does not change the interpretation of any other lines. ie. there isn't a complex formal grammar to understand before you can make something that compiles.
4) There is easy to access and clearly explained help for each keyword.
5) "goto" is very easy to learn, and increases the power of a beginner programmer who doesn't yet have the foresight to organize the whole program into subroutines, or worse yet, objects.
6) Variables don't have to be declared.
7) Variable types are made explicit by requiring prefixes on the variable name, so unlike some scripting languages that automatically set the type of a variable, QBASIC teaches that variables have types (which reduces confusion).

Visual Basic is quite a lot more complex, because a project has to be set up, a window has to be created for output, forms have to be created for input, etc... Java has all of these complications, plus you are forced to understand OOP and not allowed to use goto, which makes it even harder, and the reference for the Java functions is simply huge, and explained in a much more long winded and complicated manner than the help that comes with QBASIC.

On the other hand, learning Java can be more rewarding, because they can embed their work on a web page (though most kids won't figure out how to do that). Perhaps a QBASIC-like implementation in Java or Flash would be a good idea for children to learn with. Something that stores the programs they write on a server and automatically allows them to be executable from anywhere without their having to know how to FTP them to a server.

I think there are already some languages developed specially for children, so check them out!
added on the 2008-02-05 08:04:27 by yesso yesso
why teaching them to use 'goto' if they aren't authorized to use it later ? o_O

as much as i think that asm should be taught (or at least shown) to every computer sciences student, asm isn't needed nor appropriate for young pupils imho.
added on the 2008-02-05 08:22:37 by Zest Zest
because they'd otherwise probably get frustrated and quit coding altogether..
but i seriously believe every case is a diferent case, so everything depends largely on the kid's learning curve and personal coding interest. common sense for most teachers with a proper background in what the hell they're teaching.
added on the 2008-02-05 08:40:38 by psenough psenough
I assume here we are talking about introducing children to programming who otherwise would never think of doing it, and not about children who start out as absolutely determined to make a career of it. As such, the priority should be to get the most benefit as possible out of the very beginning of the teachings, since: 1) most students will quit right away, and therefore we should make sure they gain the most benefit from what little experience they had, and 2) less students will quit right away if they get visible results right away.

Goto is easier to learn than functions. Just imagine yourself explaining how goto works, and then imagine yourself explaining how functions work. An added benefit of Goto is that it reinforces the idea of the instruction pointer, which reinforces the idea of the runtime state, which are both essential to understanding how a program works.
added on the 2008-02-05 09:07:18 by yesso yesso
processing ftw.
added on the 2008-02-05 09:09:19 by Gargaj Gargaj
They should all be given an Amiga 500 with a hard disk, a copy of AsmPro and the hardware reference manual.
added on the 2008-02-05 10:23:34 by xeron xeron
I learned QBASIC and LOGO in elementary school and it was really fun making cool drawings using these tools. Do make them sort or solve problems yet. Make it fun!
added on the 2008-02-05 10:36:24 by zaphands zaphands
I don't think functions and subroutines are that much more difficult to grasp than goto.
added on the 2008-02-05 10:36:38 by doomdoom doomdoom
... but the QBASIC way of defining functions and subroutines in a separate dialog is both annoying and counterintuitive.
added on the 2008-02-05 10:37:30 by doomdoom doomdoom
errr... meaning don't make them sort or solve problems yet.. sorry. I'm using prescribed medication.
added on the 2008-02-05 10:37:52 by zaphands zaphands
so Adok: Mensa selection and recruitment begins at kindergarten or primary school ?
added on the 2008-02-05 11:13:17 by Zest Zest
I say LOLCODE FTW !!
added on the 2008-02-05 11:17:25 by d0DgE d0DgE
Why not use Squeak instead of Java?
added on the 2008-02-05 11:29:21 by noname noname
I'm happy you're discussing about these things. Regarding the suggestions about Basic, Assembler and C, I already wrote tutorials for them years ago. The Basic tutorial is still the most downloaded Basic tutorial in German language. I wrote it when I was 12. The reason was that my first computer was a C64 and thus I automatically got to Basic. But I think that today it's not necessary to start with Basic, but one can start right with a language that has a real world application. That's why I've thought of Java. Apart from learning to program in a language, my thought is that elementary school students are still open enough for having their intelligence trained and becoming educated as problem solvers.

I've written the first chapter (work in progress) and put it onto the Internet. It's in English and German. I'd be interested in having these tested with elementary school children to find out if it's possible to convey Java programming knowledge to elementary school children this way. I'd also be interested in suggestions.

http://www.students.meduniwien.ac.at/~n0102122/tutorials/java-tutorial-english.htm
http://www.students.meduniwien.ac.at/~n0102122/tutorials/java-tutorial-german.htm
added on the 2008-02-05 11:42:26 by Adok Adok
I've just noticed my QBasic tutorial is even on Wikiversity!
http://de.wikiversity.org/wiki/Wikiversity:Lehrb%C3%BCcher#QBasic
Interesting :)
added on the 2008-02-05 11:48:33 by Adok Adok
Quote:

Let's stake a look at the line "public static void main(String[] args)". This starts the definition of a method. A method is the same thing that's called a function in other programming languages. It's a section of the program code that is executed under certain circumstances. The method main has the special property that it is always executed first when a program is started as an application. It is "public" and "static". Public means that it can also be run by other classes, and static means that it belongs directly to the class and not to an object inferred from it. Moreover, it is "void" - that means that it doesn't return a value. "String[] args" is the parameter of the function main. "args" is the name of the variable and "String[]" is its data type. It's an array, a collection of strings. With it, command line parameters are transmitted. For now this isn't important as we don't care about command line parameters. But in order to define a main method, this parameter muss always be written.


You seriously think that an average ten-year old can digest that?
added on the 2008-02-05 11:56:25 by Preacher Preacher
Quote:
You seriously think that an average ten-year old can digest that?


Exactly my thoughts.
added on the 2008-02-05 12:05:58 by StingRay StingRay
The very least thing you can do is to abstract away the I/O class into something like Read.Integer();

Even our first java course in the university did that, and plenty of people had real issues with finishing up that course.
added on the 2008-02-05 12:06:45 by Preacher Preacher
Preacher: that's perfect as a mensan filter.
added on the 2008-02-05 12:07:35 by Zest Zest
That paragraph that Preacher quotes pretty well summarises why Java (or any OO language for that matter) is not suitable; too much cruft.
Java:
Code:public class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); } }
:\


Proce55ing:
Code:void setup() { println("Hello World!"); }
:)


Qbasic:
Code:PRINT "Hello World!"
:)


LOGO:
Code:print [Hello World]
:)
Code:to koch_square :size pd fd :size*3 pu bk :size lt 90 pd repeat 3 [fd :size lt 90] pu bk :size if :size < 4 [stop] koch_square :size/3 fd :size lt 90 repeat 2 [ koch_square :size/3 fd :size rt 90 ] koch_square :size/3 fd :size lt 90 koch_square :size/3 bk :size*2 end ht cs pu rt 90 bk 150 koch_square 100 \\o/ BB Image \\o/


\:D/


;)
added on the 2008-02-05 13:24:46 by bdk bdk
Not to forget the original robot-turtle concept, this recent one seems nice
added on the 2008-02-05 13:34:49 by bdk bdk
you forgot C:

Code: #include <stdio.h> int main(int argc, char **argv) { printf("Hello world\n"); return 0; }
added on the 2008-02-05 13:40:16 by Preacher Preacher
ah, I have a bug :P
It should of course be printf("hello world\n");
added on the 2008-02-05 13:40:46 by Preacher Preacher
Code:#include <stdio.h>
ftw...! \;D/

Also Pascal is not bad as a teaching language :)
added on the 2008-02-05 13:43:51 by bdk bdk

login