Google+ Badge

Thursday, April 14, 2011

Things I don't like about Xcode 4

I have spent the last couple of weeks coding heavily in Xcode 4.0.1 and be sure to upgrade as there are show stopping bugs in previous versions. My experience with Xcode has been less than wonderful over the past half year. There are a number of things that have been annoying me as of late. Might was well vent, why else would you have a blog?

Refactoring does not fully work. When I program in a new environment I want my code to look native. I don't want it to look like a Java guy is writing Java code in Objective C. On my first attempts to do things I have screwed up and named methods and classes poorly. I use Refactor to fix those transgressions. Of course it does not rename everything. In Eclipse I have not had a refactor fail to catch everything that I can remember. Basic steps in Xcode are refactor, build, fix all the errors it left. This is not how an IDE should work. Since you get a preview dialog during refactoring they could add a "do this one" check list it they think something is iffy, instead they do the simple and blow everything else off.

Attempting to change method signatures sucks. Let's say I have initWithTitle and I need to update a line of code to become initWithTitleAndFlags. When I start typing "AndFlags" it wants to put in ALL the parameters, even the ones shared with the original. I have to delete all the crap it added incorrectly each time. It gets really annoying when the IDE attempts to outsmart your typing.

Scrolling through the document with keyboard navigation does not move the text cursor. If I use fn + up arrow to go up a page I expect the text cursor to be on the page I am viewing ready to type. Instead my view just scrolled up a page but my text cursor did not move. I have to click to move the text cursor. To me that is a waste of time and not how pretty much every other editor works.

I use multiple tabs and I am very happy they added tab support to Xcode 4. I have them all open in the order I want then I start debugging. Lets say I have "CaseItem.h" "GroupSet.m" and "GroupHeader.m" in tabs. The active tab is "GroupSet.m" and I run the program. It crashes in "GroupHeader.m", what do my tabs look like? Did the IDE switch over to the already open tab for "GroupHeader.m"? No, that would make sense, instead I get "CaseItem.h" "GroupHeader.m" and "GroupHeader.m" which totally screws up the tabs I had open. Would it have been so hard to find the tab with the file already open in it? Other IDEs do that for me.

The left side view - showing the class list, search, debug etc. stuff, changes based on which tab you select. Of course the debugger changes it too as do other processes. It hardly seems like you own this window. Every tab has its own last setting. Just when I think I expand the class view to show the things I am working on I switch to another tab and it changes. The debugger takes over but when the debugging session ends the window is blank so I have to switch back to the class view. Doing a search leaves the results for some limited amount of time that I can't figure out. I end up redoing searches over and over as the context seems to go out of scope just when I am narrowing down to what I want.

For consistent UI look there is another fail. The Editor and View button sets in the upper left corner appear to be group toggle buttons. The Editor buttons are, only one button can be depressed but the View buttons are not, you can do one or more of the buttons depressed. I don't see a visual difference in the control to let me know that.

On the View side of things I want to see the Utilities pane only when I am on an XIB file but once I turn it on for a tab it stays there for XIB, H and M files. That view sucks for H and M files because as I type it is updating with some sort of help system which I find very distracting. When I am typing code I don't want the editor to be constantly flashing new text in other areas of the screen.

It can't always uncomment code.

// [self goBoom];

   // [self goBoom];

The first line will uncomment with CMD + / but the second line with not because it starts with SPACES. Gee boys, how hard is this to figure out? Nice to make me strip leading spaces to make a keyboard shortcut work.

Classes in sorted order? Sorry bub, do it manually. I have my classes organized in various groups but the files in each group are not sorted and as far as I can tell there is no way to sort them without manually dragging and dropping them. There was a way to do it manually in Xcode 3.x but that has been removed from 4. Why remove it? Why not leave it and enhance it allowing you to turn on an auto sort mode? Look I totally get it if you don't want them in a sorted order, that should be an option, but no way to sort is stupid.

One click zone for both break points and error / warning indications. How many times have I tried to click on the red error icon in the line number gutter but instead I get a breakpoint set? Too many to count especially when using the touch pad. I have an external mouse attached meaning I use it more and more to do things as the touch pad is not as accurate and I end up doing things I don't mean to do like setting a stinking break point. To unset the damn thing I have to click, hold and drag it away. What a cool animation and sound I get for my effort but what a waste of time and mouse movement to do it.

Doing a New File..., telling it which class you are deriving from and having it create the files with errors. Gee thanks for asking what I am deriving from and then NOT including the header file so the first thing I do with a new file with a few lines of code is fix it. Love that auto code generation. Nice taking it that extra mile.

Code reformatting, can a brother have some? Really this should be part of any IDE. I have to reformat all the auto-generated code as we don't put the opening { on the a line by itself. Yes, there are some third party tools but I really should not have to go through that when using a Professional IDE. Oh wait, it is free, so maybe it is not Professional? There are a ton of free IDEs that support this right out of the box.

Plug-in support. Again why write an IDE that does not support plug-ins? That way you don't have to write everything, the programming minions will fill in the holes. I have written plug-ins for Eclipse and for IntelliJ. I have downloaded and used a metric boatload of plug-ins for both. It is awesome. Damn you Apple, you only give us one IDE and we are only allowed to run it your way.

SVN integration is crappy. It does a poor job with even the simple tasks of adding new files or deleting files from the repository. I end up doing a good chunk of my SVN processing outside of the IDE. That is just sad. I can't believe the IDE can't handle deleting files and keeping SVN up to date. I must manually do the "svn rm {file}" every time. Do iOS developers never remove files?

I find Xcode 4 to be sorely lacking as an IDE. I have no hopes of Apple fixing any of the short comings. It is free to anyone paid and signed up for the developer program and competition free so why should they bother? Maybe in house they have some other better tools. Maybe other companies have found other editors to use. People are pumping out apps for iOS using this POS and for many it appears this is the only IDE they have ever used so they think it is perfect as they don't have anything to compare it against. I have used a number of other tools and Xcode pales in comparison.