Making the move to the Mac

Mac development for Windows programmers

Internet Security Threat Report 2014

As should be pretty clear from previous ramblings, I've about given up on Windows and am in the process of trying to reinvent myself as a Mac developer (I should perhaps say re-reinvent myself, since I worked with Macs back in the early days of the original 128K Mac, over 20 years ago).

Things are going pretty well so far, and if I could only resist the temptation to disassemble bits of the AppKit framework whenever I have an idle moment (see here for more on my strange personal habits) then I might actually have had a shareware application or two out by now.

This article is aimed at Windows developers who are considering making the move. The idea is to get you up to speed as quickly as possible with mainstream Mac development. Rather than discussing cross-platform programming techniques and toolkits (the subject of previous articles), I'm going to focus unashamedly on Cocoa and Objective-C. I'll assume only that you're coming at things from a RAD perspective: Delphi, WinForms on .NET, or maybe even "classic" Visual Basic. Think of this article as a "Dummmies Guide" to Mac programming if you like. All I'm trying to do here is cover the basics using terminology that should already be familiar to a Win32 RAD developer.

As with many development environments, the two most critical components in the Mac development equation are the programming language and the class library/libraries; we'll look briefly at these first.


Having bought out NeXT, Apple ended up with the OpenStep development system, hence the emphasis on Objective-C. For those who haven't used Obj-C before, it's basically a superset of C with object-oriented extensions. The syntax of the OOP extensions is rather esoteric for those unused to it. For example, to call a method taking three arguments in C++, we'd do this:

someObject->drawCircle (20.0, 27.0, 5.0);

To do a similar thing in Objective-C looks like this:

[someObject drawCircleAtX: 20.0 Y: 27.0 withRadius: 5.0];

Objective-C developers prefer to talk about sending a message to an object rather than calling a method. Notice that the name of the message (in this particular case, 'drawCircleAtX:Y:withRadius:') is arguably more self-explanatory than the C++ example because the meaning of each argument – preceded by a colon – is made clear; proponents claim that you end up with code that's more descriptive, but against this, you'll get much more verbose syntax.

Personally, I like Obj-C more than I did when I started using it, but in the gcc compiler the integration of Obj-C syntax leaves something to be desired. Leave off one of those all-important colons, for example, and you will get an unhelpful error message from a very confused parser. Put simply, part of the rationale behind the language syntax (aside from the language designer's fondness for Smalltalk) is to necessarily disambiguate the object-oriented extensions from the underlying C syntax. The brackets and colon symbols are compiler hints, if you will, which tell the thing whether it's looking at an Obj-C method call or a chunk of plain-vanilla C.

The whole thing is potentially more dynamic and reflective than many programming languages because, for example, an efficient mechanism exists for asking a particular object whether it handles some message before sending the message to the object.

Security for virtualized datacentres

More from The Register

next story
Microsoft WINDOWS 10: Seven ATE Nine. Or Eight did really
Windows NEIN skipped, tech preview due out on Wednesday
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
'Google is NOT the gatekeeper to the web, as some claim'
Plus: 'Pretty sure iOS 8.0.2 will just turn the iPhone into a fax machine'
prev story


Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.