Re: VS.NET-style code outlining?
Re: VS.NET-style code outlining?
- Subject: Re: VS.NET-style code outlining?
- From: Erik Hanson <email@hidden>
- Date: Tue, 24 Feb 2004 16:06:55 -0800
On Feb 24, 2004, at 2:46 PM, Jeff Biggus wrote:
On Feb 24, 2004, at 1:58 PM, Erik Hanson wrote:
If a block of code can be collapsed and replaced with a comment, why
not extract it into its own method? That would not only make the code
easier to read, it would increase the chance of reuse and probably
improve the structure of the code. I'd like to see Xcode development
time spent on extracting the method for me rather than collapsing the
code.
This is a different issue. Within any method, there are blocks of code
which the programmer is simply not interested in examining at that
moment and it would be nice to have it collapsable. Making a new
method for each block that I simply am not currently examining would
lead to bad software design, which hopefully you're not suggesting.
I think I am suggesting that.
IMHO, in some (many? all?) cases, a method that is doing more than one
thing is screaming out to be broken into multiple methods. So if I was
reading a method that did multiple things, I would definitely extract
each part into its own method. Readability would be improved (IMO), and
I feel that code readability is very important. It would also increase
the chances of spotting opportunities to remove duplication.
I realize that not everyone prefers having more smaller methods to
having fewer larger methods; it's my preference to have shorter methods
which turn out to have very little need for collapsable blocks inside,
which is why I would prefer that Xcode development resources are spent
on helping me extract methods and not on collapsing code.
For example, often in code optimization one will make a method longer,
not shorter or breaking it up into more sub-methods (as when one
unrolls a loop, etc).
Due to the type of applications I generally write (boring business apps
mostly :), I rarely need to spend time tightly optimizing my code so I
never worry about the performance overhead of the extra methods. I
realize that other people do have to worry about these things though.
Anyway, I didn't mean to bring up an argument about method length or
application design, and I'm not against collapsable blocks. I was just
openly wishing for some refactoring features in Xcode which would
obviate the need for collapsable blocks for me at least.
--
Erik Hanson
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.