A Strong Approach To Learn Programming

Start From Basic Functionalists

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.

  1. 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.
  2. In light of this, I think an ideal language for beginners is JavaScript because (a) a JS interpreter is readily available in most web-browsers, (b) it’s not super-opinionated about it’s object-oriented nature, (c) it comfortably admits both imperative programming and basic functional programming, and (d) it’s widely used in industry (yes, even outside of client-side web-development — I’m currently a device engineer working with embedded JavaScript).
  3. Speaking more concretely, I’d recommend learning how to do the following in JavaScript, preferably in this order:
  4. 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
  5. Memorize these things and practice them every day by writing a program that does something simple (FizzBuzz, for instance) from memory.
  6. 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).
  7. 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.
  8. Once you’ve memorized the basics of Git, integrate it into your workflow when learning the following things.
  9. 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.
  10. 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.
  11. 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.
  12. 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).
  13. Practice more with JavaScript objects, and think about them as variable aggregators. Learn how they can be used to represent more complex data than the basic JavaScript data types. Learn how to use and manipulate these structures. Understand and define JSON and how it relates to JavaScript objects.
  14. Learn to pull in JavaScript objects from a file using JQuery’s getJSON function. Using similar techniques, use a simple JSONP API (like Flickr’s, for instance) to practice using AJAX for pulling in data. Practice inserting and removing this data from the DOM.

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s