admin管理员组文章数量:1429555
Has anyone used JS.Class and liked it? I 've used Joose before and find it really good in creating clean code that is very readable and maintainable. Any real life stories about JS.Class?
Has anyone used JS.Class and liked it? I 've used Joose before and find it really good in creating clean code that is very readable and maintainable. Any real life stories about JS.Class?
Share Improve this question edited Feb 25, 2010 at 7:06 Paul D. Waite 99k57 gold badges203 silver badges271 bronze badges asked Feb 24, 2010 at 19:44 DLSDLS 5,5118 gold badges40 silver badges52 bronze badges 2- 1 Yes, you better change it. Else... bears will eat you :) – Chetan S Commented Feb 24, 2010 at 20:02
- As it seems there are little developers using it,... sad, I wish someone had a good opinion about it... It really does look good. I love ruby, as in a pedestal, one of these days I will start using.lol – marcelo-ferraz Commented Mar 2, 2010 at 18:49
2 Answers
Reset to default 6Sorry for the first-person answer here, but although I have not used JS.Class, from a Java/Javascript developer standpoint, it looks very good. Our team works on a Java project with most of our front end using home-brewed JavaScript (and not a small amount of it). We don't use any JS frameworks (jQuery didn't exist when our project started) and we've even implemented our own drag and drop/sort utilities that make extensive use of inheritance.
For convenience and for the ability to use inheritance, (and through much evolution) we ended up developing methods that e to nearly the exact same patterns as JS.Class (but not nearly as extensive).
Everything I read in the docs on classes and modules, inheritance, etc. seemed very natural — in fact, it looks like we could probably replace all of our class-creation methods (a method we called objectLib.createClass
) with new JS.Class
with no other changes to make.
We also ended up developing our own Set classes and other array and object utilities that JS.Class includes as part of it's core functionality.
So, while I can't say that I've used JS.Class and liked it, I can say that as a Javascript developer I have needed to solve nearly the exact problems that JS.Class appears to solve very well.
I have not used it and I do not personally find a good use for the classical inheritance pattern so far in my experience. I switched to Javascript programming from Java to run away from all those design patterns!
You may also (if you haven't already) take a look at these posts from Douglas Crockford on what he thinks of classical inheritance in javascript.
http://www.crockford./javascript/inheritance.html
http://javascript.crockford./prototypal.html
本文标签: javascriptHas anyone used JSClass and liked itStack Overflow
版权声明:本文标题:javascript - Has anyone used JS.Class and liked it? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745486891a2660424.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论