• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjC Method naming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC Method naming


  • Subject: Re: ObjC Method naming
  • From: email@hidden
  • Date: Mon, 28 May 2001 18:22:50 -0700

Well, I'm probably gunna be smacked for saying this, but how about this
for anyone still stuck on C++ thinking?

#define SetRect(theRect,x,y) [theRect setWidth:x height:y]

::ducks::

Alright, just kidding, I dont actually think you should bastardize Obj-C
like that. At first I was really opposed to typing more, but suddenly I
realized the Obj-C way was a Good Thing

1) No more calls like DoSomething(&wind,NULL, kDocumentWindowType, true,
NULL, NULL, -1L); I'm sure you've all had to write code like that
before!

2) I ported an app to cocoa with little to no knowledge of objective-c
while at WWDC in a few hours - the app written in the Macintosh Toolbox
took months to make... I suddenly dont mind writing [theRect setWidth:x
height:y] instead of SetRect(&theRect, theRect.left, theRect.top,
theRect.left+x, theRect.top+y); Wait - suddenly Obj-C is looking pretty
nice, thats even LESS typing. :-)

But seriously, typing 20-50% more than in C++ is definitely acceptable
since you no longer have to write (and debug!) thousands of lines of
code just to power your big complicated Mac-like GUI.

Just my 2 cents - its all I have left after paying to attend WWDC ;-)

Mike Margolis
yes, I was that kid who was in the cocoa feedback session and told
the story of porting to cocoa in a few hours if you were wondering.


  • Prev by Date: Re: filesystem notifications
  • Next by Date: NSBrowser woes
  • Previous by thread: Re: ObjC Method naming
  • Next by thread: Re: ObjC Method naming
  • Index(es):
    • Date
    • Thread