Why To Learn Programming? Part 2


In the previous post, we discussed some pros and cons on learning to program. In case you feel good with those points and you’re determined to learn to program, we’ll discuss here how to learn it and what specifically to learn.

As with the previous post, in this one we’ll address these questions from both sides:

  • How to learn programming?
  • How NOT to learn programming?
  • What to learn?
  • What NOT to learn?

So that you will be able to avoid some common pitfalls and learn faster.

How to learn programming?

Nowadays we have plenty of sources of information on all possible topics. This is a huge advantage that we have now that was absent some 15-20 years ago. There are thousands of books written on the topic of programming. However, as I discuss in my course on productivity in learning and working, the most efficient way to learn is to “get your hands dirty.” Yes, you need to learn the theory, but without writing actual code, your learning speed will be much slower.

Make a choice

First of all, before even choosing a programming language, you need to decide what would you like to do? Is it developing web sites? Or desktop applications? Mobile games? Mobile apps? Your choice will affect everything you need to do further.

Make another choice

Once you decided what you would like to do, you need to choose a programming language you would like to learn to code in. For reference, you can take a glance at the list of programming languages on wikipedia that contains 693 programming languages, some of them still in use today, some of them obsolete.

Or, you can just google what is the most popular programming language, but note that you won’t find a single answer. There are as many opinions, as there are programmers out there. Do your research, read the pros and cons of the languages that you feel you would like to work with. You should expect to narrow your search from 693 first to a list of 7-10, and then to 2-3 languages that might be interesting to you.

The next thing you could do is talk to a programmer you know and ask his/her opinion on your short list. But beware that some programmers might be biased toward the languages they use and incline you to use what they like or think is a better programming language. Just know that each programming language has its own pluses and minuses. Find out what they are and make your choice.

Don’t worry, you will be able to change the language later on in your career. Most programmers know 1-2 (some even more) programming languages at a good level and have superficial knowledge of even more languages.

It is important to focus on one language at the beginning so as to learn the main principles of programming, the basics, that are shared among almost all programming languages. After that, any programming language you will decide to take on will seem much easier to learn.

One step at a time

For total beginners in programming, as I already mentioned, there is very much information to learn. In case you will try to learn it all at once, you might feel overwhelmed and, in the end, demotivated. It may be too much for you.

That’s why it is important to learn gradually. Handle one concept at a time. Research on our working memory shows that our brain has a limited processing capacity and can’t handle huge loads of information at once. That’s why it is important to feed it information in smaller chunks.

Learn the basics first then move to more advanced stuff

Hello World!

Usually, the above is the first program anyone writes in a new programming language. It is often used to illustrate the basic syntax of the language you chose.

Hello World program

But there is much more to learning programming than simply learning how to write code. Some things on that list would be:

  • Data types and built-in functions
  • Loops and conditional flow
  • Object Oriented Programming and Functional Programming
  • Programming concepts such as Inheritance, Polymorphism, Encapsulation
  • Basic algorithms (search, graphs, etc.)
  • Testing
  • Design Patterns
  • Multiprocessing

There are things that you will need straight away in your programs. Learn them first, then move to move advanced things, like patterns, multiprocessing and others.

Practice on real projects

This is where you will start facing real challenges and this is where you will start learning the most, actually.

While working on your first project, you will encounter many problems that you won’t know how to solve. And in your search of solutions to your problems you will become acquainted with the largest online community of programmers who help others find answers to their questions - StackOverflow. It helped millions of people, me included, to fix their bugs and make their projects work.

But let’s come back to practicing. By working on a real project, even if it is a simple “todo list,” or a blog, or a calculator, you will face actually the same challenges that you’ll encounter at your job if you will work as a programmer, some of which are: finding a proper way to implement a feature, looking for a better way to structure your code, searching for a built-in feature to help you write the code and many more.

I remember my first real project that I was working on - it was a visualization platform of some aggregated data. Before starting that project, I knew the syntax of both Python and JavaScript, yet the work on the project was 60% searching how to do things, 10% writing code and 30% debugging the code I have written.

However, after that project, I was much more confident working on a real project and the next project took me less time searching and more time coding and debugging.

In the end, good programmers work faster and make less mistakes not because they learned programming somehow differently, or are in some way special. They simply had the same common problems that you will encounter in your path and solved them already. And the only way to do many mistakes and learn from them is to work on projects.

How NOT to learn programming?

As we discuss why to learn programming and specifically how to learn programming from all perspectives, it is worth mentioning what NOT to do while learning programming.

Start with a framework

What is a framework? To explain it in plain language, a framework is a code library that facilitates writing code for new projects. If it sounds confusing, think about it this way:

Imagine you want to create a web site and you decide to write it in JavaScript. In order to do this, among all other things you need a server that will handle the requests of your site visitors and a database manager that will read/write information from/to database. JavaScript has everything you need in order to write a server that will handle those requests and a database manager. Suppose the server will take you initially 100 lines of code and the database manager will be 200 lines of code. As you progress, you will need to expand the functionality of one or both server and DB manager. This introduces the possibility of having more errors and bugs. A web framework in this case represents the code for the database manager and server and many other useful things that you may need while developing a website. It is code written by other people that was thoroughly tested and covers common features you may need.

So, if you are serios about learning to code, then you should learn the programming language first, not a framework.

If you will go with a framework right from the start, you risk not learning some important concepts that will shape your skills as a programmer. This happens because you have to learn the framework itself. So, instead of learning the language, you have to learn what functions and features the framework has and how you should use them.

On the other hand, you need not write your own servers and database managers (although that would teach you a lot). Each language has its own set of built-in functions, classes, types, and so on. Learn them first, learn what the language consists of, and then go on with learning a framework. In the end, any framework is written in a programming language, so by learning the language first, you won’t have any problem mastering the framework, or even writing one.

What to learn?

We’re approaching to the end. Until now, you should have decided to learn programming. You know how to learn. The question that remains is what to learn.

There is a whopping amount of information out there on learning to code and there are a lot of new concepts to learn to be able to code, but you need to start somewhere.

There is one more thing left that has nothing to deal with programming, but without which you won’t be successful. Depending on what you would like to do (sites, apps, etc.), you will need to learn some additional concepts about infrastructure, hardware and other things, that aren’t directly related to learning to code, but which represent an important component in the development process. For instance, for web development, you will need to learn the http protocol and the request/response cycle.

So, except the first thing below, in no particular order you will need to:

Learn the syntax, blocks, looping and conditional flow control statements

Any language has its own “grammar” that you need to learn. This is the least time consuming step, but an important one. Besides that, there is a chunk of concepts that is common to all programming languages, such as looping, blocks and conditional flow. These are the Heroes of Programming. They are present in all programming languages in one form or another and they represent the foundation of your program’s logic. Without these concepts you wouldn’t be able to write even a simple program that interacts with a user or does something depending on a simple condition.

Familiarize yourself with the standard library

Each programming language has its own functions that do things. These functions are numerous, but you don’t need to learn all of them at the beginning. You will learn them gradually, as you work on different projects.

Learn about OOP (Object Oriented Programming) and Functional programming

Here are some of the concepts you will familiarize with at this point: inheritance, polymorphism, encapsulation, mutability/immutability and many other.

Learn basic algorithms and data structures

Once you know how things work, you will need more advanced knowledge on how to make your project better and easier to write. Here you will need to know search algorithms, sorting algorithms, hash-tables, trees, etc.

Everything else

There is so much you can learn, that everything after the above points is up to you to decide. At this moment you will have a solid understanding of what you know and what you do not know. Then, you will have to choose the next thing to learn.

What NOT to learn?

Last but not least - what NOT to learn? Well, this question does not have a clear answer, or any answer at all. As I already said, you need quite a lot of information to excel at developing products, so you will be learning a lot in the process. Just remember to practice as well. Combine learning with doing things and in the end, you will achieve success.

Conclusion

Decision to learn programming

As we saw, the decision to learn programming should be taken seriously and analyzed properly before doing anything. There is a lot of buzz for a while regarding the fact that learning programming is easy, especially considering the wide choice of online sources available today for you to learn.

It all depends on what we consider as the definition of “learn programming” though. If it is only “to be able to code,” then learning to program is easy.

However, I treat it as “having the required skills and abilities to complete a project.” And in my opinion, learning programming is of medium-to-hard level task. It’s no problem to learn to code - the main challenge is to learn to think in code.

I’ve taught programming to people of different ages, from 16 to 30 years old. I’ve also taught programming my wife, who worked as a bank financial analyst. She had nothing in common with coding, but until today she had already built a web platform (both back and front-ends) and now she develops HTML5 games.

So, learning to program is not an easy task. And I say this not to scare you but to inform you about the process. Forewarned is forearmed, as they say.

Next steps

In case you want to learn Python or learn JavaScript, follow this blog, subscribe below, as I will post clear and simple to understand articles on how to master these languages. And you can start by getting to know The Heroes of Programming.