top | item 7024466

(no title)

DZittersteyn | 12 years ago

A lot of the arguments against Java seem to focus on "Time-to-Hello-World". While I agree that the first time you execute a program and see those magic words appear on your terminal, I don't think we should judge a language on that. Visual basic has a very short TTHW (esp. if you take into account the time spent on learning about terminal emulators for most languages), that doesn't make it a good language.

If you take an OO programming language as your teaching language, you need to introduce a number of concepts first.

Hr 1: Talk about classes and objects. Introduce the Car and Bike object, that both have the method 'steer()', the attribute 'wheels' and only the car has the property 'hood'. Introduce return types here, as well as arrays.

Hr 2: Then explain how the 'color' on Car is public, while you'd like the accelerate() method to be private.

Hr 3: Explain how some methods and attributes are static. what is a property of the concept 'Car' and what is an attribute of an instance?

In Hr 4 you introduce them to the classes String and System.

Your students will now know:

-class -public -static -void -String[]

You can now tell them about the 'magic' that makes things start, the 'main' method.

Class MyFirstProgram { public static void main(String[] args) { System.out.println("Hello World"); } }

No magic, and a nice start to becoming a proper OO-programmer.

If you want too teach them FP, Haskell is not a bad way to go. If you want to teach them OO, Java isn't as crappy as people say it is.

discuss

order

No comments yet.