From: Rasputin Date: 2003-09-03T08:34:45+09:00 Subject: Re: Python vs. Ruby * james_b [0908 20:08]: > Sean O'Dell wrote: > " > > > >So, in my line of thinking: me.eat(food) > >"Hello world".print to me equates to: food.eat. > > > >I eat. Food doesn't eat. $stdout prints. Strings don't print. > > Isn't this begging the question? > > The argument seems to be, "print has been defined for $stdout, not > string; since strings don't have 'print', string.print would not be not > correct." Think of it this way. When I want a speech synthesis feature added to my application, do I *really* want to add a String#speak method or a Synthesiser#say method? What about when I want morse code? Or smoke signals? Does String need to have a render_as_gif method? And then when I don't need the morse code functionality, do I just stop requiring smoky.rb or do I go through and hack the String class? Don't forget anything else you might want to print - Fixnums, Arrays, serailised digital representations of Willy Rushton, etc, etc. Maintenance nightmare. I did think your hack to add this into String was great though, so maybe the above problems don't apply with Ruby :) Allen Holub is a top author, his 'C Companion' is one of those books I trawl eBay on a regular basis for. But I think he's being a touch fundamentalist in this case. As Malacalypse the Younger would say : 'Death to all fanatics'! -- Rasputin :: Jack of All Trades - Master of Nuns