Any objective c coders in the house??
I am trying to figure out what was the purpose of the objective c syntax. What are the advantages? why not use a more normal syntax(c,c++, java, php) and do something like frac->setNumerator(1)
Also there seems to be a lot of little additional characters to help the compiler(maybe)
Maybe someone with object-c experience can share some light. Thank you
// set the values
[frac setNumerator: 1];
[frac setDenominator: 3];
// combined set
[frac2 setNumerator: 1 andDenominator: 5];
objective c syntax
Moderator: General Moderators
Re: objective c syntax
it is inspired by smalltalk, I would say
Re: objective c syntax
You have to know a bit of history to understand that. Objective C started its evolution as a superset of C (unlike C++ which started as a preprocessor to C) pretty much at the same time as C++ did. Both languages were not in common use and thus were not influencing each other. Besides, different level on which they were integrated into C made sharing the syntax harder, if not impossible (later C++ compilers appeared, but those were different times already). Other languages you mentioned appeared much later, in mid-90, thus obviosly ObjC could not borrow from them.yacahuma wrote: I am trying to figure out what was the purpose of the objective c syntax. What are the advantages? why not use a more normal syntax(c,c++, java, php) and do something like frac->setNumerator(1)
Objective C doesn't have to be 'better' than C++, as it's just another implementation of same ideas, on the same common base (C).
And yes, as arjan.top noted, Objective C is heavily influenced by Smalltalk.
Re: objective c syntax
thank you.