• 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: Refactoring tools available for Cocoa / ObjC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refactoring tools available for Cocoa / ObjC?


  • Subject: Re: Refactoring tools available for Cocoa / ObjC?
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 3 May 2006 04:14:56 +0200

Marcel,

On 3.5.2006, at 2:11, Marcel Weiher wrote:

The simple fact (which you keep ignoring) is that refactoring tools were invented in Smalltalk.

Erm... no, I don't think I "ignore" anything. Just I judge some things irrelevant. For example, regardless where and how refactoring was invented, it still has no reliable way to decide which class the message "intValue" in [[array lastObject] intValue] belongs to (whilst in, say, Java the compile-time information is enough to do this pretty reliably, the more so since reflexion in Java's pretty rotten and used much less often than in ObjC :)).


There may be a point in such a tool if it can do things which (a) reliably enough (b) considerably more easily than other tools (namely regexp search&replace) would allow. All right, point out a few such things.

I've read wiki.cs.uiuc.edu/RefactoringBrowser/Refactoring+Browser's +Refactorings up and down. All the tasks outlined there I can do with a regexp s&r(*) easy enough.

Say, how do you, for example, "push down method"? Unless I got the operation completely wrong from the description,

(i) you move its declaration and definition into another source (**), that's easy enough with plain copy&paste without any special tool at all;
(ii) now you would like to check all [[enum nextObject] thePushedMethod] (and similar) cases in all project sources so as you know whether [en nextObject] happens to be the subclass (in which case it is all right) or whether it is the now method-less superclass (in which case you have to change the code).


Well the description at wiki.cs.uiuc.edu/RefactoringBrowser/RB's+Push +Down+Method does not help much in letting me know whether it does this check at all (and if so how), but knowing ObjC I am pretty sure the tool can do hardly more than make creating those regexps to recognise methods with arguments easier (***): not that great feat, especially given that in ObjC (unlike Smalltalk) "a:b:" and "b:a:" are utterly different things.

(*) presumed it supports properly NIBs and data models: IMHO, the problem with ObjC refactoring is not that there are not specialized refactoring tools which would not help much anyway, but that search&replace does not support NIBs well (actually, I think what we need is a much more readable/editable plaintext NIB representation than the current one is).

(**) naturally the Smalltallk approach somewhat differs, Smalltalk being conceptually database-based. We are in source-based ObjC here though.

(***) which, I do agree, would help: I've got proficient enough in writing things like "\[(.*) rangeOfString:(.*) options:(.*) range:(.*) \]", but still it could help if this is done semi-automatically. Still it would be "only" a smarter syntax-aware regexp (a thing in my personal and perhaps worng opinion in dire need for Xcode, unlike a refactoring tool).

Well, whatever: I am wrong, all right. So do implement an Xcode bundle with re-factoring tools for ObjC; perhaps we'll all -- including me standing humbly corrected -- find them exceedingly convenient. Can't help seriously doubting it, though. If I had the time, I would improve search&replace :)
---
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: Refactoring tools available for Cocoa / ObjC?
      • From: Marcel Weiher <email@hidden>
References: 
 >Refactoring tools available for Cocoa / ObjC? (From: "Eric Lin" <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Marcel Weiher <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: "Eric Lin" <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: Newbe Question: Searching Address Book
  • Next by Date: Updating an NSBrowser as binding selection changes
  • Previous by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Index(es):
    • Date
    • Thread