From: "Jan E." Date: 2012-03-30T05:23:16+09:00 Subject: Re: Why z = Complex(1,2) rather than z = Complex.new(1,2)? Eric Hodel wrote in post #1054029: > > I've never heard that there was a convention to avoid capitalizing > method names, and I've been doing this a long time. This convention is in the Ruby book by Matz and Flanagan, saying that uppercase method names can be confused with constants (which is a bad thing in my opion). So it's not that we made this up. ;-) In Netbeans I even get a warning: "Style: Method names traditionally use lowercase letters only" But it's not so much about conventions. These methods are simply counterintuitive. When I want to convert objects, the first thing that comes to my mind are the to_... methods. But I don't expect someone to pull a magical conversion "function" out of the Kernel module. Honestly, I think even experienced Ruby programmers are confused when they first see something like Float(4) Another problem is that constants and methods have different lookup algorithms, which doesn't allow you to put the conversion method for a subclass into the same containing module/class (unless you use qualified names all the time). All in all, I think those methods really qualify as "Ruby warts" and should be removed as soon as possible. ;-) -- Posted via http://www.ruby-forum.com/.