DEV Community

Discussion on: What was the thing that made you finally 'get' JavaScript?

Collapse
 
dwilmer profile image
Daan Wilmer • Edited

For javascript, I would say that there are several levels of javascript that have their "smallest unit of understanding" to reach.

  1. The "I can do this in every practical language" level:

    • variable assignment and operator (the idea of moving data)
    • if-statements (and, derivative from that, for and while loops. basically the idea of conditional code execution).
    • defining and calling functions (the idea of reusing solutions, including recursion)
    • Array and object access and assignment (nothing fancy, just the concept of "this thing is actually many things").

    These things are the basics of programming. If you know this, your skill set is Turing complete and you can create (theoretically) anything. You also still don't know anything Javascript-specific (apart from syntax) and your code can probably do a lot more when you get to the next level.

  2. The "This makes Javascript stand out from PHP" level:

    • the concepts of functions as first-class citizens (or: a function is a thing now)
    • event- and callback-driven program flow (or: it does what when now? Derivative ideas: promises and async / await)
    • variable scope (closures, let/const, or: what variable is defined in which blocks)

    Coming from a procedural background, these ideas are what made Javascript stand out for me. Sure, these concepts can be (and are) used in PHP right now, but it's not nearly as common as in Javascript.

    These concepts are used all throughout the Javascript landscape, and if you really grasp these concepts you are ready to work with the vast majority of frameworks. This is the level of most javascript developers, I think. If I had to choose only one crucial turning point, it would be this.

  3. The "Javascript master" level:

    • Prototypes and object inheritance.
    • ...?

    I don't know enough about Javascript to know what else should be here, but this is the level where you know everything the language has to offer and you can use it to you heart's content. If you want to create a framework instead of use it, this is the level you need to be on.

Collapse
 
vunderkind profile image
mogwai

Whoa. This is a nice framework for thinking about it. I feel like I'm, as you say, 'nearly' Turing-complete, and I can see exactly where I'm stuck: event-related JavaScript, including things involving some form of API/state-setting.

This is useful. Very.