Programming

Why Xcode And Not Visual Studio(2012)

Hello there fellow programming enthusiast,

So you’ve heard that there has been a new standard(well. not so new) called C++11(ISO blah bla.11) and you are excited to try it on. And you fire your favorite IDE (Visual Studio of course!) and type some code like this amaaaazing nugget right here:

#include <vector>
using namespace std;

constexpr int func() { return 3; }

int main()
{

  vector<int> v = {1, 2, 3, 4};
  return 0;
}

 

Alright, hit F7. What, it doesn’t compile? OK, you install the latest service pack. Still no go?

Maaan. You try to check the C++ settings. What? No settings for C++11? Oops.

Now go to Xcode 5. The latest free IDE from Apple.

Copy paste it. Boom, it compiles. Why, you ask? Because Xcode uses the latest clang with all that C++11 goodness.

Now, arguably some of those new and fancy C++11 features already existed in Objective-C but the target audience of that language is somewhat limited to OS X and iOS developers. There is an open source SDK, GNUStep that can be used on Windows and Linux but what’s really the point at the moment when you can write portable C++(11!) code?

Yes, Xcode has been slow to make developing in C++ and not ObjC more fun but Xcode 5 finally properly indexes C++ code and provides improved variable inspection at runtime. Even for STL objects.

Yes, Xcode uses the best open source compiler at the moment with some modifications (Apple LLVM 5.0 is actually a clang 3.3). You might be inclined to say “hey, they didn’t do any work at all”. But they did, not only they integrated the compiler and the debugger beautifully but they also include CPU and GPU profiling tools out of the box. Something that Microsoft will never do. At least not for free.

So, sorry Microsoft, your compiler is somewhat outdated and your IDE offers for a premium features that others do for free.

BTW, I easily developed a GUI application in Xcode that is cross-platform using wxWidgets.

 

From the 2013 WWDC I got the impression that Apple is working very hard in providing developers with an all-in-one package for their needs. And they are also targeting game developers with their game centric features like Asset Catalogs or SpriteKit.

Take it from a once Visual Studio fan(but also an Eclipse follower too), Visual Studio is not the end all IDE, it doesn’t even support C++11 properly!

 

Hug a Mac today

🙂

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.