OSX coding

topic posted Tue, February 6, 2007 - 10:08 PM by  luke
Share/Save/Bookmark
Advertisement
Hello,
I used to code quite a bit. Using C++ and opengl on a windows platform. Its been many years and now I use OSX.
I want to start coding again and I want to build a fairly simple but extentable text editing program.
I am wondering what language i should use. Since i used to code in c/c++ i am hoping to do that. So i am also wondering if there are some libraries to help with the font and graphic display on OSX that people are really excited about.
I am asking this on the tribe, in the hopes that someone might be really excited about a newish way of doing things like this.

Thank you,
Luke
posted by:
luke
Seattle
Advertisement
Advertisement
  • Re: OSX coding

    Wed, February 7, 2007 - 10:52 AM
    I only have periphery experience with the latest Mac stuff, so I'll let the OSXers give the meat and potatoes answers, but I believe the it ships with a full compliment of development tools, supporting C/C++ and Objective C, if not other languages as well.. the whole Xcode tool set looks great, and the I'm sure the framework(s) supplied cover all the things you are hoping for, here is a link with far more info:

    developer.apple.com/tools/

    peace
    -cpr
  • Re: OSX coding

    Thu, February 8, 2007 - 2:34 PM
    Yo Luke,

    I congratulate you on your willingness to get into the Macintosh development business. Having developed for the Macintosh for over a decade, I can give you a few tips.

    First, Apple wants everyone to use their Cocoa application framework. It is probably one of the most mature and frighteningly easy to use frameworks out there. You can put together a working web browser, with history, without writing any code, using only their UI visual editor. There is also support for just about any kind of UI widget you can imagine, font/character handling is probably the best in the business, and the amount of code you need to write is generally minimal. The only downside: you need to use Objective-C for most of the coding. It's not as bad as it sounds, but you do need to learn a new language and the intricacies that entails. It's pretty easy for C/C++ programmers though (probably a few days to learn all the object-oriented syntax). You can also use Java to develop Cocoa apps, but I think Apple is removing Java bindings for Cocoa sometime in the future, so I wouldn't recommend it as a long-term strategy.

    If you don't want to go the Object-C route, you can still use their visual editor, but need to use a different library called Carbon. This is essentially a compatibility library that allowed developers to keep building their pre-Mac OS X applications without rewriting them to a new API. It's C only and doesn't have all the features of Cocoa. For example, there's no application framework from Apple. Metrowerks made a version of their app framework PowerPlant to run on OS X, but Metrowerks doesn't even make Mac tools anymore so I don't know the status of PowerPlant. There are many cool features of Carbon, however, and gives the Win32 API a run for it's money.Given, that the library was originally intended as a compatibility library, and that there's no official application framework from Apple, I don't really recommend going the Carbon route unless you really just hate Objective-C.

    Unfortunately, the development story on the Mac isn't great for C++ developers. You can mix C++ and Objective-C syntax with the gcc compiler, but it isn't ideal and has many limitations. However, if you go Cocoa you will be mightily impressed. Install the Xcode tools, play with Interface Builder, and see what you can create.

    Feel free to post more questions and I'll explain more if needed.

    Doug Hill
    • Re: OSX coding

      Sat, February 10, 2007 - 8:40 PM

      Doug,

      Yeah, I was at WWDC06 and saw how the Apple developer evangelists sighed when they realized that most of us are C++ developers. The thing is, for those of us who write code that has to run on multiple platforms (Windows, OSX, Linux, Solaris, etc.), C++ is really the only choice, esp. if the internet is the distribution mechanism (and if you're thinking Java, try telling a Windows user that they need to download a multi-megabyte JRE just to run your app). C / C++ is really the only way to write small and efficient cross-platform code right now.

      Back to the original question, though, you may want to check out the Qt framework from Trolltech. It's a C++ class library that wraps the OSX goodness, with the bonus that the same code will compile and run on a Windows and Linux machine.

      Macs are great -- I own 2 of them (dual G5 PowerMac and Core Duo MacBook) and I develop on them often (though the code also almost always has to run on Windows as well), but any effort to be platform-agnostic in your coding practices usually rewards you with far, far easier ports to other platforms and architectures.

      Regards,

      John

      Falling You - exploring the beauty of voice and sound
      www.fallingyou.com