GREG NEELEY on 6 Jun 2007 14:17:46 -0000


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

Re: [PhillyOnRails] A simple comparison for a task in Objective-C vs. Ruby on Mac...


To Rail-ites in the City of Brotherly Love,

Hello from Kansas City.

CAVEAT EMPTOR.  For those who who dislike receiving
MS-WORD attachments, please delete this e-mail before
downloading attachments.

Justin R.,

Just a follow-up example attached comparing a simple
Objective-C
program to the same task using Ruby on the Mac. It
sheds some light on naming conventions often used in
Cocoa applications.

You "ain't just whistin' dixie" when you talk about
some awkward
naming conventions in Cocoa, which uses the
Objective-C "NS" calls
in the Foundation Toolkit.

This reminded me of the old days when you wrote X code
and had every line of code beginning with something
like "Xt" or "Xlib" with
the GUI Motif calls staring with "Xm".  When you call
"every animal
in the barn XtHorse or XmCow", I don't think it
particularly improves
readability.

Of course, it was Disraeli who said, "it's easier to
be critical than to be correct", so I thought I'd at
least write a side-by-side (attached as a WORD
file):-)

Hope this helps. I do still enjoy using Objective-C,
and will never give up C entirely.  However, the
"line-by-liner" shows the appeal of using Ruby
instead.  Less LOC to get calculation entities such as
arrays rendered as objects means far fewer headaches
in the maintenance phase, where 70% of project budgets
are spent.

-Greg.


--- "Justin W. Reagor" <justinwr@gmail.com> wrote:

> > Mac graphics with Quartz look promising, too. 
> Thanks
> > for the news on Ruby and Leopard.
> 
> I am not 100% sure, but I think you can use Quartz
> graphics with  
> RubyCocoa. Not sure if it fits your application
> needs or not... but  
> here are a couple links for the mailing list anyway.
> 
> http://rubycocoa.sourceforge.net/HomePage
>
http://metaatem.net/2007/05/27/your-first-few-days-on-rubycocoa
> 
> I completed the small tutorial last night, wasn't
> too bad. But I do  
> hate the naming conventions for Apple's Cocoa
> namespaces.
> 
> Take care,
> :: Justin Reagor
> :: justinwr@gmail.com
> 
> 
> 

_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk