Has Javascript developed beyond what it was originally designed to do?

Posted by Elliot Bonneville on Programmers See other posts from Programmers or by Elliot Bonneville
Published on 2012-03-19T00:11:59Z Indexed on 2012/03/19 2:15 UTC
Read the original article Hit count: 4313

Filed under:

I've been talking with a friend about the purpose of Javascript, when and how it should be used, etc. He quoted that:

JavaScript was designed to add interactivity to HTML pages

[...]

JavaScript gives HTML designers a programming tool

  • HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages JavaScript can react to events
  • A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element JavaScript can read and write HTML elements
  • A JavaScript can read and change the content of an HTML element JavaScript can be used to validate data
  • A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing
  • JavaScript can be used to detect the visitor's browser - A JavaScript can be used to detect the visitor's browser, and - depending on the browser - load another page specifically designed for that browser.
  • JavaScript can be used to create cookies - A JavaScript can be used to store and retrieve information on the visitor's computer.

However, it seems like Javascript's getting used to do a lot more than these days. My friend also advocates against using Javascript's OOP functionality, claiming that "you shouldn't be processing data, merely validating." Is Javascript really limited to validating data and making flashy graphics on a web page?

He goes on to claim "you shouldn't be attempting to access databases through javascript" and also says " in general you don't want to be doing your heavy lifting in javascript". I can't say I agree with his opinion, but I'd like to get some more input on this.

So, my question: Has Javascript evolved from the definition above to something more powerful, has the way we use it changed, or am I just plain wrong? While I realize this is a subjective question, I can't find any more information on it, so a few links would be good, if nothing else. I'm not looking for a debate, just an answer.

© Programmers or respective owner

Related posts about JavaScript