Re: OOPs!! When is a class not a class? (Re: Number/Specificality/Archetypes in Language)
From: | Philippe Caquant <herodote92@...> |
Date: | Friday, September 24, 2004, 9:05 |
--- Ray Brown <ray.brown@...> skrev:
> OOPs!! Someone has informed me that JavaScript does
> *not* have the formal
> notion of class in the sense that the term is used
> in OOP and in the way
> that C++ and Java does. I must confess that my
> object-oriented programming
> has been a little in C++ and quite a lot in Delphi
> and Java. So far I've
> done _very_ little in JavaScript, so when Philippe
> mentioned objects and
> classes in JavaScript, I assumed that the terms were
> being used in the
> traditional OOP manner. I should have known better:
> other than a
> resemblance in syntax, JavaScript has nothing to do
> with Java. (Darned
> scripting languages :)
>
> In fact, I discover the way JavaScript deals with
> objects is quite
> different the classic OOP languages. It seems books
> on JavaScript are in
> the habit of using the term 'class' informally for,
> as I understand it, a
> set of objects sharing similar properties & methods.
> But - {blushes deeply}
> - if I had stopped to think about it, Javascript
> could not have formal
> classes because it is such a weakly typed language.
> (Darned scripting
> languages :)
>
> OK - Philippe, if your only experience of using
> objects is JavaScript,
> maybe we had better not continue using the class ~
> object analogy
> otherwise we are very likely to be talking at
> cross-purposes, which won't
> help anybody.
>
As I understood from Flanagan's "JavaScript" (I'm
currently at page 344 of the French edition, and there
are 955 in all), JavaScript in not a real OOP, but it
more or less behaves like an OOP. As I don't know Java
neither C++, it's hard for me to explain it smartly.
What I know is that JS has no types and confuses "+"
and "concatenate" (well, it doesn't really confuse
them, it only makes it very likely that you will have
problems with that some day), which leaves me
voiceless. Otherwise, plenty of interesting things in
it.
So, when I'l be through with JavaScript, I'll learn
Java (probably at least 1500 pages ?) and C++, and a
dozen of other things, including DHTML, XTHML, XML,
XSL, PHP, MySQL, Perl, Unix, vi, Apache, Tomcat, etc,
and then I maybe will be able to send "Hello, world"
on the internaut's screen, just in time to discover
that all what I learned will be outfashioned and I
have to start everything from new again :-]
And of course, I'll never have time to concentrate on
the applications and their functionalities. Which
normally is more or less the thing I'm paid for, as an
analyst.
There is something rotten in the Kingdom of
Programming, IMO.
(NB. I only mentioned "good" and well-known
professional tools above. If you could see how we must
manage with the applications that "professional"
developers sold us, especially their ergonomy,
efficiency and documentation, you could not believe
it. Yesterday I argued with one of them, because I was
looking for information about a command named
"dufetch" in a pdf document, which returned me for
"dufetch": Number of occurences = 0, and they told me
blandly: yes, you should know that you were supposed
to look for "dt_manager", and everything about
"dufetch" is explained there. In fact, "dufetch" means
"dt_manager -fetch". The idea of mentioning that fact
somewhere in their doc never occured to them.)
=====
Philippe Caquant
Ceterum censeo *vi* esse oblitterandum (Me).
Reply