My mother wants to code?

Hi,
my 50 year old mother wants to learn to code.
She has no computer experience, but she is surrounded with programmers (three sons and a husband) and she wants to be able to understand what we are talking about.
She is also quite tired of being a math teacher and is considdering to quit her job in favour of helping with my webdev company (doing some mundane inhouse development).

My little brother is busy teaching her Java but I feel Ruby is the better (friendlier, more productive) language. However I can't seem to find a good introduction to ruby that asumes no previous programming experience (there are plenty available for Java).

can anyone point me in the right direction? also if you think it is a better idea to start programming in Java rather than Ruby, please let me know why.

Regards,

Francois

What about this book in progress by Chris Pine?:
http://pine.fm/LearnToProgram/

It's been mentioned on this list before (recently) as an introduction for
the beginning programmers - look for the subject 'Looking for book
reviewers' in the archives for more detailed info.

-Pawel

···

On 10/11/05, Francois Paul <francois@bagasie.com> wrote:

Hi,
my 50 year old mother wants to learn to code.
She has no computer experience, but she is surrounded with programmers
(three sons and a husband) and she wants to be able to understand what
we are talking about.
She is also quite tired of being a math teacher and is considdering to
quit her job in favour of helping with my webdev company (doing some
mundane inhouse development).

My little brother is busy teaching her Java but I feel Ruby is the
better (friendlier, more productive) language. However I can't seem to
find a good introduction to ruby that asumes no previous programming
experience (there are plenty available for Java).

can anyone point me in the right direction? also if you think it is a
better idea to start programming in Java rather than Ruby, please let me
know why.

Regards,

Francois

While Ruby is a great choice for expressiveness, some of the style
does not make sense right away to a non-programmer. I would vote that
you install Squeak. Smalltalk is similar to Ruby but Squeak provides a
very interactive and friendly environment. As a teacher, she may also
enjoy putting such a tools to good use.

Take the similarity that Ruby has to Smalltalk in general, a jump to
Ruby later would not be so hard. I hope her mind is still nimble
though; web stuff can be simple but the world is a fast moving target
with the advent of Web 2.0 and surrounding buzz.

Other languages could include more web oriented javascript + DOM +
html. C was my first language. While low level, it does a fine job of
getting basic imperative style down. BASIC is old but sometimes still
a good place to start, safer than C at least. Logo is another way to
jump start programming.

If you want here to suffer from memory loss or worsen health you could
suggest Prolog or Unlambda.

It really depends. Show her the set of most fitting languages and let
her pick. If she is really serious about learning it also must be
enjoyed (I've never know a good coder that didn't enjoy the work).

Brian.

···

On 10/11/05, Francois Paul <francois@bagasie.com> wrote:

Hi,
my 50 year old mother wants to learn to code.
She has no computer experience, but she is surrounded with programmers
(three sons and a husband) and she wants to be able to understand what
we are talking about.
She is also quite tired of being a math teacher and is considdering to
quit her job in favour of helping with my webdev company (doing some
mundane inhouse development).

My little brother is busy teaching her Java but I feel Ruby is the
better (friendlier, more productive) language. However I can't seem to
find a good introduction to ruby that asumes no previous programming
experience (there are plenty available for Java).

can anyone point me in the right direction? also if you think it is a
better idea to start programming in Java rather than Ruby, please let me
know why.

Regards,

Francois

If I was teaching someone to code now, I would start with something interactive.

I'd suggest a procedural style language and a functional style of language.

My recomendations YMMV...

Procedural : C

If you don't know at least basic C, then you generally have a very flaky idea of what's going on with the computer. C is a pain in the ass, with compilation and link problems, the associated (crap) makefiles, memory management etc etc, but IMHO if you want to be a decent programmer, you have to know enough C to be able to appreciate differences in other languages

Pros:
required for a lot of open source (understanding, compiling etc)
learn enough to fix makefiles etc
solid procedural style
memory management the hard way makes you appreciate GC
pointers

Cons:
compiled
makefiles (yuck!)
not interactive
pointers (+ pointer arithmetic)

Functional : Haskell

I'd have said any functional language (one of the MLs etc), but Haskell seems to be the newest functional language so it's probably the most relevant to the current state of programming (not sure I'd liek to build a dynamic site with it!)

Pros:
learn recursion properly
it's pure functional, no side effects
interactive environment makes it super-easy/quick to test/try things out
it's free (GHC)!
good tutorials available
head
tail
map

Cons:
Monads are a little wierd
unlikely to be a big thing commercially, so a little less relevant than pretty much any other language

The languages I wouldn't touch with a 10 foot barge pole...

Anything .Net
- Nice environment, but material teaches bad practice, very few .Net developers know anything about unit testing, scripting builds (or using build tools) (that I've met)

Python
- Can't stand the "whitespace is a part of the program" feature, apart from that I'd say it'd be a good choice for beginners, me I don't like it

Javascript
- Has nice features, but it's not the easiest language to try out without resorting to running things in a browser (or even worse, Windows Scripting Host [shudder])

C++
- "Make an octopus by nailing legs on a dog" - say no more

Lisp
- as cool as it is, I'd hate to have to teach someone else...

Java
- It's really not as easy to learn as it once was, library bloat, inconsistant APIs, 1000s of tutorials that assume knowledge in framework x, y or z (Have you tried to run any tutorial for Java Web development in the past year that doesn't assume that you'll use Hibernate+Spring+A.N.Other framework?)
- Static compilation bites for learning / No interactive environment to learn with
- Over-reliance on tools (similar to .Net)

<rant>
Just 2 years ago, I'd have said that Java would be quite a decent language to get started with, but with Java5 and all the many new ways you can shoot yourself in the foot (JSF - where did that come from?), I'd definately stay away. It's now come to the point where I'm (Java Technical Architect/Lead Technical guy here) actively trying to move projects at work away from Java (mainly towards Ruby where appropriate), simply as the developers seem to get blinded by all the "cool" eclipse plug-ins, and they can't work without Hibernator, TomcatRunner, DBVisualizer etc etc. What happend to Ant + JUnit + Vi?

Sun's push for specs that are only feasible with a critical mass of tool support, along with new Java developers and their "Tool Lust" (ooer missus) and .Net envy will be the death of Java.
</rant>

Yeah and I suppose Ruby's a good learners language, but I'd start with C + Haskell first to get the basics before moving onto Ruby for development.

Kev

my 50 year old mother wants to learn to code.

Great!

I believe Ruby is a good first language.

I'd certainly recommend it above C. A functional programming language
(Haskell) would perhaps be understood by someone well-versed in
mathematics better than you or I. Maybe Python or Java otherwise, but
here you are on ruby-talk, and if you're a Rubyist, Ruby is better for
your mum.

If Java is better, it is because it is designed to be idiot-proof.
That's also why it's not as good.

irb is the #1 equipment for learning Ruby.

Chris Pine's tutorial is excellent, and he's looking for reviewers like
your mother for the book based upon it (see an earlier thread on this
list). I recommend this as the best way in - it even encourages you to
play with your new Ruby skills in irb.

Why's (Poignant) Guide to Ruby is fun, but takes a certain sense of
humour and a bunch of time.

Then there's the Pickaxe, which you've probably seen. It's too heavy
for a non-programmer, but a good reference once you're underway.

Now you just need a small project or two that she can work towards. I
like to implement Blackjack in a new language I learn, but that's just
me.

Cheers,
Dave

She has no computer experience, but she is surrounded with programmers
(three sons and a husband) and she wants to be able to understand what
we are talking about.

[Snip]

My little brother is busy teaching her Java but I feel Ruby is the
better (friendlier, more productive) language.

I don't think the main issue here is language advocacy. I think it's
that "too many cooks will spoil the broth". If your mother is getting
conflicting advice from two (or possibly four) people, she's going to
get confused. I would, wouldn't you?

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.

If she does get Java, once she's had a bit of experience ask if she'd
like to see Ruby. If you can show her m lines of Ruby that does the
same as n lines of Java, where m << n, for a range of common tasks, I
bet she'll be a convert.

But don't bombard her with a language war. It'll just put her off.

Here's one reason I'd *strongly* urge not using Java as a first
language: lack of support for closures. IMO closures are as fundamental
a code-structuring concept as functions and procedures are, and living
without them feels vaguely like using GOSUBs in BASIC dialects that
didn't have proper procedure support. Learning java as a first languyage
might lead her to the idea that closures are some sort of esoteric
construct only of interest to language junkies.

martin

···

Francois Paul <francois@bagasie.com> wrote:

can anyone point me in the right direction? also if you think it is a
better idea to start programming in Java rather than Ruby, please let me
know why.

Hi,

I think Ruby is a fabulous choice for learning to program. Ruby makes
the easy stuff easy, while also having a lot of the cooler stuff too
(closures, continuation, regexs, etc). Ruby is extemely elegant, fairly
simple and consistent, and expressive.

I think the best way to learn to program is to do a lot of programming.
Ruby will let you write powerful programs with simple programming
concepts. You really don't have to know a lot to get started. Learn
the more powerful stuff gradually when you need them.

Besides, Ruby's community's is the coolest :wink:

Save your mother from the Java torture (unknowingly (?)) inflicted by
your younger brother! Spare yourself from your mother being annoyed at
you when she realizes how much cooler Ruby is than Java and you just
stood aside! Take action!

you.teach!(:Ruby, :to => "mom") # or something like that.
                                # Refactorings, anybody?

Jeff

P.S. I didn't send the first email I wrote because I just ended up
gushing about how cool Ruby is. This one's not much better. Ah well.

···

On Tue, Oct 11, 2005 at 05:20:00PM +0900, Francois Paul wrote:

Hi,
my 50 year old mother wants to learn to code.
She has no computer experience, but she is surrounded with programmers
(three sons and a husband) and she wants to be able to understand what
we are talking about.
She is also quite tired of being a math teacher and is considdering to
quit her job in favour of helping with my webdev company (doing some
mundane inhouse development).

My little brother is busy teaching her Java but I feel Ruby is the
better (friendlier, more productive) language. However I can't seem to
find a good introduction to ruby that asumes no previous programming
experience (there are plenty available for Java).

can anyone point me in the right direction? also if you think it is a
better idea to start programming in Java rather than Ruby, please let me
know why.

Regards,

Francois

Switching her when she's halfway through will only make it harder. Switch immediately or
much later.

Warren Seltzer

···

-----Original Message-----
From: Francois Paul [mailto:francois@bagasie.com]
Sent: Tuesday, October 11, 2005 10:20 AM
To: ruby-talk ML
Subject: my mother wants to code?

Actually, the most important thing is at-the-elbow tech support. She should learn a
language that is known by others who live in the same house. If you're willing to pop
over to provide Ruby help, then fine, but consider that if you live outside of her house
it's also inconvenient for her to get answers.

Warren Seltzer

Oops, apparently I didn't read that thread very carefully. The link I gave
is for his tutorial - he also has a book in the works that he was recently
looking for reviewers for. You might get in touch with him to see if he
still needs some. Other than that, the tutorial should still be pretty
useful.

-Pawel

···

On 10/11/05, Pawel Szymczykowski <makenai@gmail.com> wrote:

What about this book in progress by Chris Pine?:
http://pine.fm/LearnToProgram/

It's been mentioned on this list before (recently) as an introduction for
the beginning programmers - look for the subject 'Looking for book
reviewers' in the archives for more detailed info.

thanks this is great!

Pawel Szymczykowski wrote:

···

What about this book in progress by Chris Pine?:
Learn to Program, by Chris Pine

It's been mentioned on this list before (recently) as an introduction for
the beginning programmers - look for the subject 'Looking for book
reviewers' in the archives for more detailed info.

-Pawel

On 10/11/05, Francois Paul <francois@bagasie.com> wrote:

Hi,
my 50 year old mother wants to learn to code.
She has no computer experience, but she is surrounded with programmers
(three sons and a husband) and she wants to be able to understand what
we are talking about.
She is also quite tired of being a math teacher and is considdering to
quit her job in favour of helping with my webdev company (doing some
mundane inhouse development).

My little brother is busy teaching her Java but I feel Ruby is the
better (friendlier, more productive) language. However I can't seem to
find a good introduction to ruby that asumes no previous programming
experience (there are plenty available for Java).

can anyone point me in the right direction? also if you think it is a
better idea to start programming in Java rather than Ruby, please let me
know why.

Regards,

Francois

I agree that interactive is the way to go.

I'm not sure that teaching someone both a procedural language and a
functional language is a good idea, it seems like they will just end up
confused. My vote would be for a functional language as they tend to be less
frustrating in terms of bugs.

I would steer well clear of basic.

I'm not quite sure why you would not mind teaching someone Haskell but would
have problems with Lisp. I think Lisp is fine for a begginer, and it is only
people who already have experience with a language with lower bracket count
that have troubles. The uniformity of lisp means there isn't much syntax to
learn.
Also, javascript is a very nice language IMHO (obviously not functional) and
has been unfortunately tarred with the bad dom bugs brush. Maybe using it to
script an application, like photoshop.

···

On 10/11/05, Kev Jackson <kevin.jackson@it.fts-vn.com> wrote:

If I was teaching someone to code now, I would start with something
interactive.

I'd suggest a procedural style language and a functional style of
language.

My recomendations YMMV...

Procedural : C

If you don't know at least basic C, then you generally have a very flaky
idea of what's going on with the computer. C is a pain in the ass, with
compilation and link problems, the associated (crap) makefiles, memory
management etc etc, but IMHO if you want to be a decent programmer, you
have to know enough C to be able to appreciate differences in other
languages

Pros:
required for a lot of open source (understanding, compiling etc)
learn enough to fix makefiles etc
solid procedural style
memory management the hard way makes you appreciate GC
pointers

Cons:
compiled
makefiles (yuck!)
not interactive
pointers (+ pointer arithmetic)

Functional : Haskell

I'd have said any functional language (one of the MLs etc), but Haskell
seems to be the newest functional language so it's probably the most
relevant to the current state of programming (not sure I'd liek to build
a dynamic site with it!)

Pros:
learn recursion properly
it's pure functional, no side effects
interactive environment makes it super-easy/quick to test/try things out
it's free (GHC)!
good tutorials available
head
tail
map

Cons:
Monads are a little wierd
unlikely to be a big thing commercially, so a little less relevant than
pretty much any other language

The languages I wouldn't touch with a 10 foot barge pole...

Anything .Net
- Nice environment, but material teaches bad practice, very few .Net
developers know anything about unit testing, scripting builds (or using
build tools) (that I've met)

Python
- Can't stand the "whitespace is a part of the program" feature, apart
from that I'd say it'd be a good choice for beginners, me I don't like it

Javascript
- Has nice features, but it's not the easiest language to try out
without resorting to running things in a browser (or even worse, Windows
Scripting Host [shudder])

C++
- "Make an octopus by nailing legs on a dog" - say no more

Lisp
- as cool as it is, I'd hate to have to teach someone else...

Java
- It's really not as easy to learn as it once was, library bloat,
inconsistant APIs, 1000s of tutorials that assume knowledge in framework
x, y or z (Have you tried to run any tutorial for Java Web development
in the past year that doesn't assume that you'll use
Hibernate+Spring+A.N.Other framework?)
- Static compilation bites for learning / No interactive environment to
learn with
- Over-reliance on tools (similar to .Net)

<rant>
Just 2 years ago, I'd have said that Java would be quite a decent
language to get started with, but with Java5 and all the many new ways
you can shoot yourself in the foot (JSF - where did that come from?),
I'd definately stay away. It's now come to the point where I'm (Java
Technical Architect/Lead Technical guy here) actively trying to move
projects at work away from Java (mainly towards Ruby where appropriate),
simply as the developers seem to get blinded by all the "cool" eclipse
plug-ins, and they can't work without Hibernator, TomcatRunner,
DBVisualizer etc etc. What happend to Ant + JUnit + Vi?

Sun's push for specs that are only feasible with a critical mass of tool
support, along with new Java developers and their "Tool Lust" (ooer
missus) and .Net envy will be the death of Java.
</rant>

Yeah and I suppose Ruby's a good learners language, but I'd start with C
+ Haskell first to get the basics before moving onto Ruby for development.

Kev

I taught myself everything, and I started with QBasic. I know, but it
was a good place to start, and it made me really appreciate the finer
languages once I figured out how to move on to them. So am I
recommending that she start with Qbasic? Not really. But an
intrepreted language where she can see quick results is probably a
good idea. Python is the first that leaps to mind, but I've not
worked with it extensively. Ruby is really expressive, but I don't
know if I would have been able to pick it up if I didn't understand
some programming basics first.

Perhaps some simple shell scripting? That's a handy skill to have anyway.

For some reason, the more I think about this, the more I lean back to
some form of basic as a starting point. Before I start getting
flamed, hear me out. The entire point of the language was to make it
easy for the lay person to write something that works. Once a basic
understanding of things like variables, functions, and basic
algorithms are learned, it's easy to translate that into other
languages and more advanced work.

Anyways, that's my 2 cents that will probably get flamed to hell, but
to hell with it.

···

On 10/11/05, junk5@microserf.org.uk <junk5@microserf.org.uk> wrote:

> She has no computer experience, but she is surrounded with programmers
> (three sons and a husband) and she wants to be able to understand what
> we are talking about.
[Snip]
> My little brother is busy teaching her Java but I feel Ruby is the
> better (friendlier, more productive) language.

I don't think the main issue here is language advocacy. I think it's
that "too many cooks will spoil the broth". If your mother is getting
conflicting advice from two (or possibly four) people, she's going to
get confused. I would, wouldn't you?

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.

If she does get Java, once she's had a bit of experience ask if she'd
like to see Ruby. If you can show her m lines of Ruby that does the
same as n lines of Java, where m << n, for a range of common tasks, I
bet she'll be a convert.

But don't bombard her with a language war. It'll just put her off.

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.

So true. Motivation has always been the key in my experience. As a kid I always wanted to create video games, that got me started. Show her how to program a graphing calculator. Get an old HP calc and data cable on ebay or something, a book on how to program it, and give it to her as a gift. I always liked the HP calculators better, I heard they stopped making them though. She doesn't have to do web programming to understand what you're talking about, she could focus on teaching kids to program their calculators, she may appreciate that more, her students certainly would. I remember playing space invaders every day in high school math.

If she is really serious about learning it also must be

enjoyed (I've never know a good coder that didn't enjoy the work).

francois = Ruby::Talker.find( :name => 'Francois Paul' )

francois.siblings.map do |sibling|
  java_classes = sibling.classrooms.find { |classroom|
classroom.subject == Java }
  java_classes.each { |classroom| classroom.delete( francois.mom ) }
end

ruby_class = Classroom.new(
  :subject => :Ruby,
  :instructor => francios
)

ruby_class.students << francois.mom
ruby_class.ring_bell!

···

On 10/14/05, Jeffrey Dik <jeffrey.dik@myrealbox.com> wrote:

you.teach!(:Ruby, :to => "mom") # or something like that.
                                # Refactorings, anybody?

--
Jacob Fugal

To update on the situation:

I had a chat with everyone involved weighing Ruby and Java against each other and it was decided to go with Ruby.
my mother and my dad are now going through Chris' tutorial.
They are both enjoying it very much - and my dad (coming from the VB for applications world) is so impressed with how beautiful Ruby is.

They see learning ruby as something they can do together as a family activity and everytime I pop around for a visit my mom first has to show me her latest little program.

so ... we are steadily becoming a family of rubyists. (if only my little sister and my wife would take interest, but franky i think that would become scary (besides hell would have to freeze over first))

I think my parents are happier people (or at least they have more fun) today because of Ruby.
She'll probably join the list in a couple of months, when she gets a solid internet connection at home, and i'll introduce her then.

thanks for all the input.

-Francois

Warren Seltzer wrote:

···

Actually, the most important thing is at-the-elbow tech support. She should learn a
language that is known by others who live in the same house. If you're willing to pop
over to provide Ruby help, then fine, but consider that if you live outside of her house
it's also inconvenient for her to get answers.

Warren Seltzer

Well my mother (50+) has been wanting to learn php so I'll throw that
into the loop as it is EASY to get something up and running but also
has more advanced oo features for down the road.

···

On 10/11/05, Florian Frank <flori@nixe.ping.de> wrote:

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.

I am not sure, if Ruby is the best language to
learn programming, but I am quite sure, that Java isn't.

Absolutely! And great examples. I'm amazed that people would suggest
Java as a first language. How many people could write that Java
program without looking up a single thing? I certainly couldn't
(though I don't write much Java anymore, so maybe that's just me).

Someone learning to program has a vast number of concepts to tackle.
The easiest way to do this is one-at-a-time. How many concepts are
being introduced in those Java programs?

Plus, in order for learning to be effective (or at least much more
effective), it should be fun. In this case, that means there should
be a short time until the programmer can actually do something useful.
If you went to learn Norwegian, for example, and the first thing you
were told was the genders of 1000 Norwegian nouns... (not what they
words mean in english, just the genders). Yeah, it's important, but
not in that order! Contrast this with a class where you learn how to
greet people, how to ask someone to speak more slowly, how to swear at
your cab driver, how to ask what things mean, how to pick up hot
Scandinavian (wo)men... The fun class is the one where learning will
take place.

And what language is more fun than Ruby?? :slight_smile:

It's easy to use, it's fun, and it's a language you could continue to
use professionally (especially in web-dev stuff). I don't see any
other language offering all that, and thus no other language better to
start with. (Though I am obviously totally biased, so take all of
this with a grain of salt!)

My NOK 0.02,

Chris