• 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: Java vs. Objective-C for Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java vs. Objective-C for Cocoa


  • Subject: Re: Java vs. Objective-C for Cocoa
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 24 Apr 2005 00:38:32 +0200

Jonathon,

On 23.4.2005, at 23:53, Jonathon Mah wrote:

Of course the tool can easily find in the NIB that "doThis:" is sent(*). How on earth though would it know whether the actual receiver is an instance of the former class, or an instance of the latter one?

It asks you. You say yes or no and it does its stuff, saving you a lot of time.

I respectfully doubt the conclusion.

Since you would in a number of cases check the code anyway, I am pretty convinced it would not save any time worth speaking of, if compared with a regexp search&replace, which, after all, does this too.

I do know there are cases when a "smart" re-factoring tool can do more than regexp, that's without any doubts.

What I am trying to point out though is that, in ObjC/Cocoa typical code, there is a little number of them and a vast majority of those Yes/No cases -- such a vast majority the "smart" tool actually does not help at all. What about those typeless containers? Although the code I just sent to Marcel is in my estimate the most common one, an alternative of

for (id en=[array objectEnumerator],id foo;foo=[en nextObject];) [foo whatever];

would be, I fear, quite often used too. I would even dare say a theoretically improper (but perfectly functional) code of kind

...
NSString *s=[en nextObject];
if (![s isKindOfClass:[NSString class]]) s=[s description];
...

would be pretty common in ObjC!

These are, I fear, *very common* cases the automat would bring more problems that it would solve, since -- and again, do please correct me if I am wrong -- the probability the code would be mistaken of what actually happens, OR EVEN the programmer would be lead astray by a false belief the automat "knows what it is doing", is pretty vast.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Java vs. Objective-C for Cocoa
      • From: Keith Ray <email@hidden>
References: 
 >Java vs. Objective-C for Cocoa (From: "Zacharias J. Beckman" <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Rick Kitts <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: John Stiles <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: "Zacharias J. Beckman" <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Rick Kitts <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Ondra Cada <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Thomas Davie <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Ondra Cada <email@hidden>)
 >Re: Java vs. Objective-C for Cocoa (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Re: Java vs. Objective-C for Cocoa
  • Next by Date: Re: Java vs. Objective-C for Cocoa
  • Previous by thread: Re: Java vs. Objective-C for Cocoa
  • Next by thread: Re: Java vs. Objective-C for Cocoa
  • Index(es):
    • Date
    • Thread