4 ms·
First of all, I'm not sure it's right to call Crockford "the greatest JavaScript guru". That's a stretch, to say the least. Secondly, you appear to be claiming
by mistercow 15y ago
First of all, I'm not sure it's right to call Crockford "the greatest JavaScript guru". That's a stretch, to say the least.
Secondly, you appear to be claiming that Crockford offers strong criticism of JS's inheritance model in The Good Parts. If that's what you took away from it, I think you would do well to reread that chapter.
Of course JS's inheritance system is imperfect just like that of pretty much any other language.
- batista 15y ago>First of all, I'm not sure it's right to call Crockford "the greatest JavaScript guru". That's a stretch, to say the least. Well, he sure is on a very short list of js programmers. Who other can you add? Maybe Resig? Ashkenas? >Secondly, you appear to be claiming that Crockford offers strong criticism of JS's inheritance model in The Good Parts. If that's what you took away from it, I think you would do well to reread that chapter. No, I'm saying that Crockford doesn't like the way prototypal inheritance is implemented/exposed in javascript --not that prototypal inheritance is inherently bad. He even writes that the basic action of getting prototypal inheritance is not first-class in js: "In a prototypal system, objects inherit from objects. JavaScript, however, lacks an operator that performs that operation." And in order to use prototypal inheritance he has written a wrapper function to hide all the inheritance boilerplace correctly. (As has every other js programmer I know of, using several patterns).