It was Black Friday weekend. And I bought 8 courses from Udemy. One of the things that I have learned is how to learn from online courses. Initially, I viewed courses from PluralSight. One of the instructors in PluralSight misguided me into listening to courses when I was doing my gym routine or when I am free. It is one of the worst ways to learn coding.

Coding is similar to Driving

Coding is similar to driving a car. How do you learn to drive a car? Do you read books to drive a car? Or watch videos to drive a car? We learn to drive a car by driving the car. (in a controlled environment). Coding is somewhat similar. Unless we code, we don’t learn about coding.

I am quoting from a training program I attended when I was at Microsoft.

Listening to lectures or reading a book helps you to retain 10% of knowledge. Viewing videos will help you retain 30% of knowledge. Doing will help you retain 80% of knowledge.

These numbers are notional. But you get the idea, right? The best way to learn about coding is by coding.

Learning to drive is somewhat easy. There are only a few controls: steering, accelerator and brake. After you practice for a week, you are good to go. But learning technology is very complicated.

Learning to code is very hard

I might be disappointing you. Learning to code is very hard. But it is only hard than learning to drive. There are a few methods that can help you. The first thing that novice programmers do while learning is trying to remember the syntax or the hard details. This is where you can take it a bit easy with coding. If you goof up by pressing the accelerator instead of the brake, you meet with an accident. But doing the wrong syntax with code gives only a compiler error. There is no harm done. So, learning about syntax and hard details comes to you naturally with practice. It takes time. As learning takes time. And no amount of listening to videos or reading books can short-circuit the process of actually doing. Learning to code involves doing mistakes and fixing it. And it is true even for seasoned professionals. We just have to make sure we fix those mistakes before releasing the product.

To help you understand how hard it is to learn to code, consider the following JavaScript snippets.

In the above snippet, A and C works as expected. B does not work because the function context (this) is not set correctly. And expert JavaScript programmers know that A and C are equivalent.

Asking questions to learn

As a learner, you should ask yourself a question. If A and C are equivalent, why did we have two options? Till 2015, C was the only option available to JavaScript developers. ES 2015 added arrow functions to simplify retaining the scope (this) within the function block.

But that is not all. Arrow functions have a limitation. Consider another variation of the same code.

It is possible to bind a context (this) to an anonymous function but not to an arrow function. And you won’t learn all of this unless you try and see it for yourself.

I hope the above example helps you understand why learning to code is difficult. And also leads you to a way of learning. By asking questions. When you have a doubt, you have a question to ask. There are a few ways you can address that question.

  1. Try it out yourself. (all the right and wrong options)
  2. Ask the course instructor in Udemy.
  3. Google.
  4. Ask the question in StackOverflow.
  5. Write it down somewhere so that one day you know the answer.

Asking questions to yourself and answering it is a very good way to learn. I also use StackOverflow as a way to learn. Not by asking questions. But trying to answer questions. When I was learning React, I answered questions in StackOverflow, hoping to learn from people who have problems.

 

Practice with a sample project

Trying out a sample project is a great way to learn. The sample project should not be too easy. But it should challenge you a little bit. Just like lifting additional weights to exercise your muscles. Also, it should not be too big. Trying to build a product after learning something new is a sure path to disaster (for the product). Practice with no objective other than to learn.

For making a career in the software world, you probably have to learn about 5 technologies. For example, a front-end developer in React ecosystem knows about HTML, CSS, JavaScript, React and Redux. So, learning these technologies will help you with a career. So, won’t you invest doing a one month project on each of these technologies? For a 5 month workout, you have lucrative returns. Not a bad deal.

To give a concrete example, after doing the Mongo course by Stephen Grider in Udemy, I developed an API for birds. It is available in GitHub. Believe me, I had fun doing it. And I blogged about it earlier.

Learning is fun

Learning is fun when done this way. Don’t worry about hard syntax or the right way. Don’t be afraid to commit mistakes (pun intended). Ask questions. And try out all options in your code. Freak out on people by doing sample projects and brag about it in Facebook. If done this way, it is real fun. And I had fun going over 8 courses in Udemy on Black Friday sale! Blockchain is one of the tougher courses I took. And here is an exchange with the course instructor.

Exchange with Udemy instructor on Blockchain

As you can see from the above exchange, I am happy with learning by asking questions. And highly encourage Udemy as a good forum to learn.

Learning to learn online courses from Udemy