views:

120

answers:

3

Hello everyone,

I briefly checked for dupes of this question, since I was certain they would exist, but I couldn't find any!

So, I am going from Java to JavaScript; what can I read that will make sense? (and if I just have to forget everything about Java and start over, that's fine too.)

+10  A: 

Java is to JavaScript as Ham is to Hamster

they're very different, but here's a guide I found online.

Adam
I prefer "as car is to carpet", but they're all good
Gareth
@Gareth: http://www.youtube.com/watch?v=kntawlgAonA
Andy E
@Adam: this guide is kinda hard to follow :(
sova
@Andy E: I've got a badge, but I'm not a badger
Gareth
@sova - Sorry. Personally I recommend Doug Crawford's classic http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742 as a JavaScript book. But, I was looking for a source specific for Java programmers
Adam
Cool. I have caught glances of the book before on campus, sounds like a sound investment.
sova
Adam stole this quote from my google status. All those upvotes should count towards my reputation, not his! (But then again, I stole it from some blog somewhere, so I don't really get the credit either.)
Michael Kopinsky
+1  A: 

You should be watching every video and reading every book the Doug Crockford has put out.

I'd also recommend reading a lot from John Resig, the genius behind jQuery.

duffymo
A: 

I was in your situation.

Remember:

  • Javascript is not OOP, whatever some people say.
  • Variables are function scope.

Books and links:

And perhaps: http://docs.jquery.com/Tutorials

angelcervera
-1: Javascript *is* OOP, whatever some people who have no idea what OOP means say.
Michael Borgwardt
This answer is informative and I don't think it should be voted down, Michael can you explain what you mean?
sova
@sova: Michael means that JavaScript *is* an Object-Oriented Programming language. That's why he down voted the post, because it's giving incorrect information. It is definitely OOP, read what Crockford [has to say on the matter](http://www.crockford.com/javascript/javascript.html), under the Object-Oriented heading.
Andy E
@Michael: Javascript is OOP as C is OOP !!! Objective C is OOP, Java is OOP, etc.. but Javascript no! You could simulate this (read reference in answer) but Javascript is not designed with OOP in mind.@Adam used a real OOP (java), he understands this answer when he start to use Javascript.
angelcervera
@Andy: I read your link, and definitely, javascriot is not a OOP. As i said, you could simulate then (like in C or assembler), but is not a OOP.
angelcervera
@angelcervera: Repeating falsehoods does not make them true. Javascript is an object-oriented language. A language does not need classes to be object oriented.
Michael Borgwardt
@Michael: Repeating falsehoods does not make them true. Javascript lacks of things need in a OOP. You can simulate, but javascript has not them. You can simulate this as you could simulate in other languaje as C or assembler (it is typically home work in university) but is not designed to be a OOP. Is C OOP? No, then JS either.
angelcervera
@sova It is evidence that is very easy vote down. :(
angelcervera
Just because JS isn't class-based (it's prototype-based) doesn't mean it's not object-oriented.
DanMan
@angelcervera: You don't provide any solid reasons for why JavaScript might not be OOP. Saying that it "lacks of things need in a OOP" isn't really enough to sway the argument in your favour. JavaScript may not be the type of OOP that you're used to, but it's still OOP. I could argue why, but I'd be reiterating what's been said before: http://stackoverflow.com/questions/107464/is-javascript-object-oriented.
Andy E
@Michael, @DanMan, @Andy: I post more detailed reasons in the correct place. http://stackoverflow.com/questions/107464/is-javascript-object-oriented/4060144#4060144 and i add this question in my favourite list ;) One think it is evidence, this question is matter of opinion and i do not deserve the voted down :_( Apologies for my poor english and be nice.
angelcervera