Re: Objective-C Question
Re: Objective-C Question
- Subject: Re: Objective-C Question
- From: email@hidden
- Date: Mon, 22 Sep 2003 09:26:34 -0600
On Monday, September 22, 2003, at 03:56 AM, Steve Ehrenfried wrote:
From what I can tell Obj C is missing several things
which a good OOP language like Java has:
First things first - Java is not a good OO language. Not according to
Alan Kay - the inventor of the term "Object Oriented". Smalltalk is a
good OO language (it is the prototypical one) - Objective C is a lot
closer to Smalltalk than Java is in most respects.
1) Being a able to make a method and/or class "final",
i.e. it can't be overridden or subclassed.
Why? This is a stupid hack to try to get more efficiency out of Java.
If the J-heads had spent their time implementing efficient dynamic
dispatch instead of trying to fake it with static binding half the time
they wouldn't need it.
2) Being to able to have a partial implementation of a
class, i.e. an "abstract class". (Perhaps Obj C
supports this but I just don't know about it. If there
is, how do you specify that instances of a specific
class can't be instantiated?)
This "feature" provides no value. Why don't you just call the class
"AbstractWhatever" - that communicates the idea just as weel.
3) Built in support for exceptions, though this is
more of a convenience than part of the object model.
Great implementation in Java, horrendous
implementation in C++ (the function signature doesn't
specify what exceptions are thrown, so how do you know
[unless it's documented, which it probably isn't] what
you need to catch or re-throw? It's real easy for an
uncaught exception to percolate up the stack).
NSDURING not working for you?
4) Being able to specify the access control of members
(public, protected, private). Isn't everything public
in Obj C? Sorry, I'm a newbie here, but isn't data
encapsulation part of the object model?
What makes you think you know better than I what members should and
shouldn't be callable? There are conventions for specifying private
members - name them with a leading underscore and leave them out of the
header file (define them in a private category in the implementation
file). Otherwise they're public. Its not a problem. The C++ and
J-heads are paranoid control freaks.
5) No namespaces (C++) or packages (Java). Again, Java
has a much cleaner implementation and is better
thought through, IMHO. Anything like this in Obj C?
We use naming conventions - it amounts to the same thing - longer names
to be distinct. NSString is in the namespace NS - get it?
This is a typical newbie rant. You've learned one language and so your
criticism of every other language is that its not the same as your
first language. I could go the other way and smash Java for not being
like ObjectiveC - its newer but its designers haven't learned anything
significant and have absorbed the worst traits of the languages they
claim to have borrowed from. But this isn't the space to do it.
Go learn a few more languages. Then maybe your critiques will be worth
something.
-Todd Blanchard
Professional Language Basher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.