From: Florian Frank Date: 2005-10-11T22:40:37+09:00 Subject: Re: my mother wants to code? junk5@microserf.org.uk wrote: > It's possible to learn to program in either Java or Ruby --- they both > seem reasonable starter (and enterprise-ready) languages to me. There > are more languages that have C-like syntax (C, C++, Java, C# etc.), > while Ruby's syntax (which is nicer than C-like syntaxes IMHO) is less > transferable. So if she wants to find employment, understanding C-like > syntax will be useful. > > My advice would be to sit back and let your mother learn Java from just > your brother. If she 'gets' programming in Java, she'll be able to get > Ruby. If she doesn't get programming in Java, you might say to her "can > I show you a different approach" and she might understand what all this > programming stuff is about. But some people just don't seem to have > that ability to abstract problems into code, in which case language > choice won't matter. You think language choice doesn't matter, if someone wants to learn a programming language? I am not sure, if Ruby is the best language to learn programming, but I am quite sure, that Java isn't. If you start to learn programming, it's important to go step by step from easy concepts to more complicated concepts. In Ruby this can be done like this: puts "Hello, world" ^-- command ^--- string Easy: "puts" is a command that puts a string out on your console. Only later you tell your student about classes, methods and the whole OOP-Zoo. Now look at Java: public class Hello { public static void main(String[] args) { System.out.println("Hello, world\n"); } } You have to explain a dozen foreign, arcane and (at least to the beginner) useless concepts, only to output a string on the console. Next step in Ruby: name = gets puts "Hello, " + name "gets" gets a string input line from your console, which is assigned to the variable name. Then the string "Hello, " is appended to the string referenced by name with the "+" operator, and the resulting string is put out on the console with the old "puts" command. Now compare this to Java: import java.io.*; public class Hello2 { public static void main(String[] args) { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(isr); String name = null; try { if ((name = reader.readLine()) != null) { System.out.println("Hello, " + name + "\n"); } } catch (IOException e) { System.err.println("Caught: " + e); } } } Concept explosion: it's difficult to understand, what's going on even for a seasoned programmer, who is not familiar with Java's bloated library packages. Good luck explaining this mess to your mother, you really need it. And if she happens to be also a mathematican, you should hope, that she never finds out, that you can use the "+" operator to append arbitrary objects to a left hand sided string, but you can never use it to add matrices or complex numbers to each other.