This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Object oriented javascript question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Object oriented javascript question" Watch "Object oriented javascript question" New topic
Author

Object oriented javascript question

Brent W Farrell
Greenhorn

Joined: Apr 10, 2008
Posts: 17
How does object oriented JavaScript impact performance? How does an object oriented solution compare to a procedural solution performance wise?
B Webb
Greenhorn

Joined: Sep 30, 2006
Posts: 7
The short answer is minimal if any. There are several assumptions made regarding your question...first, that the code written is optimal itself. The main benefit of using OO JavaScript in my opinion is the ability to utilize polymorphism and design patterns in JavaScript. While I have not read anything stating there is overhead with loading the source, I can imagine that there is more overhead, than if the script was contained in the body to begin with, but that would defeat the purpose to begin with, since another desire is to modularize your code so you dont have cut-n-paste snippets everywhere.
Stoyan Stefanov
author
Ranch Hand

Joined: Jul 16, 2008
Posts: 61
totally agreed with B Webb! This would be a micro-optimization and chances are there are other ares that give you "more bang for your buck".

I posted some more optimization thoughts in this thread


<a href="http://www.thinkinginjavascript.com" target="_blank" rel="nofollow">my OOJS book</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object oriented javascript question
 
Similar Threads
[JS] is this the new way of defining function?
JQuery object oriented approach
JavaScript an OOP language?
OO vs. "normal" Javascript
Threads