Updated: 3/1/2003; 8:04:32 PM.
 
Ockham's Flashlight
Stuart Halloway on software development, technology, and the future.
        

Monday, February 17, 2003

Andy: thanks for fighting the good fight. I referenced your letter in my email to Mr. Coble.
8:06:00 PM    comment []

Because I come from a C/C++ background, I always teach about name collisions using the canonical multiple inheritance example: Cowboy.draw and Artist.draw.

The Ruby folks have a much more entertaining example:

However, there are times when you want to group things together that don't naturally form a class.

An initial approach might be to put all these things into a file and simply load that file into any program that needs it. This is the way the C language works. However, there's a problem. Say you write a set of trigonometry functions sin, cos, and so on. You stuff them all into a file, trig.rb, for future generations to enjoy. Meanwhile, Sally is working on a simulation of good and evil, and codes up a set of her own useful routines, including beGood and sin, and sticks them into action.rb. Joe, who wants to write a program to find out how many angels can dance on the head of a pin, needs to load both trig.rb and action.rb into his program. But both define a method called sin. Bad news.

Kudos to David and Andrew for writing a great Ruby book, and for putting it online. All programming books should be available online.
1:22:07 AM    comment []


© Copyright 2003 Stuart Halloway.
 
February 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28  
Jan   Mar

About me

Teaching
The book
Speaking
Articles
Bio
CV
Java/COM/Win32 interop
Jawin
Contact


Subscribe to "Ockham's Flashlight" in Radio UserLand.

Click to see the XML version of this web page.