Skip navigation.
 
mlRe: Java vs. Objective-C for Cocoa
FROM : Ondra Cada
DATE : Sun Apr 24 00:38:32 2005

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_removed>              http://www.ocs.cz
private        <email_removed>            http://www.ocs.cz/oc

Related mailsAuthorDate
mlJava vs. Objective-C for Cocoa Zacharias J. Beckm… Apr 22, 20:14
mlRe: Java vs. Objective-C for Cocoa Scott Stevenson Apr 22, 21:49
mlRe: Java vs. Objective-C for Cocoa Marianne Kern Apr 23, 00:04
mlRe: Java vs. Objective-C for Cocoa Zacharias J. Beckm… Apr 23, 00:16
mlRe: Java vs. Objective-C for Cocoa Don Yacktman Apr 23, 01:53
mlRe: Java vs. Objective-C for Cocoa Rick Kitts Apr 23, 04:44
mlRe: Java vs. Objective-C for Cocoa John Stiles Apr 23, 06:46
mlRe: Java vs. Objective-C for Cocoa Zacharias J. Beckm… Apr 23, 19:29
mlRe: Java vs. Objective-C for Cocoa Rick Kitts Apr 23, 20:15
mlCocoa Apps on Windows was: Re: Java vs. Objective-C for Cocoa Lars Sonchocky-Hel… Apr 23, 21:02
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 23, 22:29
mlRe: Java vs. Objective-C for Cocoa Thomas Davie Apr 23, 22:43
mlRe: Java vs. Objective-C for Cocoa Rick Kitts Apr 23, 23:30
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 23, 23:41
mlRe: Java vs. Objective-C for Cocoa Jonathon Mah Apr 23, 23:53
mlRe: Java vs. Objective-C for Cocoa Thomas Davie Apr 23, 23:58
mlRe: Java vs. Objective-C for Cocoa Marcel Weiher Apr 24, 00:13
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 24, 00:30
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 24, 00:38
mlRe: Java vs. Objective-C for Cocoa Keith Ray Apr 24, 05:08
mlRe: Java vs. Objective-C for Cocoa Zacharias J. Beckm… Apr 24, 06:18
mlRe: Java vs. Objective-C for Cocoa Zacharias J. Beckm… Apr 24, 06:38
mlRe: Java vs. Objective-C for Cocoa Todd Blanchard Apr 24, 08:36
mlRe: Java vs. Objective-C for Cocoa Marcel Weiher Apr 24, 10:41
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 24, 11:50
mlRe: Java vs. Objective-C for Cocoa Thomas Davie Apr 24, 12:24
mlRe: Java vs. Objective-C for Cocoa Marcel Weiher Apr 24, 13:04
mlRe: Java vs. Objective-C for Cocoa Ondra Cada Apr 24, 15:55
mlRe: Java vs. Objective-C for Cocoa Thomas Davie Apr 24, 16:43
mlRe: Java vs. Objective-C for Cocoa Todd Blanchard Apr 24, 17:54
mlRe: Java vs. Objective-C for Cocoa Keith Ray Apr 24, 18:00
mlRe: Java vs. Objective-C for Cocoa Jonathon Mah Apr 25, 01:39
mlRe: Java vs. Objective-C for Cocoa Roarke Lynch Apr 25, 04:58
mlRe: Java vs. Objective-C for Cocoa Scott Ellsworth Apr 25, 20:23