Ruby Book for People Who Aren't (Yet) Programmers

Perhaps you should introduce…

Out of curiosity, in a XP kind of mindset, do you guys who are writing this
stuff HAVE a “not yet programmer” to go through and test what you write
and give you feedback?

Having an[other] experienced programmer tell you what’s confusing or not
seems to me to be rather academic.

Not a criticism in any way of the great work you’re doing mind you!

···


http://mcampbell.dhcp.norc.s1.com/

Consistency is the last refuge of the unimaginative. – Oscar Wilde

Perhaps you should introduce…

Out of curiosity, in a XP kind of mindset, do you guys who are writing this
stuff HAVE a “not yet programmer” to go through and test what you write
and give you feedback?

I had a “not yet programmer” handy some time ago… my sister (she was
15 at that time). I introduced her to Ruby with a tutorial I wrote in
Spanish, but I sadly did not finish it (but I wrote enough to introduce
objects, classes, methods, expressions, statements, control structures,
et cetera, all with examples/exercises)

I’m meeting her this Xmas, and will get my tutorial back, so I might
translate it to English. It had some drawbacks as

  • I was (am) very confident in the ability of my sister to learn, so I
    didn’t make it too basic
  • I do admittedly tend to write (and read) heavy (boring?) documents,
    as I’m biased towards reference material.

This tutorial passed the real-world test of being read by a
non-programmer, so when I get to have it again (in less than 3 weeks
time) I might try to summarize some ideas for you, just in case it can
help you.

Having an[other] experienced programmer tell you what’s confusing or not
seems to me to be rather academic.

I did several corrections to my tutorial based on feedback from my
sister :slight_smile:

···

On Wed, Dec 04, 2002 at 09:02:32AM +0900, Mike Campbell wrote:

Not a criticism in any way of the great work you’re doing mind you!


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

…you could spend all day customizing the title bar. Believe me. I
speak from experience.
– Matt Welsh

I have a pool of potential guinea pigs in mind, but I think this should
be hammered out a bit more first before exposing them to it :slight_smile:

martin

···

Mike Campbell mike.campbell@s1.com wrote:

Perhaps you should introduce…

Out of curiosity, in a XP kind of mindset, do you guys who are writing this
stuff HAVE a “not yet programmer” to go through and test what you write
and give you feedback?

Perhaps you should introduce…

Out of curiosity, in a XP kind of mindset, do you guys who are writing this
stuff HAVE a “not yet programmer” to go through and test what you write
and give you feedback?
[…]
This tutorial passed the real-world test of being read by a
non-programmer, so when I get to have it again (in less than 3 weeks
time) I might try to summarize some ideas for you, just in case it can
help you.

It turns out I have a backup of my former $HOME here :slight_smile:

Here’s the table of contents of the stuff I wrote (like 30 pages or so,
I think, 'cause it’s got a fair amount of examples). There’s a short
introduction on the nature of programming languages and it then goes
into Ruby.

1 How do we program?
1.1 Introduction
1.2 Structure of computers
1.3 Programming languages
1.4 Compilers and interpreters
2 Ruby, a very high level programming language
2.1 Grammar: lexis, syntax
3 Straight to work
3.1 The interpreter and its environment
3.2 Literal values
3.3 Assignments
3.4 Functions
3.5 Objects and classes
3.6 Control structures
4 Classes, objects and modules
4.1 Properties or attributes
4.2 Class attributes and methods
4.3 Exercises

I remember I really wanted to introduce objects from the very
beginning, but I couldn’t manage to, as I needed methods to be able to
“do” something, and I couldn’t explain the latter without using the
former, unless I talked about “functions” and explained afterwards their
true nature (as singleton methods of the top-level object). It seems
everybody faces the same problem (remember the Pickaxe ;).

I hacked a simple interactive Ruby interpreter in which TAB would
do method completion, and scopes would be automatically indented.

Soon after my sister was exploring the methods of the objects she could
get ahold of, and asking things such as “how to I get input from the
user”.

···

On Wed, Dec 04, 2002 at 06:40:54PM +0900, Mauricio Fernández wrote:

On Wed, Dec 04, 2002 at 09:02:32AM +0900, Mike Campbell wrote:


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Because I don’t need to worry about finances I can ignore Microsoft
and take over the (computing) world from the grassroots.
– Linus Torvalds

true nature (as singleton methods of the top-level object).

You have only 4 methods in your version of ruby :-))

Guy Decoux

As usual, you’re right:
batsman@tux-chan:/tmp$ cat b.rb
p self.class
p self.singleton_methods.sort
def hello
puts “Hello, World!”
end
hello
p self.singleton_methods.sort
self.private_methods.grep(/hello/) { puts “=> private method” }
Object.new.private_methods.grep(/hello/) { puts “=> private method of Object.new” }

batsman@tux-chan:/tmp$ ruby b.rb
Object
[“include”, “private”, “public”, “to_s”]
Hello, World!
[“include”, “private”, “public”, “to_s”]
=> private method
=> private method of Object.new

I was quite surprised to see #hello defined as a private method in class
Object (and hence inherited by all the objects!) And even more when I
saw that the “private” hello is shadowed.

irb(main):001:0> class A
irb(main):002:1> def do
irb(main):003:2> hello
irb(main):004:2> end
irb(main):005:1> def hello
irb(main):006:2> puts “A#hello”
irb(main):007:2> end
irb(main):008:1> end
nil
irb(main):009:0> def hello
irb(main):010:1> puts “top level”
irb(main):011:1> end
nil
irb(main):012:0> A.new.do
A#hello
nil

The end result is the same, but it really feels cleaner IMHO if the
method is defined only in the top-level object as a singleton. As I feel
it is “cleaner”, I couldn’t help thinking that Ruby behaved this way :slight_smile:

···

On Wed, Dec 04, 2002 at 07:22:42PM +0900, ts wrote:

true nature (as singleton methods of the top-level object).

You have only 4 methods in your version of ruby :-))


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Win95 is not a virus; a virus does something.
– unknown source