Re: newbie questions about objective-c, ruby, python, groovy and cocoa
Re: newbie questions about objective-c, ruby, python, groovy and cocoa
- Subject: Re: newbie questions about objective-c, ruby, python, groovy and cocoa
- From: Allan Odgaard <email@hidden>
- Date: Thu, 10 Jun 2004 11:30:23 +0200
On 10. Jun 2004, at 10:06, KlunkyRobot wrote:
[...] However just to be the devil's advocate, Java came to the world
after C++
and Objective-C and Java has now almost eclipsed C++
Yes, that's a good point.
Though Java did introduce several "new" things, like cross-platform
run-able applications, a GUI as part of the language (run-time),
sandboxed execution and a lot of buzz about how safe it was, plus it
probably piggy-backed a lot on the new internet-revolution :)
Unlike C++ it also allowed binary compatibility among classes and
subclasses and thus made it easy with dynamically loaded
components/plugins etc. (which was more of an issue in '96 than in
'86).
That said, I do not think it has eclipsed C++. I think that a new field
was created (enterprise applications), and Java got that marked, but
all the things which was previously written in C++ is still written in
C++ to the best of my knowledge.
There might be a few exceptions, but I think that's because today, many
enter the business with Java as the first language they learn (apart
from scripting), because the way into the business for many is through
web applications, and so, if they go on to create non-web applications,
they'll stick with Java.
Also, Java is probably a better entry-level language because it's
relatively safe (no memory management, no pointers, run-time check for
un-initialized values, array boundary checks, garbage collection,
compiler *errors* for dead code, non-exhausting switch/case statements,
no preprocessor/macro magic etc.) and so, schools have started to teach
Java instead of what they used before.
In regards to method overloading I can create two files called
MyMethods.m and put one in a folder like this /utilities/MyMethods.m
and
/maths/MyMethods.m is that correct or will they conflict if I call them
into the same file header.
I am not sure exactly what you want to do? You can have two files with
the same names in different directories, and you can also add methods
to the same class in these two different files. But you cannot declare
two *classes* with the same name (in two different files), since there
is only one flat namespace for classes.
To be honest Objective-C syntax is ugly from a Java syntax point of
view,
I hope that it is just a lack of familiarity on my part.
Sort of... at least the named arguments have grown on me, so this part
I love :)
But I hate the verbosity of the things, like:
if([str isEqualToString:otherStr])
or
if([num compare:otherNum] == NSOrderedAscending)
And I also think it's a mistake to put the [ infront of it all for the
reason mentioned previously by Glen Low (you don't know how many you
need when starting to type the expression).
[...] I would not be even bothering to look at objective-c and cocoa.
Cocoa is Apples primary choice everything else is an afterthought.
So you'd favor something like Swing over Cocoa? I think you'll just
need some experience with the Application Kit, and you'll come to
realize that it's much better than Swing :) With regard to the
language, in objective-c a method is a type in itself (independent of
the object), this turns out to be extremely useful when dispatching
events in a GUI framework (e.g. the Copy menu item just calls the
copy-method on the first object in the responder chain which implement
it), this completely remove the need for Javas event handlers and
manual registration of these -- although I haven't tried the Java
bridge, I do not think that this is possible!?! perhaps someone could
enlighten me :)
_______________________________________________
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.