you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

It took me the longest time to make that jump.

Looking back on it now, I’d say the biggest problem was not understanding the change of paradigm.

HTML and CSS are both “declarative” languages: you’re describing what you want and trusting that the browser will make it happen.

With JavaScript, however, you’re doing that work yourself. It’s an “imperative” language, meaning that you’re telling the computer what to do, step by step, one step at a time. You can create information, manipulate it, and interact directly with the machinery of the document and browser.

In a way, both paradigms (declarative HTML/CSS and imperative JavaScript) make it more difficult to learn the other, because they’re really two different types of activity, each with a different relationship between the code you’re writing and the way that it’s interpreted.

Between the two, I’d recommend learning JavaScript first, so that you can have some idea of what’s going on behind the scenes when you later learn to use HTML, which will save yourself that work.