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.

  • Leslie Spring

    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.

  • Sumanth Peddamatham

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

  • footube42

    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.

  • Fabian Lidman

    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. :-)

  • Sultan

    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

  • Julian Brown

    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 …

  • Jasper Bellentree

    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.

  • Moja

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

  • Russell

    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.

  • Joseph

    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…)

  • Michael

    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……)

  • Thaurin

    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.

  • Charles

    Great discussion!
    I started using XCode only for iPhone app development as it's so hot. The IDE truly hinders my productivity, mainly lack of IntelliSense, poor documentation, IDE Window layout, etc. that need major improvement. Even Interface Builder can do much better job. The UI concept may be different or better, it can still make it more ease of use while keeping the underneath generated code in the way to adhere MVC that should make the code more maintainable, but not with compromise of code creation.

  • Teddy

    I agree with the article. But let me add some comments.

    In my opinion the whole difference is not about philosophies. It is more about the workflow.

    The workflow to create something in VS is far much better. Debugger is slick, fast and reliable. MVC could have been automated to some level (like in VC++).
    However some people claim that the maintenance of the code in XCode is easier. I cannot comment it since most of my time I create something. It is very seldom when I have to maintain some old code and recreate the GUI.

  • mike

    Let the truth about macs be told. I prefer macs to windows machines, but why apple cant just make a good developer tool?
    XCode is standing next to the another free app; never mind the usability with multiple windows and the fact that i cannot simply go back (even vim can do it!) in code – debugging is a pain (C++) and 'fix and continue' feature simply never worked for me!

    visual studio overall is the best ide, though i am not a typical ms fan.

  • mike

    i think documentation is ok, in fact apple has solid documentation which i prefer to that of microsoft because of conciseness and to the point attitude. with the other points i agree

  • alexodonnell

    Is there no cross platform development tool?

    This is an interesting post, I am on the point of writing an app that I want on PC and Mac. I am very disappointed no one shouted out in the comments that you should “Just use XYZ, GUI composer and cross compiler”.

    For years I used a UDE (CodeWright) and bolted on compilers, assemblers and linkers, I am an embedded designer mostly. The concept of needing different tools for Mac v's PC seems a little bizarre. There must be, by now, some tool where you can design dialogue boxes and forms in a platform independent way, then use specific board support libraries ( like .NET and what is it, X Code) for ports and OS calls to file/memory.

    It also seems like GUI philosophy is different. Do I hear that I can't maintain look and feel between Mac and PC so my Windows User will get lost on the Mac app. I have to be Maccy on a Mac, and XPish on PC.

    Fantastic. This makes life so much fun that I think I'll just drop the lot and get a job as a fry cook somewhere.

    Thanks to all the commentators, you have enlightened me.

  • Behavior based safety software

    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.

    Back to Phanfare blog home »

© 2007-8 Phanfare, Inc.