Views from Phanfare CEO and Co-founder Andrew Erlichson

Link Xcode vs. Visual Studio

If you are writing a full featured GUI application for Windows, you spend your life in Visual Studio. On the Mac, you use Apple’s Xcode.

Before writing Phanfare Photo for the Mac, most of my development experience had been in Windows. I installed XCode. Within 10 minutes I had a ‘hello world’ application displaying a window on my screen. So far, so good. Over the next few weeks I spent hours trawling the Apple documentation and popular community development sites like CocoaDev and Cocoabuilder trying to absorb as much as I could about my new development platform and its nifty visual effects (who doesn’t love the genie?).

Xcode’s rich key mapping system helped ease my pain of transition. Visual Studio has this too, but since I started on Windows, I just used the default bindings there. I was quickly able to get Xcode to respond to the keys I had been patterned to hit; for example I find Apple-Shift-Right Arrow to select forwards on a line to be a little painful, so a rebinding to Shift-End made my hands thank me.

Xcode provides a flexible tree listing, a code editor with syntax highlighting, and Microsoft-like IntelliSense to automatically insert method definitions for easy coding. It all sounds great on paper, but as they say, the devil is in the details. Xcode still insists on opening separate windows for every task, or splitting views to such a degree that all important information is hidden behind scroll bars. Visual Studio, by comparison, keeps your desktop orderly through a tabbed interface and a powerful toolbar system that can be moved anywhere. A picture is worth a thousand words.

Here are two screenshots: both are of simple projects that contain a window and a button. The Visual Studio interface is clean and uncluttered. By comparison the Xcode interface is painful to use. You may think I purposefully opened up all these windows to try to make Xcode look bad, but this is actually what my desktop looks like on a normal day, and you can reproduce this yourself by adding a window in Apple’s Interface Builder, building the project, and then running the debugger.

Visual Studio integrates its debugging and build warning functionality right into its main interface, which is much more intuitive to me. Xcode, on the other hand, presents new windows for everything and then adds confusion by allowing each to have its own code view and inconsistent behavior. Clicking on a build warning will not reuse your existing code editor window, but instead open the file in the split view at the bottom (where, unless you maximize the window, you can’t see anything), and double clicking the warning will just add to the mess by opening an entirely new window! This may sounds like nit-picky stuff, but when you spend your entire day in an IDE, these details matter and affect your productivity (and your sanity).

Both products feature automatic code completion (“Intellisense� in the MS world), but once again Visual Studio has the more polished and useful implementation. The Visual Studio Intellisense system, which I fell in love with in the mid-90’s, just plain works across every language and every project – it’s incredible to be able to change a function definition in a library and jump to an entirely different project and have it appear right away. It’s so powerful, providing small descriptions of the functions and parameters, that when I was teaching myself .NET I rarely had to look up documentation: I could simply scroll through the list and read about what things did.

Now I’m not sure how long Xcode (or its previous versions) has had auto code completion, but they are clearly playing catch-up to what is one of Microsoft’s best features. Apple’s auto code completion breaks in so many ways that it can’t be depended on. Most of the time it will display a list of every symbol defined in the entire universe. It is not only slow, but painful to sort through the choices if you don’t know what you are trying to find because Xcode’s implementation provides only a minimal amount of information, lacking descriptions and usage information. Xcode’s behavior around when it actually updates symbols is so unpredictable that even after living and breathing in the Xcode IDE, I don’t have a good feeling for when it gets updated. If Apple wants to help adoption of its platform with developers, this would be a good place to focus their efforts.

For an IDE that has been around (under different names) for the past decade, there seemed to be so many bugs in Xcode that I found myself banging my head on the desk daily. Simple things like windows not responding to keyboard input or not updating properly to major issues like exceptions popping up while typing in the code editor plagued my early development process. No software is perfect, but with Apple’s push towards polish in the rest of their product line I felt that they left out the developer tools.

Now, we know the ending to this story. The Mac version of Phanfare Photo exists, so I did survive the experience of Xcode. In fact, to my surprise, once the code base hit around 20,000 lines, I was moving around just fine and making good progress on the Mac. While XCode is no Visual Studio, its deficiencies are not insurmountable to writing code.

Next time, I will be talking about GUI development on the Mac vs. the PC.

12 responses to “Xcode vs. Visual Studio”

  1. Leslie Spring says:

    XCode’s default layout is the “traditional” multi-window hell, but you can use the “All in One” layout to get a more integrated, Visual Studio-like feel.

  2. Sumanth Peddamatham says:

    Leslie beat me to it, but thanks for the great writeup!

  3. footube42 says:

    Visual Studio > Eclipse > Xcode

    Begin Rant:
    I use Eclipse @ work and find it deficient next to Visual Studio. Xcode is even worse. Apple seriously needs to build a robust IDE. And what about something equivalent to MSDN? The layout and structure of ADC needs a serious overhaul as well. While I’m dreaming, I’d also like to see more code samples similar to Flex docs “View the examples” link. Don’t even get me started on Objective-C as a language…
    End Rant.

  4. Fabian Lidman says:

    I agree with most of what you say. However, if you use Exposé (one of the best features of Mac OS X) to get a birds-eye view of all those different windows in Xcode, it quickly becomes more mangeable. I often find myself needing to keep multiple source files open to read and compare, and just switching back and forth between them in Exposé feels way faster than clicking a tab.
    Also, build results and console output can be hidden behind the source code while you are editing it, and then quickly accessed using Exposé when you run the project. Better for concentration. :-)

  5. Sultan says:

    Xcode is fine if you know how ton use it.
    Xcode-Preferences-General-Layout : All In One
    That might help you :)
    It pays to read release notes

  6. Julian Brown says:

    Perhaps it’s an unfair comparison becuase Visual Studio costs $$$ while Xcode is essentially free but in my opinion VS is in another universe compared with Xcode. Apart from problems with Xcode already mentioned here, how about the following:

    1. Debugging in Xcode is a pretty painful experience because (a) it’s highly prone to crashing for no good reason, (b) you can’t see variable values by hovering the mouse cursor over the code as you can in VS, (c) the default key bindings for stepping thru code are totally bizarre (you have to press three awkwardly placed and unmemorable keys simultaenously to step forward one line - unlike VS which uses F10 and F11 - don’t tell me about changing the keybindings - that didn’t work properly when I tried it.

    2. The Interface Builder - is a pretty ghastly add-on to Xcode becuase (a) it’s not really integrated into Xcode and (b) it’s totally unintuitive in the way you connect up controls to the code. You have to do all kinds of weird stuff from adding lines of code in a header file and dragging the header file over the Interface Builder app to drawing connector lines while you hold down the shift key from the the UI panel to some other window. In VS on the other hand everything is so much simpler. You simply drag a control from a toolbox onto your form and click the control and voila VS adds event handler code for responding to button clicks, combo drop downs and so on. No fuss no muss.

    3. VS built apps seem far more stable compared with app built in Xcode. Xcode apps seems to crash for all kinds of weird reasons - it’s often very difficult to figure out why an Xcode app crashes especially when you look at the stack trace and see the thread that failed was one that was executing code deep inside one of Apple’s Frameworks. In VS, however, a crash is much more likely to originate in your own code and the chances are the stack trace will point you to the source of the problem directly.

    4. .NET code is so much nicer than Objective-C but that’s another stpry …

  7. Jasper Bellentree says:

    That last bit os just baloney. Xcode apps are build with gcc which is as robust a compiler as Microsoft’s, perhaps better, although the Intel compiler is best of all.

    I too much prefer Visual Studio too Xcode, but it’s all bout the IDE, not the quality of the build output. Also, I’ve seen plenty of stack traces deep in MS code so I don’t see any difference on that front.

  8. Moja says:

    You know what, Xcode is stupid. Visual Studio is a way better than that IDE.

  9. Russell says:

    All these IDEs pale in comparison to Eclipse. If you’re not using it, don’t waste another minute fighting with either of these frustrating IDEs.

  10. Joseph says:

    Eclipse is a java IDE. Having used eclipse and vc++ 6/7 extensively they’re really 2 different beasts. For C/C++ programming VC is amazing. I hate to tip my hat to anything that Microsoft puts out, but if there’s one thing MS has done well - it’s the vc++ IDE.
    There are alot of nice features in eclipse - the plugin system by far is the best feature allowing you to plugin database browsers for example - something you cant do in vc++. However, overall it’s interface is not as intuitive and it’s debugger is not even close to vc++. Vc’s ability to do stack traces, mouse over of variables to get current execution variables, etc. is very valuable. My one complaint with vc++ is it’s annoying ability after version 6 to link Microsoft specific CRTs to any app that it builds (which is why vc6 is still floating around…)

  11. Michael says:

    Nice post, but I don’t agree with all points :)
    VS is a very good IDE, you are right, IntelliSence and and screen layout is extremly good and easy to use. I’m .NET programmer and like it very much.
    But VS is a windows application, it fits the OS with it’s office etc. I guess, most of you guys are also programmer for windows, so you are used to the windows os concept.
    So it’s quite hard to compare it with an IDE of MAC. Apple’s OS has a completely different GUI concept than windows. So you guys look at the apple IDE and complain that it’s not like your are used to, a bit to short look on a product right?

    Julian complains the Interface Builder is not intuitive. Can be, if you are not used to. Have you ever heard abput MVC?XCode completly separates code and GUI. Look at VS and you find the greatest mix between GUI/Code/Business Logic. So again a completly different concept!

    On the other hand, the IntelliSence from VS is really top, and XCode is no match for it, with that I agree!

    The main thing I don’t like on VS is the performance. VS can drag down the whole OS just while opening a Solution (just u few XML files……)

  12. Thaurin says:

    The main thing that I love about Xcode and hate about Visual Studio is indeed the performance. Visual Studio (as well as SQL Server Management Studio) drags and it often frustrates me when I have to wait for the UI designer to load *again*. I don’t know what happened, but somewhere along the line, Microsoft made its UI code bloated.

    I agree that the multi-window approach is an acquired taste. It is basic NeXTSTEP UI philosophy, as far as I can tell. It’s much more prevalent on UNIX systems and you have to get used to it if you’re not.

    I’m also a .NET developer, but I guess I’m saying that Xcode deserves a fair chance.

Leave a Reply

    Back to Phanfare blog home »

© 2007-8 Phanfare, Inc.