wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wxruby-dev] Naming questions


From: Richard Kilmer
Subject: Re: [Wxruby-dev] Naming questions
Date: Mon, 26 May 2003 11:28:50 -0400


On Monday, May 26, 2003, at 11:13  AM, Kevin Smith wrote:

On Mon, 2003-05-26 at 07:14, Richard Kilmer wrote:
MethodNameOne -> method_name_one
RICHIsFullOfIt -> rich_is_full_of_it
MethodISITReallyNamedThis -> method_isit_really_named_this

I have been using MixedCase and camelCase so long that I now find the
C/Ruby standard to be completely_ugly_and_offensive, but I do understand
that it's best to fit into your environment. So I may end up generating
aliases for everything--one camelCase and one_with_underbars.

Since you and Curt (aka "my boss") agree on names_like_this, I'll make
the switch. It won't be until my template system is in place, because
then I'll only have to make the change in one place to affect the entire
project (two, if I also want camelCase aliases).


Its the Ruby community consensus on naming...it comes from the fact that its much easier for Japanese readers to differentiate english with _ than case (I think). I actually use aliasing for methods for getters/setters and boolean (?).

Also, methods that return a c/c++ based boolean (1 or 0) I change to
return a Boolean (true or false) and the method is appended with a
question mark (?)...which is a ruby convention for boolean return
methods:

IsThisYourMethod -> is_this_your_method?

I see this as being phase 2: Making the API more Ruby-ish. Another
example is making getters and setters look like attr's. These would also
be aliases, probably, so people could still use the wxWindows docs
without having to do as many mental conversions.

BTW: Class names should be CamelCase...

True. Which is unfortunate for us because in wxWindows, classes are
camelCase and methods are MixedCase--exactly the opposite of Java.

and constants are normally FULLY_CAPITALIZED.

Yes. In wxWindows, constants are already ALL_CAPS (despite what I may
have said earlier).

Thanks for efforts to move this project along...we in the FreeRIDE
group are looking forward to using it (and getting it to work under OS
X :-)

You're welcome! I'm having a great time. Thanks for your input!

Kevin

I'm glad you are having fun...its the best motivator for open-source projects :-) I just built Wx on OS X (2.4) so I am ready to test stuff out on OS X as it moves along...let me know when its to a point I can use it. I am SOOO looking forward to a native look-and-feel on OS X to work with.

Best,

-rich





reply via email to

[Prev in Thread] Current Thread [Next in Thread]