admin管理员组文章数量:1310004
Is it just me or any JavaScript DOM manipulation or WEB UI Framework code is really hard to grasp because of long files, lack of proper indentation and scarcity of ments?
I have read couple good book on JavaScript and like the language, but when trying to understand the inner workings of all the popular frameworks I am having hard time to force myself to go beyond first hundred lines of a huge file.
This is a real question, not a statement. I am just trying to understand if I just suck or somebody else sharing my impressions.
Is it just me or any JavaScript DOM manipulation or WEB UI Framework code is really hard to grasp because of long files, lack of proper indentation and scarcity of ments?
I have read couple good book on JavaScript and like the language, but when trying to understand the inner workings of all the popular frameworks I am having hard time to force myself to go beyond first hundred lines of a huge file.
This is a real question, not a statement. I am just trying to understand if I just suck or somebody else sharing my impressions.
Share Improve this question edited Aug 16, 2011 at 16:58 SeanCannon 78k17 gold badges125 silver badges145 bronze badges asked Jul 30, 2011 at 20:49 LarikLarik 313 bronze badges5 Answers
Reset to default 7Oh boy. First, stop trying to reverse-engineer minified and obfuscated javaScript. Second, it's open-source and documented.
Who said he is reading minified code?
This question might be closed, but yes, jQuery has some rather unreadable source and bad organization. Organization in that John Resig thought it was a good idea to throw everything onto a single constructor and its prototype.
I guess if you want a DOM library that is well mented, try looking at Prototype. It's actually very overmented in my opinion, but if you want it as a reference for various DOM quirks and mechanics, it might be a good source.
The minified version is indeed not human-friendly, but it's smaller and faster. You're looking for the development version.
Whilst I can understand your frustration, jQuery (and other APIs, C++'s STL springs to mind) are not meant to be read by the average engineer. They are optimised for their purpose and excel at doing so, and that's why everybody uses them. Tried and tested.
Genarally jQuery uses a lot of closures and the notation of the framework as well as the plugins define a lot of anonymus functions on the go. So it's not easy "following" the way of the data through the code. At least that is my limited understanding. So if You just suck, You're definetely not the only one.
本文标签: javascriptJQuery source codeabsolutely unreadableStack Overflow
版权声明:本文标题:javascript - JQuery source code - absolutely unreadable? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741844424a2400698.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论