It's not a secret anymore!*
The moose likes HTML, CSS and JavaScript and the fly likes Why the title is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

Why the title is "Object-Oriented JavaScript"

Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
Hi Stoyan,
Why the title of the books is "Object-Oriented JavaScript"? Why there is so much stress on Object Oriented while we can't have all the OO features in JavaScript. AFAIK at the most we can create objects in JS.

Also today when we have libraries like DOJO, JQuery etc do we need to know Javascript in depth? In my current project Jquery+ google is sufficient to get things done.
Your opinions?


Paras Jain
SCJP 5.0
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Originally posted by Paras Jain:
Why there is so much stress on Object Oriented while we can't have all the OO features in JavaScript.
Please see my response in this post.

Also today when we have libraries like DOJO, JQuery etc do we need to know Javascript in depth?
Absolutely! These libraries go a long way towards making JavaScript easier to write, but in order to use them effectively, you still need to understand JavaScript.

You say you are using jQuery. While that's a powerful library, unless you really have a good grasp of functional language concepts like function contexts and closures, you'll not be able to use it to its fullest capabilities.

Knowledge of the underlying JavaScript concepts will always be necessary regardless of what library you choose to use.
[ August 26, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Stoyan Stefanov
author
Ranch Hand

Joined: Jul 16, 2008
Posts: 61
Thanks Bear, great answer!

Thanks for your question, Paras! It's true that the libraries help and we should take advantage. But at the end no library will write the code for you, so you'd better understand what you're doing and how it's working. People have always considered JavaScript tough, mainly because of the browser differences, and people have always tried to "ease the pain" letting you write JS without writing JS. The truth is JavaScript is not hard and it's about time we (to freely quote Douglass Crockford) man up and learn the language

Another reason: career development and job interviews. Good front-end engineers are hard to find. Often I've heard this complaint from people that hire: "the candidate claims they know JS. when asked how do I do this and that, the candidate says that with prototype.js, they... Turns out the candidate doesn't know JS, they know prototype.js" I mean even if you know all the libraries (pretty much impossible), it's still better to know javascript, because you don't know which library the next project/contract/client/employer will be using. It may very well be an in-house developed one.

Two-three years ago I was actively looking for a job and went to several interviews. As a rule, every time I heard these two questions in this order: "Is javascript object-oriented? Good. How would you implement inheritance?" I hope that my book will help people ace those interviews! ;P


<a href="http://www.thinkinginjavascript.com" target="_blank" rel="nofollow">my OOJS book</a>
Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
Thanks Bear and Stoyan for your replies.

Yes it is very much true. After so many year of web programming, when it comes to JS we always try to touch the code. We pretend to know but...

Part of it because of idiosyncrasies inherent in the language. We don't know how to do, if we find out how to do we are not sure if it works, if it works we are not sure if it will ALWAYS work in all browsers etc. We just pray it works

Before firebug even debugging of JS was nightmarish job
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Originally posted by Paras Jain:
Part of it because of idiosyncrasies inherent in the language.
What idiosyncrasies are you referring to? I don't think JavaScript is very ideosyncratic. It's certainly different from Java, if that's your background. But internally to itself, it's actually a rather elegant language.

Now, if you are confusing the horror that is the DOM API with JavaScript (in my experience many people who claim to "hate Javascript" are really reacting to the DOM), that's a different matter...
Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
Yes Bear,
May be you are right. DOM could be the part I may be really talking of.
May be because we don�t know the language completely in terms of syntax therefore we think that it is tough. Now a days JS is more of use some library and if it doesn�t work google, find the code, modify it and use it

The time has come when we has to do proper, systematic knowledge of Javascript syntax. Looking forward to read this Stoyan�s book
Stoyan Stefanov
author
Ranch Hand

Joined: Jul 16, 2008
Posts: 61
I tried to summarize the answer to the "why this title" question here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why the title is "Object-Oriented JavaScript"