My law "When you don't know what you are doing sit back read and then
code."
Most of the people start writing JavaScript without learning it(
ridicules!). Like much of the language JavaScript also has good and
bad parts. If you start doing something without learning it you will
end up writing something non-standard or bad practices.
JavaScript despite having few bad parts its has some extra ordinary
good parts which makes the language cool, beautiful, elegant, highly
expressive language. So, to be a better programmer in JavaScript learn
the good things, know the bad things and code the good things avoiding
the bad part. Its very important to learn good things when you
learn a language because its hard to unlearn the bad things.
Why JavaScript?
JavaScript is THE language of web browser, sun came up java applet
gave a try to override JavaScript ended in a failure. Applet is just
crap(You are a java lover you will find hard time reading my blog
because I bash Java a lot :) and you thing java and JavaScript are
one and the same I am gonna kick your ass get lost. Let me write
about the name history behind JavaScript in a another
post.). I call JavaScript as THE language because you don't have any
other option. I see JavaScript is often blamed for browser hang
probably because of you are doing extensive DOM operation. This is not the
fault with JavaScript, DOM API very awful and JavaScript is unfairly
blamed.
Good and Bad:
Good parts of JavaScript are loose typing, dynamic object, include
functions and very bad part of JavaScript is using global
variables. Some of the other good parts are lexical scoping,
lambda(these is not unique, it resembles more of lisp). JavaScript is
object oriented and class free. So inheritance happens between
objects. Most of them who are from a strong typed languages feel bit
hard to get used to it. People ask how would you identify a
variable's type. I learned programming using Lisp, Python so I am
much used to it and trust it is a good.