65 ms·
JavaScript is not even a good second or third language. Of course it is easy to cut and paste code and hack things. But when it doesn't work right you will go
by CyberFonic 12y ago
JavaScript is not even a good second or third language. Of course it is easy to cut and paste code and hack things. But when it doesn't work right you will go crazy trying to work out why.
To be good with JavaScript you need a rather substantial and solid grasp of CS fundamentals and how they are implemented in languages that are stricter about what they will accept and how.
In JavaScript there are too many situations where it either does something totally unexpected (well actually totally logical, but you need to know some pretty arcane stuff to see it that way) or it just fails silently or less likely with a terse exception.
For a beginning programmer that is very little feedback to help with overcoming the initial roadblock. Sometimes called the "getting helloworld to run problem". Trying to learn JS in a browser context is made even more difficult because you need to grapple with the DOM - it is not easy to grok at the best of times.
If you decide to ignore the advice in this and the other posts and go ahead learning JavaScript as the first language, then I suggest getting a very good introductory book and perhaps using Developer JavaScript Console. The debugger is good in that you can single step code and watch variables as they change. You will probably need to take copious notes to understand what is going on.
To be a competent programmer is more than learning a language, it requires a solid foundation in computer science and software engineering. Whilst these topics can be learnt from a book, most people need guidance from those who have acquired such knowledge. Whether they can be bothered answering newbie's questions is another matter.
- auganov 12y agoWhat you're saying is pretty accurate and I agree. But the problems you enumerate are ironically the best parts about learning JavaScript at the same time. Failing silently - it's nice to have 'incorrect' programs still do stuff when learning. Who wants to spend hours tracking problems they cannot even comprehend? Figuring out the DOM - tricky indeed. But it's at least superficially familiar to everyone. Browsers have great tools to inspect and play around with it. You have to learn so much more of insert other language to output to the DOM (or other graphical environments). My advice: Learn underscore. Always refer to Mozilla's docs first (avoid w3schools). Learn ins and outs of Chrome DevTools (or the FF equivalent). If you end up wanting to choose a different language - either go lower-level (Go, Java, Swift, C-family etc) or higher-level (any LISP pretty much).
- CyberFonic 12y agoAs for DOM I agree. DOM provides a rather rich collection of widgets with which to create "interesting" output which with most other languages requires a GUI framework with its own learning curve. The DOM learning process which worked for me was to : Write a simple page in HTML, then open it in Dev Tools and understand the structure, etc. Then re-create it using document.createElement(), etc. I've re-read parts of David Flanagan's "Javascript the Definitive Guide" many times before I became proficient with many essential concepts in JS. I recommend the book (yes in hardcopy) as a valuable adjunct to Mozilla's docs.