# Tim Bray (Sun Microsystems) on Ruby

**URL:** <https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762>\
**Category:** Ruby\
**Created:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762 "2006-08-15T14:18:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/1 "2006-08-15T14:18:47Z")

</div>

The Director of Web Technologies at Sun Microsystems jumps directly to  
the conclusion about Ruby. “For people like me, who are proficient in  
Perl and Java, Ruby is remarkably, perhaps irresistibly, attractive.”  
[http://www.tbray.org/ongoing/When/200x/2006/07/24/Ruby](http://www.tbray.org/ongoing/When/200x/2006/07/24/Ruby)

---

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/2 "2006-08-15T14:18:51Z")

</div>

On Aug 13, 2006, at 10:35 AM, zoat wrote:

> The Director of Web Technologies at Sun Microsystems jumps directly to  
> the conclusion about Ruby. “For people like me, who are proficient in  
> Perl and Java, Ruby is remarkably, perhaps irresistibly, attractive.”  
> [ongoing by Tim Bray · On Ruby](http://www.tbray.org/ongoing/When/200x/2006/07/24/Ruby)

Just for the archives, at the end of the post it reads:

“Finally, a minor, almost a footnote, issue. I miss polymorphism. In  
particular, I miss polymorphic constructors.”

but Ruby does have polymorphism. I guess he means “method  
overloading” (which can be partially mimicked with default arguments).

– fxn

---

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/3 "2006-08-15T14:18:59Z")

</div>

Hi,

On Aug 13, 2006, at 5:43 AM, Xavier N. wrote:

> “Finally, a minor, almost a footnote, issue. I miss polymorphism.  
> In particular, I miss polymorphic constructors.”
> 
> but Ruby does have polymorphism. I guess he means “method  
> overloading” (which can be partially mimicked with default arguments).

I’m pretty sure he means ‘ad hoc polymorphism’ which is, within half  
the width of a hair, the same as ‘overloading’… though, it does say  
something about his world view. This is one of the only places where  
types/classes are used in CLOS, at least when I write in CLOS. Though  
I love working in Ruby and I understand why Ruby doesn’t support it,  
I too miss this on occasion.

Cheers,  
Bob

> – fxn

* * *

Bob H. – blogs at \<[http://www.recursive.ca/](http://www.recursive.ca/)  
hutch/\>  
Recursive Design Inc. – [http://www.recursive.ca/](http://www.recursive.ca/)  
Raconteur – [http://www.raconteur.info/](http://www.raconteur.info/)  
xampl for Ruby – [http://rubyforge.org/projects/xampl/](http://rubyforge.org/projects/xampl/)

---

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/4 "2006-08-15T14:19:04Z")

</div>

On Aug 13, 2006, at 3:35 AM, zoat wrote:

> The Director of Web Technologies at Sun Microsystems jumps directly to  
> the conclusion about Ruby. “For people like me, who are proficient in  
> Perl and Java, Ruby is remarkably, perhaps irresistibly, attractive.”  
> [ongoing by Tim Bray · On Ruby](http://www.tbray.org/ongoing/When/200x/2006/07/24/Ruby)

Looks like he will be giving the internationalization,  
multilingualization, Unicode talk at RubyConf 2006.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/5 "2006-08-15T14:19:00Z")

</div>

On 8/13/06, Bob H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > “Finally, a minor, almost a footnote, issue. I miss polymorphism.  
> > In particular, I miss polymorphic constructors.”
> > 
> > but Ruby does have polymorphism. I guess he means “method  
> > overloading” (which can be partially mimicked with default arguments).

What I find myself becoming more and more comfortable with is passing  
single hashes to methods that take more than one argument, and single  
arguments whenever possible. (And yes, I started doing this long  
before the recent thread on functional programming :-), much of  
Net::LDAP works this way). I find this to be a perfectly natural  
alternative to polymorphic method signatures (even though the Python  
syntax for this technique is better than Ruby’s).

As far as Tim’s polymorphic constructors go, I also find myself  
avoiding constructors as much as possible in the first place. If you  
have initial state in an object, that means it’s been designed (or  
not-so-designed as the case may be) in a non-composable way. My recent  
Ruby code has almost no inheritance and module mixins all over the  
place.

---

<div class="post-metadata">

**Author:** ![zoat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@zoat](https://www.ruby-forum.com/u/zoat)\
**Post date:** [August 15, 2006, 2:19pm UTC](https://www.ruby-forum.com/t/tim-bray-sun-microsystems-on-ruby/64762/6 "2006-08-15T14:19:04Z")

</div>

On Aug 13, 2006, at 4:43 AM, Xavier N. wrote:

> “Finally, a minor, almost a footnote, issue. I miss polymorphism.  
> In particular, I miss polymorphic constructors.”
> 
> but Ruby does have polymorphism. I guess he means “method  
> overloading” (which can be partially mimicked with default arguments).

Hmm, I would say you would mimic this by accepting any number of  
arguments:

def initialize(\*args)  
if # check args.size and type…  
init\_with\_whatever(\*args)  
elsif # check args.size and type…  
init\_with\_whatever\_else(\*args)  
else  
raise ArgumentError, “#{args.inspect} not a supported call.”  
end  
end

You could generalize this into a library, of course, and I’m pretty  
sure people have.

James Edward G. II
