Theiling Online    Sitemap    Conlang Mailing List HQ   

Re: OOPs!! When is a class not a class? (Re: Number/Specificality/Archetypes in Language)

From:Keith Gaughan <kmgaughan@...>
Date:Monday, September 27, 2004, 14:08
Philippe Caquant wrote:

> --- Ray Brown <ray.brown@...> skrev: > > Same Flanagan. In chapter 8, paragraph > "Object-oriented JavaScript (seems Flanagan doesn't > know one can can give numbers to paragraphs in a doc > :-( ), he writes (I'll better not translate back to > avoid mistakes): "La conception commune aux langages > de programmation oriente's objet est qu'ils sont > fortement type's et qu'ils prennent en compte > l'heritage de classe. Sur la base de ces criteres, > JavaScript n'est pas un veritable langage oriente' > objet et il est facile de l'exclure de ce groupe". But > two sentences further, "A cet egard, JavaScript est un > vrai langage oriente' objet". So it seems that there > is no definitive definition of what an oriented-object > language is, and thus JavaScript is sometimes one of > them and sometimes not.
Nah, what he's talking about is the concept of the class. JavaScript doesn't have the concept, instead making objects the archetype for other objects. What he means when he says "Sur la base de ces criteres, JavaScript n'est pas un veritable langage oriente' objet" is that if you (wrongly) conclude that you need to have classes (thinking platonically) in a language to be OO, then JavaScript isn't. As I said in response to Ray, JavaScript uses prototypes in preference to classes. This is the other primary OO school.
> Precisely no: I'm very used at Pick Basic, which is > completely untyped, and is very easy to use. But it > doesn't allow you to make Web applications, AFAIK (or > maybe some recent version does ?)
Probably using some kind of CGI library.
>>>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), >> >>Eh?? But "+" is commonly used for concatenation. >>I've used it for years >>and so far have had no problems. > > In Pick Basic: concatenation = ":", addition = "+".
Don't know much about Pick BASIC, but it's probably completely untyped. JavaScript objects are all typed, and variables gain a type when you do an assignment. That way, it doesn't get mixed up when you're doing concatenation or addition. I don't know if you've heard of it, but the language Tcl similarly to how you've described Pick BASIC, treating everything as a string. The use of ":" for concatenation is very unusual! I'm just after looking the language up in Google, and I'm getting this horrible flashback to Commodore BASIC > So the program performs concatenating or adding,
> depending of what *you* told it (by using an operator > meaning what *you* mean, and not what *it* fancies > (because he finds that 1st or 2nd operand happens to > be a number or a string). What is important is the > operator. When Pick Basic finds something like 'x = > "aaa" + "bbb"', it answers you quite logically: hey, > wait, "aaa" is not a number, it is a string, and so is > "bbb", so I cannot perform what you told me, thus I > consider that operands will have a zero value and I > will return 0, plus an error message. Perfectly > logical.
> But when you write something like 'x == a + > b' in JavaScript (in case this syntax would be ok), > JavaScript will perform, either an addition, either a > concatenation, depending of the current type of the > operands, and signal you no error. Are you always sure > of what are the current types of a and b, in an > untyped language ? I'm not.
If you've been writing your code properly and your variable names are descriptive and clear, then you should know just by looking at it. It will always promote a number to a string and not vis versa.
>>How can you learn Apache?? It's a webserver (and a >>ood one too IMO) - > > Well, I suppose, by buying some nice book at 45 euros > like: > http://www.amazon.fr/exec/obidos/ASIN/284177225X/pd_ka_0/402-6817569-0144140
I think he was a little facetious, owing to the fact that Apache isn't a language, and from what you wrote could be inferred easily that it was.
>>unless you actually mean the language of the Apaches >>of North America >>(That's much more interesting!). > > Yes, I think so. BTW, I recently learned that Apache > is pronounced like "Apatshee" by the Anglo-Saxon, > while we say "Apash". So my knowledge is not totally > null on that topic :-)
There's a joke in the name (which you probably learned when you discovered the pronounciation of the server's name) and that's that it's a pun on "A patchy server", owing to it starting as a bunch of patches on NCSA's server software.
>>You sound like a carpenter bemoaning having to learn how use all the >>different tools of carpentry. > > Yes, looks like that. Yet in my different jobs I've > programmed and maintained entire applications in > Basic, Cobol, PL/1 (and also a personal application in > Assembler on Apple II, long ago). But that's not of > any help to me: everything to learn from zero, or > nearly, once again.
You've named three of the horsemen of the programming apocalypes! My prayers are with you. ;-) K. -- Keith Gaughan -- talideon.com The man who removes a mountain begins by carrying away small stones... ...to make place for some really big nukes!

Replies

John Cowan <jcowan@...>When is an Apache not an apache? (was: When is a class not a class?)
B. Garcia <madyaas@...>When is an Apache not an apache? (was: When is a class not a class?)