RSS

Cocoa is for You, Indie Developers: Taste the Chocolate

xcode.pngThere are a lot of reasons these days for developing for the Mac. With the technologies included with Cocoa, programmers are having to do less and less mundane tasks. This free time allows for more hours to be spent on new innovation. Not only does Cocoa offer a vibrant toolkit of built-in features, it also is steadily advancing. In October we will be able to leverage tons of new technologies. Cocoa, or really the Mac platform, offers developers a unique experience that helps make shareware development an actual job opportunity.

Cocoa gives us three real reasons for great development. We have super easy built-in tools, an evolving future, and great monetizing possibilities. I thought it would be useful to delve into some of these reasons in order to convince some new programmers to give Cocoa and the Mac a look. Hopefully I can convince starter developers to really take up Cocoa. Let’s get started.

Built-Ins: Fast-Forward Development

There are five great examples of what Apple gives programmers for free that cuts back on boring development time, and in turn let’s developers design killer features.

Web Browser in Seconds

webkit1.pngHeard of WebKit? It’s Apple’s open-source web rendering tool. It’s built right into Cocoa. Just include the framework, drag a WebKit window into your interface, hook up a few connections, and you have a dead simple browser right in your app. This is such an amazing feature. I’ve wanted to allow certain web-rendering views in a few of my apps, and the fact that it takes me seconds is even better. This cuts out so much development code. For one, you don’t have to program your own HTML rendering engine, nor do you have to purchase someone else’s. You get it free, and it works amazingly. The WebKit team also designed a fairly good API around it, so you can override a lot of the browser’s functions and do as you like. There’s a lot of future in incorporating web sites into applications, and you’re able to do that with Mac easily.

Spell Check is Deadly Simple

Ever thought of writing a spell checker? This can be quite the task let alone compiling a dictionary of words. In Cocoa, you automatically have spell checking built in. Text Views will draw the infamous red squiggle under misspelled words, and a simple control-click will let your users correct their spelling mistakes. There are a few great advantages to this beside having to devote development time to implementing your own spell checker. For one, you get the integrated OS X feel for free. Any mac user will instantly be able to use spell checking in your app because they’ve seen it hundreds of times in other apps. You also have a centralized dictionary. Ever write a lot in TextEdit but then also use Microsoft Word? If you’ve used words the dictionary doesn’t know and then made it learn them, they won’t be available in the other application. Microsoft made their own spell checking algorithm and bases it off of their own dictionary. What does this mean for you? If someone adds a word to the OS X dictionary in one app, your app will reflect that addition.

CoreData

Writing and reading data files on OS X has always been easy with Cocoa. You could always write custom encoder methods and then do initWithCoder:, etc. But now, since Tiger’s release, we have CoreData. This great technology lets you model entire classes in GUI instead of code. It then makes it dead simple to create new objects from those classes. You can save these classes to a data file in one command, save:. How easy is that? This basically has overridden the need to create Model classes based on the MVC idea. So instead of spending lots of time on setters and accessors, you can just model your data simply. I’ve just recently started doing CoreData and have just scratched the surface. What I’ve seen and used has really impressed me, and there’s still more it can do.

Interface Builder & Bindings

ib.pngIf you’ve ever tried to design interfaces in Java, you know how much of a pain it is to do buy code. Using layout managers is just not the right solution. Apple gives developers, in my opinion, the best interface designing application, Interface Builder. I’ve found it to be much easier to use and more full featured than things like Visual Basic. What’s really IB’s strong-point is the ability to use Bindings. Back in the day, you’d have to write glue-code to make sure that changes to your model files were updated to your view. Now, all that code in your controller classes is not needed. You simply link certain data values to the objects in your interface and they are constantly in sync. You use this when doing Preference windows and all over your interface. It’s surprisingly easy, and unbelievably useful.

Interface with C and Carbon

The choice to use Obj-C had a lot of reasons. One of the perks, though, is that Objective-C is built right on top of C. This means that you can always drop down and do C calls. This might not seem too useful, but there are a lot of advantages. If you do have old code written in C, you could use it; however, more importantly, you can make use of the extensive Carbon APIs. Before Cocoa, Apple created Carbon, which is a C API. It lets you do most of what Cocoa does but in a procedural way, (functions, not objects). The only downside to Cocoa is that Apple hasn’t written all their features into it. There are still certain things that can be only done in C. For instance, my tutorial on how to do global hotkeys utilizes a Carbon API. Since we’re using Objective-C, it’s no issue to drop back and use Carbon. Just include the Carbon framework in your application, and you can make carbon calls right within Objective-C files.

A New Future Awaits

We got tons of stuff coming from Apple. Developers are #1 for Apple.

Look Back, Look Ahead

iphone.pngTypically as companies grow larger, they become fatter, slower, and turn into dinosaurs. The more money they make, the more they sit on it and don’t want things to change. They are slow to get into emerging markets. Need I point out AT&T’s complete write off of the cellular phone or computer manufacturers lack of movement into the PC field. Let us remember that it was Apple that brought the personal computer to market successfully. This is a company founded in breaking out of the old and innovating the new. And if you think they have become a dinosaur, just look at the iPhone. Apple has a highly productive, high-margin product, the iPod that was selling at record numbers. Then, in the middle of all this, they announce an iPhone that basically does what the iPod does but so much better and with more features. They basically cut out the iPod field, or soon they will. Experts are expecting a move now towards iPhone-ish iPods. With a successful product, Apple didn’t sit on it. They innovated and made the coolest phone ever. They knew that it would undercut iPod sales, but they had to do it or someone else would. And if you think that’s a one-time move by Apple, think again. They did it with the iPod Mini, the best selling iPod, when they replaced it with the Nano. Apple is a company ready and willing for change.

Great, so how does that affect developers? Well it means that Apple will be at the cutting edge. You’ll be getting features like the ones I described above constantly. Whenever Apple innovates and makes something new, you can start to use it. They won’t sit on it, hoping that they can still make money off of old software. They will push the envelope. Something that can’t be said of its largest competitor. Office 2004???

CoreAnimation: The Next Step

coreanimation.jpgWith that lengthy discussion, I just wanted to follow it up with a good example that we developers will be able to use in October. CoreAnimation. Probably the most important thing to hit OS X. This API will let us make the sweetest interfaces in seconds. From what I’ve seen, and it has been limited, the future is going to be amazing. So for all of you out there looking to develop on a platform that will truly be innovating into fantastic new areas, look no farther than Mac OS X.

Make More Money

The Mac gives developers a unique opportunity quite different than any other platform.

Limited Competition

First and foremost, we are in a great time for Mac shareware. We have come to a point where we have thousands and thousands of new Mac owners coming to the platform, yet still we have a small portion of really good developers. So that basically means there’s very little competition in a large and growing market. That’s heaven for you MBAs out there. The market is also very different from the Linux and Windows platforms. Take Linux, a community driven by open-source. I’m a strong proponent of it, but as a profession, it’s tough to make a go at open-source. On the Windows side you’re face a completely different market. It’s one driven by business executives who hate their job working on an inferior platform. Ok, sorry for that. But in truth, Windows is a gigantic market suffering from the two things Mac has that it does not. It has an extremely large user base, but that user-base is decreasing, and secondly, there is a plethora of competition. It’s tough competition too. You have the open source people making free stuff, which is already tough to compete against, and then you have the big corporate companies competing for business. So you as an indie developer are stuck in between the guys doing it for free and the giant multi-million dollar companies. Good luck, heh. Come over to Mac, seriously.

Better Community than Windows

cultofmac.pngIt’s not just the competition, we’ve also got a superior community, and I say that as nicely as I can. People on Windows are great people, but what I mean is that there isn’t anything that unites them. There isn’t that bond that persists in the “cult of mac.” Walking through an airport looking around at what laptops people are using, mac users always feel a certain connection when they see another person working on a MacBook. I know it’s weird, but it’s true. So what does this type of community mean? This is an arena that word-of-mouth is key. That can make so much business for your little application. If you please one Mac user, all his/her friends will know about it and check it out. It’s a great atmosphere to sell in. Mac users are also more willing to buy. There are less pirates. You have a bunch of users who know almost nothing about computers, so they don’t know how to pirate. You also have a large market of rich, creative professionals, who are willing to spend money. You will have piracy, but it’s significantly less than on Windows. And just to reinforce the ideas of community, look at things like MacHeist, MacApper, TUAW, TAB, MacZot. We’ve got a lot to offer you.

Conclusion

I think it’s clear that the Mac is a great place to work on. You’ve got some amazing technologies already in place, plus you have a bunch of great stuff coming that’s announced (CoreImage), and even more unannounced or unwritten yet. You’ve also got a vibrant, strong community to sell to. I couldn’t be happier with where Mac shareware is, and hope other developers will consider joining our ranks and scoring a portion of this great market.

  • Okay, you've got me. Now if only I could learn to code.
  • Dave
    I just started looking at the MAC since the iPhone came out. I am not a programmer although I have played with Java and some Visual C# just to see what it was. Last time I ever did real programming was in Fortran back in college..yep I am over 30!

    Java is way to complex for me along with all the tools. C# was OK.

    How do the apple tools and Cocoa stack up in terms of complexity and learning compared to Java or C#?
  • Dave: I'd say they are pretty equivelent. Obj-C and Cocoa are very advanced tools and are not something you pick up immediately. I, however, found the rate of learning of Cocoa faster than Java. This may be due to the fact that I already had a solid foundation in Java and OOP ideas so learning obj-c was easier.

    Either way, I heavily recommend at least trying it out. You never know. You might really enjoy it.
  • Dave
    Thanks for the comments. I think I will give it a try. I agree that JAVA knowledge is useful as far as OOP concepts go.
blog comments powered by Disqus
« Edge Wednesday: Wikipedia | Isn’t Apple a Fruit? What Happened to Macintosh apples? »