Two Approaches to Learning Programming: Top-Down and Bottom-Up
There are two general approaches to learning how to program, both with their own pros and cons.
The Top-Down Approach
With a top-down approach, the goal is to learn by creating significant pieces of real software.
Most self-directed learners take the top-down approach when they first start learning to code. They want to make something cool, straight away – maybe a 3D game, or a nice-looking interactive website.
The fastest way to make something significant is to follow a tutorial – specifically, a very detailed tutorial. If you follow the set of steps exactly, you are guaranteed to create something.
Top-Down: The Good
The beauty of the top-down approach is that you create something quickly. It feels good to produce a real piece of software with your own fingertips. You can get addicted to that feeling, and it can help you push through the learning process.
Top-Down: The Bad
The problem with the top-down approach is that it does not teach fundamentals.
At the end of the tutorial, you might not understand how your creation works at all. If the tutorial is not detailed enough, you might struggle to fill in the gaps. If you deviate from the instructions in the slightest way, it will break, and you might not be able to diagnose the problem.
It’s like being thrown straight into the deep end of the pool, before you’ve learned to swim.
Arne Brasseur reflects on teaching the top-down approach:
I have taught many people Ruby on Rails. Rails is tremendously complex [but] in a few sessions you can teach a person to create an interactive website backed by a database. It’s frustrating to teach because you’re walking a tight rope. Just follow the steps. Don’t peek under the covers. Don’t stare into the abyss. But that feeling of instantly being productive is what draws people in, what makes them think, “hey, maybe I can do this”.
The Bottom-Up Approach
With a bottom-up approach, the goal is to learn all the fundamental concepts of programming.
The bottom-up approach is more popular in formal programming courses, like those in university or college. It involves starting from zero and learning one concept at a time. The idea is to build a solid foundation of general programming skills, which can be used to make any kind of software.
Bottom-Up: The Good
The beauty of the bottom-up approach is that you learn truly general programming skills. It doesn’t matter if you’re making a 3D game, or an interactive website – the fundamental concepts of programming apply to everything.
Each individual concept is easier to learn, because you can study it in isolation. If the bottom-up course you’re taking is structured well, you won’t be bombarded with 1000 different concepts at once. You should be presented with one new concept at a time, in an order that is easy to digest. Basic concepts come first (like values and variables), before more-complicated concepts (like functions) that build on top.
Bottom-Up: The Bad
The problem with the bottom-up approach is that it’s slow. It takes a long time to learn all the skills necessary to make something significant. A typical bottom-up schedule might look like this:
- First you learn about strings, and integers, and variables.
- Then you learn about booleans, and branching, and looping.
- Then you learn about arrays and structs.
- Then you learn about functions and control flow.
- Then the teacher tells you that most professionals don’t code this way anymore.
- So you start learning about classes, and instances, and instance variables, and methods, and inheritance, and a whole bunch of other object-oriented programming concepts.
- Then you try to unlearn the way you originally learned to write code, and learn to write code in the new object-oriented way.
It could take you months or years to complete this schedule, and it still won’t give you all the skills to make a 2D game or interactive website!
When it takes forever, and you’re not creating anything interesting, it can become boring. A lot of people find that studying control flow for a week is just not as enjoyable as making a website in a day. If you’re not getting that feeling of accomplishment, you’re less likely to continue learning.
Which Approach Is Best?
Neither approach is better than the other. To become a skilled programmer, you need both.
You need experience creating software, even if you don’t fully understand it. You need the motivation to continue learning, and that feeling of accomplishment can help. Studying concepts and theory alone is not enough to prepare you to work on real software projects.
You also need fundamental programming skills. The need to be able to understand and debug code – both your own code, and code written by other developers. You need to be able to write code in situations that you’ve never encountered before, because there will not be a tutorial for every different problem you need to solve.
The best approach is to alternate between the two.
Feeling overwhelmed, like you have no idea what your code is doing? Switch to a bottom-up approach. Go back to basics, and learn precisely how your code works. Try to fill in the gaps in your knowledge.
Getting bored of studying abstract programming concepts? Switch to a top-down approach. Create something small, like a simple website or game. Try to exercise all the concepts you’ve learned, and get that feeling of accomplishment.
Eventually the two approaches meet in the middle. You learn a lot about how your code works under the hood, which gives you the confidence to solve any problem. And you learn how programming concepts and theories apply to real-world projects – where to use them, where not to use them, and how to use them well.
This learning process never ends. Software development is so complicated that no single person understands everything, which means there is always something new to learn. So don’t worry too much about what you don’t know yet – it just takes time. My advice is to relax, and enjoy the ride.
The Programming For Beginners Book Approach
Programming for Beginners is a bottom-up approach to learning programming.
It starts at the very bottom, assuming that you know literally nothing about programming. Fundamental concepts are introduced one at a time, in an order that is designed to be easily absorbed by your brain.
To try and keep the book fun, and provide that feeling of accomplishment, every chapter ends with a programming challenge. The reader is encouraged to make a small, text-based game, using only the programming concepts learned so far. Because the book takes a bottom-up approach, the games are very simple – they aren’t 3D, or even 2D, they are just text.
The programming challenges exist to give you the experience of writing a piece of software by yourself, without any tutorial. It’s a chance to exercise the general programming skills you’ve learnt from the chapter. And even though it’s not 3D, you still get that feeling of creating something interactive – something you can type to, and have it type a response back to you.
If this sounds good to you, have a look at the free sample chapters, and give Programming for Beginners a try today!