[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Complete beginner in programming

Roger Grosswiler

3/31/2005 6:12:00 AM

Hi,

i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
oo-programming?

Roger



10 Answers

Lasse Koskela

3/31/2005 6:29:00 AM

0

Roger,

On Thu, 31 Mar 2005 15:12:19 +0900, Roger Grosswiler <roger@gwch.net> wrote:
> i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
> oo-programming?

I've heard good things about "Head First Java" from O'Reilly (ISBN:
0596009208), which teaches Java and OO concepts. It's not Ruby, but I
thought you might still be interested.


-Lasse-


Roger Grosswiler

3/31/2005 6:30:00 AM

0

> Roger,
>
> On Thu, 31 Mar 2005 15:12:19 +0900, Roger Grosswiler <roger@gwch.net> wrote:
>> i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
>> oo-programming?
>
> I've heard good things about "Head First Java" from O'Reilly (ISBN:
> 0596009208), which teaches Java and OO concepts. It's not Ruby, but I
> thought you might still be interested.
>
>
> -Lasse-
>
>
i take all information i can.... even if there is a "oo for more than dummies" ;-)



Pat Maddox

3/31/2005 6:37:00 AM

0

Check out Thinking in Java by Bruce Eckel. Another Java book, it
covers OOP programming pretty well. Best of all, it's free on the
web.

http://www.mindview.net/...


On Thu, 31 Mar 2005 15:30:05 +0900, Roger Grosswiler <roger@gwch.net> wrote:
> > Roger,
> >
> > On Thu, 31 Mar 2005 15:12:19 +0900, Roger Grosswiler <roger@gwch.net> wrote:
> >> i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
> >> oo-programming?
> >
> > I've heard good things about "Head First Java" from O'Reilly (ISBN:
> > 0596009208), which teaches Java and OO concepts. It's not Ruby, but I
> > thought you might still be interested.
> >
> >
> > -Lasse-
> >
> >
> i take all information i can.... even if there is a "oo for more than dummies" ;-)
>
>


Mark Hubbart

3/31/2005 6:46:00 AM

0

On Thu, 31 Mar 2005 15:12:19 +0900, Roger Grosswiler <roger@gwch.net> wrote:
> Hi,
>
> i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
> oo-programming?

This seems to be a good tutorial, based in Ruby and targeted towards
new programmers:
http://pine.fm/Learn...

... and you don't have to buy it :)

HTH,
Mark


Lasse Koskela

3/31/2005 6:51:00 AM

0

On Thu, 31 Mar 2005 15:45:48 +0900, Mark Hubbart <discordantus@gmail.com> wrote:
> This seems to be a good tutorial, based in Ruby and targeted towards
> new programmers:
> http://pine.fm/Learn...

Ah. I'll have to vouch for that one.

I skimmed through it yesterday hoping that I'll learn something and I
did. I had read the pickaxe book before but obviously not everything
you read will stick, especially if you're not using Ruby on a daily
basis...

-Lasse-


Bill Kelly

3/31/2005 8:07:00 AM

0

From: "Roger Grosswiler" <roger@gwch.net>
>
> i am a complete beginner in programming, i can handle some
> lines in perl. Does anybody know a EASY source to learn
> oo-programming?

One of the features Ruby shares with languages like Perl is
you can even try things out interactively, from the shell.
In Ruby, you can even create objects right from the interactive
ruby shell (irb) and experiment with them.

$ irb --simple-prompt
# let's create a generic object instance out of some electrons:
>> o = Object.new
=> #<Object:0x2bb3a50>
# cool! a cluster of some electrons ready to do our bidding!
# let's ask it to time travel!
>> o.invent_the_warp_drive
NoMethodError: undefined method `invent_the_warp_drive'
for #<MyObject:0x2bb3a50> from (irb):29
# well shucks.
# ok, maybe this Object can tell us what it *can* do??
>> o.methods.sort
=> ["==", "===", "=~", "__id__", "__send__", "class", "clone", "display",
"dup", "eql?", "equal?", "extend", "freeze", "frozen?", "hash", "id",
"inspect", "instance_eval", "instance_of?", "instance_variable_get",
"instance_variable_set", "instance_variables", "is_a?", "kind_of?",
"method", "methods", "nil?", "object_id", "private_methods",
"protected_methods", "public_methods", "respond_to?", "send",
"singleton_methods", "taint", "tainted?", "to_a", "to_s", "type",
"untaint"]
# that's quite a few methods. how many is that?
o.methods.length
=> 40
# one called untaint, eh??? what kind of object is this, again?????
>> o.class
=> Object
# ok.. plain old Object... probably does a bunch of generic stuff.
# Do you think it could possibly be tainted?
>> o.tainted?
=> false
# Naw, we personally supervised the creation of this object.
# No chance for it to be tainted by untrusted data!
# What about Strings? Are they objects?
>> "hello".kind_of? Object
=> true
# That seems consistent. So even a string is an Object...!
>> "hello".class
=> String
>> "hello".length
=> 5
>> "hello".capitalize
=> "Hello"
# Any chance it's easy to create our own kind of Object?
>> class NiftyObject
>> def greet
>> p "just a simple hello"
>> end
>> end
=> nil
# Let's make one!
>> o = NiftyObject.new
=> #<NiftyObject:0x2bce768>
# Did we really just rearrange some electrons into a new NiftyObject ???
>> o.class
=> NiftyObject
>> o.kind_of? NiftyObject
=> true
>> o.greet
"just a simple hello"
=> nil

A couple links that emphasize interactive learning about
objects (in Ruby)
http://www.math.umd.edu/~dcarrera...
http://www.poignantguide...chap...
(Ch. 3 of http://www.poignantguide... )


Hope this helps & Good Luck!

Regards,

Bill




John-Mason P. Shackelford

3/31/2005 9:33:00 AM

0

One of the best introductions to OO I've read a little book by Gary
Entsminger called _The Tao of Objects: A Beginner's Guide to
Object-Oriented Programming_. It's out of print so you may have to hunt
for it on bookfinder.com.

The code examples are dated (and in C++ and Pascal) but they are really
superfluous anyway. If you want to understand why OO was born and what
it can do for you, this is a good place start. It's short, sweet, and as
motivational as a technical book ever was.

Once you get excited about OO and begin using it the first design rule
to learn is composition vs. inheritance. There is a good chapter on the
subject in _Java Design_ by Peter Coad.

After that learn how to write unit tests and begin learning design
patterns. The classic text there is _Design Patterns_ by Erich Gamma,
Richard Helm, Ralph Johnson, and John Vlissides, commonly called the
Gang of Four or GoF, but the content of the book has been reproduced
many times in various other texts and using different languages for
examples. Any of those that contain a full catalog of the major GoF
patterns will do.

Eventually you'll want to read _Refactoring: Improving the Design of
Existing Code_ by Martin Fowler, but some experience using design
patterns will help.

As far as I know there are no books on design patterns which use Ruby
for code examples. If Dave is listening he might note that it would be
an interesting project given that most design pattern texts are based on
languages which are statically typed. It would be interesting to see
what gems a pattern book for a dynamically typed language would contain.


John-Mason Shackelford

Software Developer
Pearson Educational Measurement

2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
john-mason.shackelford@pearson.com
http://www.pe...



james_b

3/31/2005 1:49:00 PM

0

Lasse Koskela wrote:
> Roger,
>
> On Thu, 31 Mar 2005 15:12:19 +0900, Roger Grosswiler <roger@gwch.net> wrote:
>
>>i am a complete beginner in programming, i can handle some lines in perl. Does anybody know a EASY source to learn
>>oo-programming?
>
>
> I've heard good things about "Head First Java" from O'Reilly (ISBN:
> 0596009208), which teaches Java and OO concepts. It's not Ruby, but I
> thought you might still be interested.


I have not read "Head First Java" but in general would be leery of
learning about OO with Java as the example language. What, exactly,
defines an OO language is a subject of some debate, though I believe
most people would agree that Ruby is closer to the abstract ideal than Java.

Some food for thought:

http://www.paulgraham.com/r...




James

--

http://www.ru...
http://www.r...
http://catapult.rub...
http://orbjson.rub...
http://ooo4r.rub...
http://www.jame...


Randy Kramer

3/31/2005 2:48:00 PM

0

On Thursday 31 March 2005 01:45 am, Mark Hubbart wrote:
> This seems to be a good tutorial, based in Ruby and targeted towards
> new programmers:
> http://pine.fm/Learn...

+1

It's not a book, but go through it before you spend money on anything else.

I can't help but be wary of the advice to read a Java book if your intent is
to eventually learn Ruby.

Try getting a few Ruby books at your local library (mine didn't have any when
I first asked, they've since bought the Pickaxe book), get them to do an
interlibrary loan.

IMHO, you have to find books that talk to *your* head, and a book that's good
for somebody else may be very hard for you to deal with.

Nevertheless, I'm buying Ruby in a Nutshell after having borrowed it. It's
more the quick reference than a tutorial, but in Python, a very similar book
worked for me (even though I dropped Python and am going on to Ruby).

Then checkout:

* Teach Yourself Ruby in 21 Days
* The Pickaxe Book (forget the real name, by Dave Thomas, Programming in
Ruby, iirc)
* The Ruby Way

and see if one or more of them talks to your head

Randy Kramer


> ... and you don't have to buy it :)



Luke Galea

3/31/2005 6:01:00 PM

0

That's a great idea re: examining the classic design patterns from the point
of view of a dynamically typed language. Also, considering meta-programming
as well a book on dynamic design patterns would introduce new patterns and
likely make others redundant.

On Thursday 31 March 2005 09:32, John-Mason P. Shackelford wrote:
> One of the best introductions to OO I've read a little book by Gary
> Entsminger called _The Tao of Objects: A Beginner's Guide to
> Object-Oriented Programming_. It's out of print so you may have to hunt
> for it on bookfinder.com.
>
> The code examples are dated (and in C++ and Pascal) but they are really
> superfluous anyway. If you want to understand why OO was born and what
> it can do for you, this is a good place start. It's short, sweet, and as
> motivational as a technical book ever was.
>
> Once you get excited about OO and begin using it the first design rule
> to learn is composition vs. inheritance. There is a good chapter on the
> subject in _Java Design_ by Peter Coad.
>
> After that learn how to write unit tests and begin learning design
> patterns. The classic text there is _Design Patterns_ by Erich Gamma,
> Richard Helm, Ralph Johnson, and John Vlissides, commonly called the
> Gang of Four or GoF, but the content of the book has been reproduced
> many times in various other texts and using different languages for
> examples. Any of those that contain a full catalog of the major GoF
> patterns will do.
>
> Eventually you'll want to read _Refactoring: Improving the Design of
> Existing Code_ by Martin Fowler, but some experience using design
> patterns will help.
>
> As far as I know there are no books on design patterns which use Ruby
> for code examples. If Dave is listening he might note that it would be
> an interesting project given that most design pattern texts are based on
> languages which are statically typed. It would be interesting to see
> what gems a pattern book for a dynamically typed language would contain.
>
>
> John-Mason Shackelford
>
> Software Developer
> Pearson Educational Measurement
>
> 2510 North Dodge St.
> Iowa City, IA 52245
> ph. 319-354-9200x6214
> john-mason.shackelford@pearson.com
> http://www.pe...