A Strong Approach To Learn Programming
Once you find a solid learning tool that teaches using a bottom-up approach, what’s the best way to learn? I have a pretty controversial opinion on this: I think it’s absolutely essential that beginners start memorizing the basics as soon as possible. I think that memorization is quickly becoming a lost art-form when it comes to higher learning. You’ve probably heard people speak of it disparagingly (“don’t memorize, internalize”, “I suck at memorizing stuff”, “I hate tests where I have to regurgitate memorized facts”).
On the other hand, when you’re in elementary school you’re largely forced to spend time memorizing your multiplication tables. Why? Because your basic multiplication tables are building blocks of more complicated algorithms like long division. This isn’t much different from memorizing syntax in a programming language: the more natural it is for you to write an if-statement or a for-loop, the easier it is to use those as building blocks for more complex programs.
I’ll admit that memorization is not always the best way to learn every topic, but I believe that when just starting out with programming it’s absolutely essential that you practice it. Why? Because it reduces friction, and if there’s one thing that leads to frustration for beginners, it’s friction.
With that in mind, here’s some concrete advice for people just starting out and looking to get into web application development. In fact, I’d go a bit further and say that this is a good plan to get started learning any type of software engineering. Obviously, this isn’t a one-size fits all plan, but I think it’s pretty good for the majority of learners just starting out.
- Learn the basics of a weakly-typed language, and avoid languages that force or strongly encourage object-oriented programming with classes. Seriously — if someone mentions “classes” or “inheritance” to you, it’s a good idea to run the other way. While I agree that these topics are essential to software development in general, I strongly believe that they should not be taught to beginners.
- learn how to print something out (console.log)learn how to declare and define variableslearn basic arithmetic operations (including the remainder operator)learn loops (focus on “for” loops)learn abstracting repeated code as functionslearn strings and basic string manipulations using for loopslearn arrays, and array methods for looping (focus on “foreach” loops)learn to create and manipulate objects as aggregate data
- Memorize these things and practice them every day by writing a program that does something simple (FizzBuzz, for instance) from memory.
- Learn the basics of Git, and learn to use it from the command-line. This means starting with four basic Unix commands first (ls, pwd, mkdir, cd). When doing this, learn to mentally represent your filesystem as a ‘tree’ (or a hierarchical structure).
- Once you’ve mastered the *nix commands and have some practice navigating your file system from the command line, learn a few basic Git commands. Specifically focus on git init, git status, git add and git commit). Practice visualizing the repository as a simple linked structure of commits, even if that means drawing a picture occasionally.
- Once you’ve memorized the basics of Git, integrate it into your workflow when learning the following things.
- Learn the basics of HTML. Be able to create a simple HTML page from memory. Learn about the DOM and how to think about HTML as specifying a hierarchical tree structure. Spend some time thinking about how this relates to the hierarchical model of the file system that you learned in the previous step.
- Learn CSS selectors and how they allow you to zero-in on certain parts of the DOM. Learn about the relationships between DOM elements. Learn what it means for a DOM element to be a parent or a child of another DOM element. Learn how this differs from a descendant or an ancestor relationship. Memorize selectors that allow you to select elements via these relationships.
- Learn JQuery, and focus primarily on its DOM manipulation abilities (sure, it’s not necessary anymore with querySelect, but it’s still widely used and — quite frankly — it’s fun). Learn to insert and remove elements from the DOM using JQuery, and practice visualizing how this affects the tree structure that’s defined by the DOM.
- Practice event-handling and DOM manipulation in JQuery (e.g. practice making manipulating the DOM when a user clicks on something, or at a specified time interval).
At this stage, building a simple slideshow that cycles through Flickr images is an incredible project that will really test your ability to make things happen using all of the fundamentals learned previously.
I think if you make it this far, you’ve mastered a large number of essential concepts in programming and Computer Science. Specifically, you’ve learned the most essential elements of computer programs (if and if-else statements, loops, variables, objects, functions, arrays) and you’ve learned to think in terms of important data structures like linked lists (Git commits) and trees (the DOM and your file system). At this point, you’re definitely ready to move on to more advanced topics.