On Mon August 4 2003 5:38 pm, Brett H. Williams wrote:
> Yes--copied from the app which prompted the question which is implemented
> in C++ with such capitalization.  I realize it isn't the norm, but is there
> another reason you say it's a "bad idea"?

Well, it may work, but Ruby makes decisions on whether something is a class, 
constant, variable, etc. based on leading caps.  You aren't competely free to 
name things as you see fit.

irb(main):013:0> def DoIt; puts "done"; end
=> nil
irb(main):014:0> DoIt
NameError: uninitialized constant DoIt
        from (irb):14
irb(main):015:0> def doIt; puts "done"; end
=> nil
irb(main):016:0> doIt
done
=> nil

So Ruby has decided that DoIt is a constant in this context, but it knows that 
doIt is a method call.  On the other hand, if you supply the (normally 
optional) parentheses to DoIt it works as expected:

irb(main):017:0> DoIt()
done
=> nil

Maybe if you always use parentheses and stuff you can get away with having 
methods that start with an uppercase letter... I just wouldn't do it because 
I don't want to take chances.

Ben