OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 4:49 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Objective-C
PostPosted: Sun Jan 25, 2004 1:20 pm 
Would anybody be able to explain to me what Objective-C is/what it's used for?


Top
  
 
 Post subject: Re:Objective-C
PostPosted: Sun Jan 25, 2004 3:02 pm 
chris wrote:
Would anybody be able to explain to me what Objective-C is/what it's used for?


Objective-C, as the name implies, is an OOP variant of C; it was developed around the same time as C++, and the two languages were rivals throughout the 1980s; Objective-C was the major language on the Next workstation.. While C++ eventually won out, Objective-C continued to be used in certain projects, such as the GNUStep window manager and the Cocoa development kit. The gcc compiler system supports Objective-C as a source language.

Objective-C took a very different approach to extending C than C++ did; rather than modify the core syntax, it instead embedded a Smalltalk-like sublanguage in the C code, which was marked off by square brackets. It also added features for separating 'interface' from 'implementation', similar to those in Ada or Eiffel.

The "Hello, World!" page gives us this example program:
Code:

/* W.J. Antel Jr.  12/12/96
** Compile with gnu's gcc:  gcc hello.m -lobjc
*/
#include


@interface Control:Object

{
}
- world;
void main();

@end


@implementation Control

- world
{
  printf("Hello, World!\n");
}

void main()
{
  id hello;

  hello=[Control new];

  for(;;)
    [hello world];
}

@end


This was too different, and lacked the appeal a familiarity that C++ had; it also generated much less efficent code. It's supporters, however, argued that it was a much more elegant design than C++'s, and that it supported OOP with fewer compromises.

For more information, see the Objective-C FAQ.


Top
  
 
 Post subject: Re:Objective-C
PostPosted: Sun Jan 25, 2004 5:02 pm 
Cool, thanks!


Top
  
 
 Post subject: Re:Objective-C
PostPosted: Mon Jan 26, 2004 2:00 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 22, 2004 11:00 pm
Posts: 1076
yeah, when I looked at OC, it really fely like I was programming in preprocessor or macros and very.. it felt not attached to C really.. I didnt like it.

_________________
-- Stu --


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group