3 ms·
> For all intents and purposes, Javascript's so-called prototypes are shitty single-inheritance classes without the sugar. You're right. I would much rather ha
by fruchtose 14y ago
> For all intents and purposes, Javascript's so-called prototypes are shitty single-inheritance classes without the sugar.
You're right. I would much rather have Java's or C++'s inheritance models in JavaScript. JS's object model is mutable, which is a plus for me, but it is far only language with mutable object methods or properties. I'll have to move prototypes from the "awesome" pile into the "meh" pile.
> lexical closures
Beyond closures, which I am glad to see in JS, I am referring to the call and apply functions which allow the user to set the scope of the functions during the function call. Again, I am hardly an expert, so the term for this escapes me. Your reply has been very helpful in that regard.
> There's also a lot we could do with Fortran and Cobol. That's no bloody excuse.
Very true, but I'd really like to know why you would put JS in the same class as Fortran and Cobol.
- masklinn 14y ago> I am referring to the call and apply functions which allow the user to set the scope of the functions during the function call. Ah yes, so it is indeed about `this` and its dynamic scoping. I can't say I'm much fond of it, I'd rather have correctly bound methods (à la python) and actual, optional dynamic scoping when needed (à la Common Lisp) > Very true, but I'd really like to know why you would put JS in the same class as Fortran and Cobol. I don't, I'm just saying being able to do "a lot" with a language does not mean the language is good in and of itself, and Fortran and Cobol are good examples of that: few under 50 will try and defend them (as opposed to PHP, an unmitigated disaster of a language which still finds defenders), and there are fucktons of code written in these languages and still running.