Re: Refactoring tools available for Cocoa / ObjC?
Re: Refactoring tools available for Cocoa / ObjC?
- Subject: Re: Refactoring tools available for Cocoa / ObjC?
- From: Scott Ellsworth <email@hidden>
- Date: Mon, 8 May 2006 12:08:20 -0700
A general discussion of refactoring likely belongs on the xcode list;
the specific points below are cocoa-specific. I hope.
On May 3, 2006, at 11:51 AM, Keith Ray wrote:
"rename method or class" refactorings are only a two of the
refactorings that people do. See
http://www.refactoring.com/catalog/index.html for a list.
Let me throw in some usage information. According to IDEA, I have
used the following features over the last few weeks, while working on
a few database apps in Java. I suspect I would use the same tools to
the same degree were they offered in XCode, as I find myself missing
them.
Basic code completion 1346
Syntax aware selection 853
Finish lookup by special character 127
Rename 97
Variable name completion 28
Replace By when using lookup 26
File structure popup 11
Move Innner Class out 11
Smart Type completion 10
Introduce Variable 7
Comment/Uncomment selection 5
Class name completion 3
This does miss the many, many usages of safe delete, introduce
constant, and extract method, which this tool does not track.
XCode has some of the 'basic code completion' features, but not all.
For example, you can use camel case - e.gM(hit control space) brings
up getMessage on Exception e. Not a big deal to skip two letters,
but having it get the right thing when you hit aAE for
addActionListener is kinda keen.
The smart type completion would be of less use for ObjC in most cases
- it knows the declared return type, but the very common case of
adding an object to a collection would not give it any return type to
work with.
Renaming a variable, method, etc., is very keen. This is what we
have been debating, and it appears I do this several times an hour
when my editor is running.
Extracting methods, variables, and constants is surprisingly powerfu;
I use that dozens of times a day. A simple copy and paste can do the
basic work of extracting the use you are looking at, but it also
looks for the same kind of code in other methods and classes, which
means that truly common code can get refactored fairly inexpensively.
This is Java, which is fairly strongly typed compared with ObjC.
That said, I believe that much of the same information is available
to a type-aware analysis system. As long as a tool can track what
goes into a collection, it can track the types that come out.
Scott
_______________________________________________
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