views:

74

answers:

3

This may be subjective but if I'm writing some code in Objective-C 2.0 and write about it on for example Twitter or a blog.

Should I refer to it as Objective-C 2.0 or can I just call it Objective-C?

A: 

Use Objective-C 2.0. Although you do not have to, its clearer. Its so people know you are talking about 2.0.

tr4656
+5  A: 

Unless what you are writing about is specific to the 2.0 version of the language, use just Objective-C.

With regards to stack overflow specifically, prefer objective-c to objective-c-2.0 because few people follow the objective-c-2.0 tag

rpetrich
+1 Longer tags are a waste when most people doing Mac and iPhone development are using the more modern version of Obj-C.
pokstad
rpetrich's answer is the simple form of what I wrote. :) Upvoted.
bbum
+4  A: 

The answer is actually not so subtle. Objective-C 2.0 was a sort of moniker used to identify the version of Objective-C that was released a couple of years ago at WWDC.

However, there are actually several different things that could be construed as Objective-C 2.0.

There is the API, the ABI, architecture, and platform.

Across all of the three, Objective-C 2.0 can refer to the specific set of syntactic features available and it is [almost] completely the same across all platforms and architectures. The one difference is synthesized ivars; only available on 64 bit Mac OS X and iPhone (but not in the simulator).

The ABI -- or Application Binary Interface -- refers to something slightly different; the way stuff is laid out in memory and how exceptions are handled. Exceptions are actually different between 32 bit Mac OS X, 64 bit Mac OS X, and iPhone. 32 bit Mac OS X has very expensive exception setup, but cheap throws. 64 bit Mac OS X has very cheap exception setup and slightly more expensive throws (and they are C++ compatible). iPhone has C++ compatible exceptions, but not quite as cheap setup.

Then there is the architecture; there are subtle differences between the variants of Intel, PPC, and arm CPUs.

Finally, platform; there are additional differences -- mostly subtle, the larger quantified by the above descriptions -- between the platforms.

So, Objective-C 2.0 doesn't really mean much. It is just Objective-C and the subtleties of the language are determined by the target platform, architecture, and operating system version. As well, the release of the Xcode toolchain can impact compilation in that certain bugs may be fixed that might allow additional features to be used in additional circumstances.

So, no, really.... just use Objective-C.

bbum
+1 On top of al this, the features of the Objective-C language change from OS to OS. Features were added before "Objective-C 2.0" (e.g. exceptions) and features have been added since (most significantly blocks). The only place where I'd say the Objective-C 2.0 moniker is particularly meaningful is when referring to the Objective-C 2.0 **runtime API**, which was reasonably consistent before Obj-C 2.0, greatly changed at that time, and has remained fairly consistent since.
Chuck
Your answer is more nuanced. Upvoted :)
rpetrich