4 ms·
Russell said that Google engineers are also developing a proposal for the next version of JavaScript to add class concept. Class is a core element of object-ori
by binarymax 15y ago
Russell said that Google engineers are also developing a proposal for the next version of JavaScript to add class concept. Class is a core element of object-oriented programming language, it is the basis of data and code reuse. JavaScript does not support class, the programmer can only use function calls to complete some of the features which is a waste of time to write the code that is not conducive to reuse.
Other than not having a 'Class' keyword in javascript, this is mostly a useless statement. The beauty of javascript lies in the balance between object and functional style. The prototypical model with first class functions is what makes javascript so powerful. I don't see the need to change it, and if you get into a situation where you need easy access to object oriented style, coffeescript is a fine choice.
- mattmanser 15y agoAfter all the discussions about javascript here and anywhere javascript is mentioned you must realise by now that a lot of people disagree with you. I'm not even going to go into why, it's been said a million times. Let's just agree that you've got an opinion that's not particularly compelling or common to a lot of experienced programmers. Your 'beauty' is many other people's bane. The very things you've picked out can cause such complexity and pain.
- taeric 15y agoPeople do disagree. They also by and large agreed that all of the things that Java and friends brought to the table were supposed to lead to more maintainable software. So far, few software projects in any language approach the maintainability of the Linux kernel. Having recently read "How We Decide", I can't help but think many of the traps described in that book are hit heavily by those trying to pick a programming language.
- eternalban 15y ago> So far, few software projects in any language approach the maintainability of the Linux kernel. That may be true but is it really informative? Apples to apples: pick equivalent ultra-picky-with-membership team of talented programmers and then compare their artifacts' maintainability. C is a fine language but the point of Java is that it lowers the bar (by dealing with hard problems e.g. GC) and makes it more accessible (look ma, no pointers). A possibly controversial (but arguably viable) measure of "Java and friends" success is the explosion of "complexity" in software written in these languages. My thesis is that IT league programmers would not have ventured to take spectacular architectural spacewalks in C or C++ but felt completely comfortable doing so in (say) Java.
- rmgraham 15y agoI think the subtext there was that maintenance of large code bases and the associated productivity is inherently a people (developers) problem, not a technical (language) problem. It's normally considered foolish to attempt to solve people problems with technology.
- taeric 15y agoIndeed, that is exactly my belief at the moment. Thanks for saying it as I should have. :)
- binarymax 15y agoI'm not sure why you were downvoted. You make a good point. My main fear is that the big issue with the web development is incompatibility between browsers. We are just now starting to see some sanity. Browser teams are working together. I don't want to see more fragmentation by changing javascript and going through it all over again.
- RyanMcGreal 15y agoIf you really want to program classical inheritance into Javascript, there are ways to do that today. Meanwhile, prototypal inheritance is already simple and powerful - so simple, perhaps, that programmers trained in classical inheritance tend to stumble on it.
- judofyr 15y agoI agree that prototypal inheritance is simple and powerful; JavaScript's version of it on the other hand… By introducing constructors you get this weird mix between classical and prototypical which isn't elegant at all :(