PDA

View Full Version : Objective C



knightjp
03-31-2009, 10:01 PM
Is Objective C a variant of C? Why isn't it discussed on this site?
I noticed that there aren't forums dedicated to learning it.

Elysia
04-01-2009, 03:47 AM
Because either C++ or C is preferred before Obj-C.
IF you're going to use Obj-C, you might as well use C++
That's my take on the whole matter.

matsp
04-01-2009, 03:50 AM
Except of course if you are writing software for iPhone - in which case Objective C is basically the only choice.

--
Mats

Elysia
04-01-2009, 04:18 AM
iPhone is overhyped IMHO. I'll be writing software for Symbian instead in years to come :D

matsp
04-01-2009, 04:25 AM
iPhone is overhyped IMHO. I'll be writing software for Symbian instead in years to come :D

My sentiments too.

--
Mats

zacs7
04-01-2009, 07:19 AM
And if you're going to develop for a portable device, Java for years to come :-)

stevesmithx
04-01-2009, 07:26 AM
iPhone is overhyped IMHO. I'll be writing software for Symbian instead in years to come :D

googling much now,are we? ;)

CornedBee
04-01-2009, 08:40 AM
Obj-C is a curious language, a spawn of C and Smalltalk, slightly older than C++. (C++ is a spawn of C and Simula.) The main differences between Obj-C and C++ are:
1) Obj-C's object system doesn't try to meld with C. The syntax is completely different from what a C programmer is used to, giving Obj-C a very weird look overall. C++ tries to meld with the C syntax. The result is better compatibility of Obj-C with older C code (no new keywords, for example), at the cost of weird syntax.
2) Obj-C is based on interfaces ("protocols") and implementations, with every object on the heap. You have "messages" instead of functions, and I believe the actual action taken upon message receipt is somewhat dynamic. C++ goes the minimal way, by making classes an extension of C structures.

Mad_guy
04-01-2009, 10:26 AM
Obj-C's object system doesn't try to meld with C. The syntax is completely different from what a C programmer is used to, giving Obj-C a very weird look overall. C++ tries to meld with the C syntax. The result is better compatibility of Obj-C with older C code (no new keywords, for example), at the cost of weird syntax.

AFAIK, isn't Objective-C a strict superset of ANSI C, that is, any ANSI C code is also valid Objective-C code (which cannot be said of C++)?

Elysia
04-01-2009, 11:29 AM
Why does everyone mention ANSI C?
ISO C is what it is and what it should be. C is not some petty American-only language. It's an international language, as all languages should be.

CornedBee
04-01-2009, 01:10 PM
AFAIK, isn't Objective-C a strict superset of ANSI C
I believe it is.


Why does everyone mention ANSI C?
ISO C is what it is and what it should be.
ANSI was faster :) They standardized it in 1989, ISO in 1990. So C89 is ANSI C, whereas C90 is ISO C.
(Not that there's any difference.)

Elysia
04-01-2009, 01:18 PM
Sure, but when ISO standardized it, it means that ANSI should get kicked out of the loop.
That is why I always refer to it as C90. Internationalization is important!
So ISO beats ANSI by horse-lengths.
The best would be if there was no ANSI and only ISO.