A request we have gotten a few times in our inbox concerns how to develop software for the Mac. Usually the person writing is a switcher from the Windows world who has dabbled in Basic, C# or maybe some C++. Once they get their first Macintosh, they realize that they can’t use Visual Studio on the Mac, and pretty much have to start over.
It looks like it uses a Single Document Interface (SDI). I’ve never been a fan. It seems that if they go that route then you should have the option to dock the windows into a main frame.
How does it compare to say Eclipse, VS.NET, IDEA? I think I’ve heard people say “well, it’s free”, which isn’t exactly a glowing endorsement. But didn’t XCode 2.0 just come out with Tiger? Maybe that one is better.
umm.. Mac OS X’s Windowing system is MDI. the entire thing.
I’ve used VS.net Eclipse, and XCode. I have to say that as far as an IDE goes VS.net is probably the best. It irritates me to say that, but give credit where it is due. the .NET platform along with Visual Studio is probably the easiest platform to develope on.
XCode and Cocoa are pull overs from neXt which was created quite a while ago (late 80’s I think) at any rate there is a lot to be said about developing with XCode. Once you wrap your head around the process it’s fantastic.
The thing about XCode that threw me off was that Interface builder was a seporate app. In that you had to launch this app to edit your interface, which was in turn stored in a data file (NIB) and then read later on. With Visual Studio’s .Net and C# in particular the interface is the same file as the code itself. meaning that I can see all the code that is used to create the form that I’m viewin, simply double clicking a button creates a method, and ties that method to an event, all of the code to do this is in plain view and in the same C# file as the rest of the form. To me this is a better mechanism, but it’s not too difficult to get accustomed to XCode’s mentality.
Eclipse is another bear altogether. I know you can use Eclipse for things other then java, but to me it seems that XCode does a better job of native code (C,C++,Objective-c) on the mac, and Visual Studio does a better job doing antive code on windows (C, C#, .NET, MFC) that type of stuff. That left Linux. Whenever I did a project under Linux I felt that Eclipse was the best choice for that platform. Mostly because XCode, and VS.net weren’t available. If they were I would probably have picked them.
SO I guess what I’m trying to say is that for the platform you’re developing for, chosing the IDE that was created by the same company as the platform will probably yield the best results.
Cocoa, carbon, opengl probably XCode
.NET C# VB probably VS.net
and Java, and linux developement probably eclipse
I might even venture to say that developing java apps on a mac might be easier using XCode.
> umm.. Mac OS X’s Windowing system is MDI. the entire thing.
I don’t know that terms like “SDI” and “MDI” really apply on the Mac. In an SDI app, the application and document share the same window. In an MDI app, an application window contains multiple document windows within. However, in general, Mac applications have always used windows to represent documents and the menu bar instead of windows to represent applications.
Use a completely programmable development environment like emacs.
Yeah, I probably confused the terms. In any case, what I meant that I never liked the Glade GUI builder way of presenting windows and prefer docking panels that you traditionaly see in IDES such as VS.NET, eclipse, IDEA, etc..
Ok, thanks for the comparisons. I agree that if there is one thing that Microsoft knows how to do – it’s IDES. I’ve been playing around with VS.NET 2005 Beta 2 and it’s very slick. The debugger is very cool.
Eclipse C/C++ support (the CDT plugin) has gotten much better in recent times. It’s got a realtime parser now, it’ll tag your header files, and the best part of all for me is that eclipse has a vi plugin.
Depends what you want to do with it, Xcode definitely is the best IDE you can get if you do ObjectiveC, however if you do Java you are better off with Eclipse thanks to the excellent, Ant the Refactoring support and the now also excellent editor.
Eclipse is very java centric however, you can program in other languages, but non of those language plugins is really much further than xcode codingwise (that means basic editing, project management, debugging)
Havent had an intensive look at XCode2 so far, but the old XCode most of the times felt more like an IDE from 10 years ago, than a current solution. What was mostly missing was a decent editor and a good refactoring support, which is heavily needed in OO languages.
Here’s the trick:
1. Use a cross-platform development environment (whatever floats your boat).
2. Use a cross-platform programming language (again, whatever floats your boat).
3. Use a cross-platform GUI toolkit (once again, whatever floats your boat).
Emacs/Vi(m)/Eclipse/Nedit/Scite/etc. + C/C++/Perl/Python/Ruby/Java/etc. + wx/PyGame/Fox/Swing/etc.
How hard is that? Oh, I see, you prefer MFC with VB. I’m sorry, better luck next choice of development environment, language, and GUI toolkit.
>The thing about XCode that threw me off was that Interface builder was a >seporate app. In that you had to launch this app to edit your interface, which was in turn stored in a data file (NIB) and then read later on. With Visual Studio’s .Net and C# in particular the interface is the same file as the code itself. meaning that I can see all the code that is used to create the form that I’m viewin, simply double clicking a button creates a method, and ties that method to an event, all of the code to do this is in plain view and in the same C# file as the rest of the form.
In IB you do NOT create source code as in other UI builders, instead you create the real objects which are then serialized in NIB files. In your code you then load these objects dynamically from the NIB files.
That is the real beauty and strength of the system, but it requires the developer to learn a new paradigm.
If they have used Basic on Windows, and they really liked Basic, why would they have to start over? They should simply buy RealBasic. Yes, Cocoa is more powerful than RealBasic, but I’d say that most developers who exclusively used Basic on Windows will be more than pleased with RealBasic.
I for one just recently “switched” a projet of mine (a J2ME app) from Eclipse 3.0 to XCode 2.0 (Tiger). Obviously the main advantage is that Xcode is pretty snappy on my 1.2ghz iBook while Eclipse tends to be very heavy. It was quite faster in Windows (on a faster machine though).
Xcode launches in about 8 seconds and everything is just much more responsive. Another advantage is that (on mac only) Eclipse is just unable to run Ant scripts that launch java apps that require Image support. SWT+Swing/AWT are just incompatible. This means you have to fork every launch of a java app that modifies an image, which is quite slower. With XCode you skip this problem.
Of course Eclipse has some java features like automatic background compilation and most of all Refactoring that I do miss quite a lot. I just hoped XCode 2.0 would bring refactoring but it didn’t, sigh.
Also, Xcode allows you to build java projects that use Ant to build but I can’t seem to be able to mix normal building and ant scripts (except by using Shell Scripts to launch ant, which I did).
How good is Mono on OSX?
I do .net development for my day job and I recently got a mac mini. I’ve been meaning to dabble a bit in OSX/cocoa dev but I haven’t really gotten very far. XCode isn’t as good as vs.net but that isn’t really what has stopped me.. its the crappy documentation and lack of useful tutorials.
Also sample code is hard to learn from because of the amount of ‘magic’ in the way that interface builder does it’s thing. I should realy just buy a book but what can I say, i’m cheap
And if you don’t have a Mac, you can install GNUstep and play with it.
Whenever you are familiar with the paradigm, it will be very easy for you
to switch to Cocoa later. It is also very handy to me to be able to build my Cocoa apps with some gnustep make scripts.
http://www.gnustep.org or irc.freenode.net #gnustep
With Visual Studio’s .Net and C# in particular the interface is the same file as the code itself.[…]
Which is really ugly. I always hated it. It let’s you do all sort of things which should be avoided by any means.
The IB way forces you to do a clean separation. AFAIK, current trends in Java Interface developement go the same way (e.g. JGoodies): Use some sort of configuration file (XML, text) and an interface engine to cleanly separate representation from logic. I’m not a fan of XCode (and haven’t used XCode2 yet) but InterfaceBuilder is IMHO the best part of it.
BTW: Has anybody tried Nib4J ( http://www.nib4j.com/ ) to use InterfaceBuilder for cross plattform Java apps lately? How good is the cross-plattform experience?
For games: http://www.blitzmax.com
I haven’t read anyone say developing for apple is easy. Perhaps if it was that would help them more.
Kabal, I know what you mean. I love the way the “magic” works when programming for Cocoa using IB, but it’s very hard to see how these bindings from a “listing” point of view, that is, from the code itself.
I found Aaron Hillegrass’s book “Cocoa – Programming for Mac OS X” to be a great introduction, but there are good tutorials on the web, I find the O’Reilly website (http://mac.oreilly.com/) to be very helpful, as well as Stepwise (http://www.stepwise.com/) amongst others. I tend to just do a Google search on what I need to know, you tend to find the info there. Once you are used to the syntax and how Cocoa kinda works, you’ll find that Apple’s help and reference from XCode itself invaluable.
I’m very curious to know how good binding to Core Data is going to be…
Official documentation on Objective-C? There you have it straight from Apple, over 140 pages:
http://developer.apple.com/documentation/Cocoa/Conceptual/Objective…
I always find peculiar to say the least when some unknown programmer gurus pop up and start to preach how heavenly it is to code in VB/C# and how out of any reason it is that they can not use their preferred (I’ll translate: the one and only they became able to comprehend over some years of “coding”) MS coding tools and languages on Win or another platform, OS.
Like it or not, know it or not, use it or not, there are some quite nice and interesting tools and languages out there besides your favourite and/or only known one. I’d not like to be an IT engineer in a world where every platform is the same and every language is the same and every tool is the same.
I do quite a bit of coding work under Windows with VS6-.2k3, but I also use Eclipse and DevCPP from time to time, and I also do some amount of coding under Linux, mainly for fun, because yes, I find it to be so. And, believe it or not, recently I came to quite like kdevelop, seeing how much it has evolved. It is quite a tool. You’d need to try it.
Then again, I couldn’t easily imagine my coding days without Perl both in Windows and in Linux, neither without powerful shell scripting, and I could just go on.
My point is, if someone came up to me saying (s)he’s a “programmer” and starting to complain about having too much platforms and tools, I’d kick him out, double feet, far so I can’t see him.
It looks like it uses a Single Document Interface (SDI). I’ve never been a fan. It seems that if they go that route then you should have the option to dock the windows into a main frame.
As some have pointed out, the Mac doesn’t use SDI and MDI. XCode offered some options for different windowing schemes in the past, but at least as I’ve used XCode 2 out of the box, it presents just a remarkably small file browser. Sort of an iTunes like browser of the files in a project. Double clicking a file opens the file in the appropriate application, such as launcing Interface Builder for .nib files, or an editor window for source code. It can be a separate editing application like BBEdit, doesn’t have to be the included editor.
I like it so far. Seems a very clean design.
I’ve been coding in ObjC with XCode for a few years now, after coming from c and java and vb, and I’ve gotta say, once you get used to it, cocoa programming is really quite nice. I’ve even switched my linux developement from vi to XCode.
IB is definitely a key feature, and mac programming really shows its strength if you’re building an app that uses plugins. Its literally just a handful of (short) lines to load and use any number of plugins, because they’re all just bundles: load the code, wake up the .nib, and you’re off!
I agree though that people should use what makes sense for the platform. On Windows, thats VS.NET, but on OS X, its definitely XCode.
I do have one complaint though about XCode, though this may be fixed in 2.0 (I use 1.5), is that theres no support for source trees. Sure, XCode can “group” source files within the project window, but as they sit on your hard drive, they’re all just thrown in the same folder. For a bigger project, this really makes things difficult.
I have been using 1.1.4 for some time (compiling under windows, and copying the Console projects back to mono) and it worked out of the box. The project accesed a SQLServer and used Gentle (www.mertner.com/confluence) to access the database and map objects to tables.
When the “simple” console application was working on windows, I copied the output folder from windows to OS X and did:
mono sampleapp.exe
It worked.
note: the app did a serie of CRUD operations on a few tables. Nothing too fancy, but Gentle itself is quite complex.
I´d like to compile everything under mono, and see if the results still work.
Yep Mono is pretty much there for console apps however on OSX there’s not a lot of development environment past syntax highlighting editors.
Monodevelop is a real swine to compile from source. Pkg-config seems unable to find dll’s every now any again preventing monodoc from working.
Debugging seems right out of the question unless you use gdb which an interesting experience to say the least.
Having said that Gooball is a commercial game written in mono, so it is doable.
Apples odd insistence that command line apps can not have GUI’s means that that there always going to be an extra step for Mac version of Mono software, it won’t be a matter of one install for all.
Nib files can be a pain to merge when multiple people have made changes and are trying to check in.
The project file suffers from this too. It seems to have hashes all over the place instead of file names.
The only barrier for me to wanting to learn how to write native Mac apps is that I have yet to find any way to do layout management. I haven’t been able to figure out how to get anything like Swing’s layout managers or Windows Forms’ anchoring and docking.
@Dave
Having said that Gooball is a commercial game written in mono, so it is doable.
Actually, I’m fairly certain that Gooball itself is not written in Mono, just the scripting engine…
The only barrier for me to wanting to learn how to write native Mac apps is that I have yet to find any way to do layout management
Interface Builder does this for you visually – it’s really very easy, there are guides so that everything snaps into place and you can set what things are attached to etc.
<em>The only barrier for me to wanting to learn how to write native Mac apps is that I have yet to find any way to do layout management. I haven’t been able to figure out how to get anything like Swing’s layout managers or Windows Forms’ anchoring and docking.</em>
Simply set the autoresizing flags in IB (the little spring icons) then, when the parent view is resized, you can specify that the top, bottom, left or right margins along with height and width can either scale proportionally or remain fixed.
PureBasic is a (BASIC derived) alternative.
3.92 is available for both Linux and Windows, and 4.0 release, which is supposed to be a major release, is under development and will include a MacOS version. MacOS 3.xx version is currently beta-testing.
It´s easy to understand, and you can acctually do some impressive stuff with it.
If you, like me, haven´t got the time to learn enough C / C++ to do something useful with it, (im a true multitasker; webdesign, php-scripting, video-production, music-production, layout/design, programming, all other interests like cars and so forth then check realbasic out…
I have been thinking of taking a dive into Objective-C world though, for writing dll:s and such. But the “D programming language” looks promising too to. I could use FreePascal to do that too, which is plenty cross-platform, and by the way can be used with XCode
The mac’s always had a horrible reputation for developers. Maybe objectiveC is wonderful, but what serious SW developer has time to devote to a one-platform niche language and class library? And Apple’s promise to keep a major language like Java as a serious player on the platform has fallen flat with the a one-year lag of the apple version of Java 1.5 behind the rest of the Java world.
The mac’s always had a horrible reputation for developers. Maybe objectiveC is wonderful, but what serious SW developer has time to devote to a little one-platform niche language and class library? And Apple’s promise to keep a major language like Java as a serious player on the platform has fallen flat with the a one-year lag of the apple version of Java 1.5 behind the rest of the Java world.
The mac is not as horrible as windows, at least it shares the core libs the the GnuStep/OpenStep project and also the foundation is very close to Linux and BSD.
In Windows you are basically bound towards Microsoft in every aspect of your development, and every effort (Java HTML etc…) to break you free gets a serious torpedoeing by Microsoft.
It is nice, the only bad thing is it has only one REAL IDE and that is windows only (PBDev). And then costs some, so who knows. Hopefully it’ll be mature enough for RAD on all platforms.
“Maybe objectiveC is wonderful, but what serious SW developer has time to devote to a little one-platform niche language and class library?”
For a serious software developer, Objective C takes an hour to learn if they already know C, its very simple.
I usually do projects in college in Perl, Java and Prolog. I do a bit of scripting too. JEdit is great for me. It looks decent in Mac OS X too. Its FTP plugin that supports SFTP is great too.
I agree with Slava on his view.
It is incredibly vital to not be tied to a platform, and for that matter a language. I was so disturbed when I was looking for a job that all the calls I got were for .NET developement. and that they all asked me how well I knew VS.net. It’s just an IDE people.
Seriously though, if you’re a good software developer, a simple thing like a language or IDE will not get in your way. You do the same things in XCode as you do in VS.net, even VI (or 6 as I call it). I work in VS.net all day long at my job, and it is almost a treat to come home and play in something different.
The NIB thing is a little different the .NET forms, but it’s easy enough to get over it. for me it was more distressing haveing the main modifier key right next to the keyboard (Command key = alt key) . just a little different, one isn’t particularly better, just a little different.
On a few different occasions (one just this past week) I have tried to get into Mac development…. and I just don’t like it. I have found both the Cocoa (Obj-C) and Carbon (C/C++) API’s to be difficult to understand, and definitely both have a high learning curve. At first I really disliked the XCode/Interface Builder approach, but I have come to like it somewhat since. I guess the roadblock for me is that with the native Mac API’s, you can’t jump in and mess around, you HAVE to read *alot* of documentation just to get started… it can be intimidating and frustrating.
I have programmed other API’s (BeOS and Qt notably) that I have found to be much, much more developer friendly.
Also, I have used RealBasic (a VB-alike for Mac and Windows) and found that to be a pleasure to use. I would normally scoff at such a development environment, being more of a C guy, but I’m getting older these days, and more tolerant…
“For a serious software developer, Objective C takes an hour to learn if they already know C, its very simple.”
Someone’s using a bit of hyperbole to prove a point. Doing a good job in going from a procedural language to an OO language will take more than an hour. Do other languages have the same quirks that Obj-C has (ie no objects on the stack, part way between automatic memory management and code driven memory management, syntax that doesn’t look much like C)?
If you don’t like Java (or it doesn’t suit your needs), try Eclipse and wxWidgets. I just like the pairing of Eclipse with wxWidgets because I’m working on a cross-platform app in C++, and it’s just easier to have one IDE. I still run into problems when I try to compile code tested and written on another platform, but at least I don’t have to change my workflow.
Also, has anybody tried the Visual SourceSafe beta? The old version sucked hard… real hard.
I agree about the Qt and BeAPI. I thought that the BeAPI was one of the easiest to use, and I still to this day use it as a benchmark. Qt is similar, but the cost is too much… that’s why I’m going with wxWidgets. Not as elegant, but I think it’s the best free cross-platform API. Still, I sure wish the BeAPI was cross-platform.
I’ve read the first Hillegass book and Cocoa Programming by Anguish et al. Are there any Cocoa texts out there that don’t make a point to say (practically verbatim) “Once you’ve tried Cocoa, you’ll wonder why people haven’t been doing things this way all along” before ACTUALLY DISCUSSING LANGUAGE OR API FEATURES? Let the reader make that determination. Spin in a programming text just isn’t cool.
“Someone’s using a bit of hyperbole to prove a point. Doing a good job in going from a procedural language to an OO language will take more than an hour.”
Not if the developer already knows some OO language, such as Smalltalk or Java, in addition to C.
“part way between automatic memory management and code driven memory management,”
I think a C programmer will have no trouble grasping Objective-C’s memory management. Its just reference counting.
” syntax that doesn’t look much like C)?”
What kind of idiot has problems with syntax after reading a few code examples for 10 minutes? Syntax is 0.1% of learning a language, its the quickest thing to do.
“I think a C programmer will have no trouble grasping Objective-C’s memory management. Its just reference counting.”
If the C programmer is also familiar with an OO language, then you’re right. However, one must still be comfortable with NSAutoReleasePools to manage memory properly, doesn’t one?
“What kind of idiot has problems with syntax after reading a few code examples for 10 minutes? Syntax is 0.1% of learning a language, its the quickest thing to do.”
The same idiots who write these Cocoa texts. Anguish and Hillegass recommend describing arguments beyond argument names (ie [[NSString alloc] initWithFormat: …] while Apple’s “The Objective-C Programming Language” says such extra language baggage isn’t necessary.
Bad example in the last post, try something like [dictionary setObject: forKey:] for an NSMutableDictionary, instead.
I think this describes the power of Cocoa for programming. A couple of grad students working in biology have written some really useful programs. The quality of the programs is astounding and one the programs even got an award from Apple!
Check it out at http://www.mekentosj.com/programs/. They provide the background about how they did it. When they started they knew nothing about programming, not even C. Within 6 months, they had their first Program out.
I think the following describes the power of Cocoa for programming. A couple of grad students working in biology have written some really useful programs. The quality of the programs is astounding and one the programs even got an award from Apple!
Check it out at http://www.mekentosj.com/programs/.
They provide the background about how they did it. When they started they knew nothing about programming, not even C. Within 6 months, they had their first Program out.
Apple has always empowered its users: you always feel that you are in command of the machine and not the other way around. That is why such loyalty.
So basically, coding in C is the future of OS X? I want to program on the mac platform, but I’ll never learn C, I’m a hobby coder not some hardcore hacker Java is fun to play with, put the GUIs are pretty ugly on OS X, so unacceptable.
Is there something comparable to a C# on the mac platform? Am I just stubborn and C is the past as well as the bright glorious future of programming?
> Is there something comparable to a C# on the mac platform? Am I just stubborn and C is the past as well as the bright glorious future of programming?
Python + wxpython
Native on every platforme, work on every OS, simple, powerfull and builtin (except windows)
Heh, well it’s a good thing i’ve been learning Python Hopefully the interface will look nice on OS X, when I get that far!
“I have programmed other API’s (BeOS and Qt notably) that I have found to be much, much more developer friendly.”
Would you please show me some comparative examples in code?