Xcode one ups #region in Visual Studio
I hate regions in Visual Studio. I don’t like the fact you can hide code from my incremental search and scanning eyes. If it is unimportant to me at the moment, give me a mechanism to jump over it.
#region "collapse me"
// you’ll never see me if I’m collapsed.
#endregion
I don’t like that I can’t CTRL+I through them nor CTRL+F will skip them unless you tell them otherwise.
While Visual Studio gives your the ability to skip to the method directly via a dropdown.
The dropdown is nice and all, but the members are in alphabetical order, not the order they are in file. Alphabetical may make sense in some cases, but I usually have related members near each other in the source. When I go look for them in the dropdown, why aren’t they the same.
Xcode does things a bit differently. They line up everything with the order of the members in the file. Also, they let you give clues to the IDE to format the dropdown into sections. Brilliant.
Notice the following lines of source and their related markup of the dropdown.
#pragma mark - #pragma mark Picker DataSource Methods
Pretty awesome huh? The best part is as you move the code around, the markup and members move in the dropdown. A+
2 Comments »
RSS feed for comments on this post. TrackBack URL
Resharper’s File Structure Window (Ctrl+Alt+F) provides similar sweet functionality. Plus you can reorder members via drag and drop, and all the method level refactorings and navigation you get in the normal code view are available within it as well. I like to keep it attaced on the same pane as Solution Explorer and Ctrl+Alt+(F | L) between the two.
@Johs
That is an awesome tip! I haven’t been using the Structure Window, but am sure to start.