Re: Newbie questions about XCode
Re: Newbie questions about XCode
- Subject: Re: Newbie questions about XCode
- From: Julian Wood <email@hidden>
- Date: Wed, 3 Feb 2010 13:21:15 -0700
Well, I'll chip in as someone who has recently moved from IntelliJ over to Xcode.
Xcode is not so bad once you get to used it, but it is no IntelliJ. I see some religious overtones in this thread - people defending their favourite IDE, but there is lots to be gained by comparing the two editors. I see people railing against code generation, but there is no getting away from the simple fact that code needs to be written, and any tool which writes some of that code for you (exactly as you want it), helps. That is exactly what IJ can do. It does not get in your way, it doesn't harass you, nor does it produce code that you don't want, or need to delete, or anything of that sort. It simply helps you write your plain old code (much) faster.
That said, here are some of the things I miss from IJ, along with how I've tried to accomplish the same thing in Xcode:
- Tabbed UI. Simple navigation that you can see, among the files you want open. This is really a mess in XCode. I use a combination of the following:
- shift-opt-cmd-left and right (last page), more than opt-cmd-left and right (last editing place), but XCode often seems to forget files or go to the wrong place.
- shift-cmd-d to jump to a file (would be nice to have camel-completion here too)
- opt-cmd-up to jump between header and impl
- sometimes ctrl-1 and ctrl-2, but the list is so large for ctrl-1 it is basically useless
- Xcode keeps forgetting that I close off the file list (shift-cmd-E)
- typically Xcode will have 1 file highlighted in the group tree, 1 file listed in the file list area, and 1 file in the editor -> all are different!! very confusing; the title in the window and the ctrl-1 dropdown are correct
- shift-opt-cmd-t to reveal in the group tree, where you can use arrow keys or the first few letters of a file to move around; tab 3x to get back to the editor
- cmd-w. unfortunate choice of keys for us Mac users, but it is easily changed, or you just get used to it.
- this cmd takes your cursor position and selects the text around it, in context
- you just keep pressing the key combo, and it selects more in context
- you could for example, place your cursor in the middle of a string, press cmd-w, and it selects the word first, press again and it grabs everything between the quotes, again and it grabs the quotes and the ampersand, again and it grabs the method invocation(between the [ ] ), again and it grabs the method body, again and it grabs the method definition and body... you get the idea - it is the most powerful key cmd I have ever used
- in Xcode, you use standard cursor cmds -> cmd-left, opt-left, shift-left, shift-cmd-left, shift-opt-left, etc
- I was going to say refactoring - my first few experiences with refactoring in XCode were that it took forever and it didn't work - so much so that I opted to never use it. Trying a few refactors now seems to indicate otherwise. Refactoring is still far more sophisticated in IJ, but this is a good start.
- jump to definition
- this is cmd-dbl click in xcode, but why can't i have a key combo?? in IJ, cmd-b (to interface if that's the case) and opt-cmd-b (to a list of impls)
- find usages
- rather than doing a generic find, it actually finds in context (cmd-f7 in IJ)
- quick help
- shift-ctrl-cmd-/ but you can't close the window with a key cmd, and so it gets in the way, and it also slows things down because it is always looking up stuff (ctrl-j in IJ)
- implementing an interface (protocol)
- write me stubs of all mandatory methods in a protocol? or how about letting me choose which methods I would like to implement?
- autocomplete nitpick
- I often have a full symbol written eg. UIControlStateNormal and I move the cursor just after ...State and press esc or f5 to get an autocomplete list. I then select one(eg UIControlStateDisabled), but it doesn't replace Normal (it gives you UIControlStateDisabledNormal). In IJ, you press tab to replace and return to insert. Just one of those little things that saves a lot of time.
- camelHumps everywhere
- autocomplete, moving cursors, selecting, jumping to code
- commenting!! how could commenting be so difficult? I've grown to get used to xcode style of commenting, but it took me a while.
- in xcode, you must select the entire line or move to the beginning of the line and press cmd-/
- any irregularities in your selection, especially when uncommenting, will screw it up
- any irregularities in where the slashes are will screw it up (ie 1 tab off the start of the line)
- cursor in any other part of the line will put comments right there
- no cmd for /* */ block commenting
- in IJ you just hit cmd-/ and it is smart about toggling the comment (opt-cmd-/ for block comment), regardless of cursor position, selection, or // position
Check this out for more XCode cmd help:
http://www.1729.us/xcode/SnowLeopard/Xcode Shortcuts.pdf
Overall, I would say that is a pretty small list. There is lots more in IJ but I would say these are the things I miss the most. They seem to have thought of every time-saving little detail possible. And it's all presented so that it's discoverable as you dig, never overwhelming to beginners (it's not there until you look for it), and configurable for advanced users. It's quite astounding really. Xcode is coming along though - I am fairly productive with it. I've written some scripts for use with Xcode, btw, and I've looked around for others to fulfill my needs - the above points still stand so far! Accessorizer does look interesting, btw.
Cheers,
Julian
On 2010-02-03, at 9:28 AM, Matt Thomas wrote:
> They're all interesting ideas and Xcode users will be the first to admit that Xcode has room for improvement. I personally use TextMate when I need a bit more "Power" from the text editing portion and run a couple shell scripts for the building process.
>
> Lately, Apple has been allocating more resources to improving it. I've seen a lot of improvements from each new point release (even between 3.1 and 3.2). You should definitely post your feature requests at http://bugreport.apple.com and advocate to other developers to dupe these requests. Apple tracks these (and how many people dupe them) and if a feature is popular enough it might be added. Be weary though, as a developer you know that even a seeming small feature can lead to a lot of development effort.
>
> Finally, you might want to check out http://www.kevincallahan.org/software/accessorizer.html as a companion for quickly creating code.
>
> -Matt
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden