wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Benefits of OO JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic

Benefits of OO JavaScript

Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502


I have a questions

1. what is benefit of OO javascript than normal procedure based javascript? Is it something with enhanced functions or just OO based?


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Stoyan Stefanov
Ranch Hand

Joined: Jul 16, 2008
Posts: 61
well, one simple thing you can do to improve the procedural style is two put all your usual functions behind a namespace (example in this post) to help keep the global namespace clean and avoid naming collisions.

Other than that the benefits of OO in general apply to JS as well.

<a href="http://www.thinkinginjavascript.com" target="_blank" rel="nofollow">my OOJS book</a>
It is sorta covered in the JavaRanch Style Guide.
subject: Benefits of OO JavaScript
Similar Threads
OO Basics
Object Oriented Programming
Want to use OOP on my website
problems with javascript
Match Ajax responses with requests