From: Jonas Hartmann Date: 2005-05-28T03:30:51+09:00 Subject: Re: A different perspective on Ruby. Jim Weirich wrote: > Glenn Parker said: > >>There is no backwards or forwards here. > > > As long as we are only talking asthetics, then I agree that either choice > is co-equal, neither is backwards or forwards. In fact, I would tend to > agree that sqrt(n) is more asthetically pleasing than n.sqrt. oh no! its not at all! n is an Integer object and sqrt is a method on that object so it must be n.sqrt - you could as well implement the third square root of 8 by typing 8.sqrt 3 (I am not such a big math-guy... so maybe you could just send over the whole exponent - 8^(1/2) => 8.sqrt is equal to 8.sqrt .5 is equal to 8.sqrt(0.5) is equal to 8.sqrt(1/2) and so on... well just my ideas on sqrt method - exuse me if its bs ;-( > > However ... > > But if we are talking maintenance (cf. "[sqrt as a method] spreads the > definition out, which complicates maintainence"), then I think it is clear > that the method implementation is (1) no more "spread out" that the > current implementation, (2) simpler to extend to for new types (e.g. > Complex). It is the stand-alone function (not method) implementation that > complicates maintainence. That is the part I thought was backwards. >