Learning to Program by Working on Real World Projects

Learning to Program by Working on Real World Projects

Just say hell no to “Hello World”

I am going to have to tell you the truth. Most programming books are boring. I have written a couple of these books and I will even say that the books I wrote are boring. You will learn something but it won’t be building the most interesting project. I bet you will throw the code away when you are done with it.

And I am going to assume that when you had the brilliant idea of becoming a programmer, you also had some ideas of what you want to build. Well, start with the book, but instead of building the books project, build your own. Or skip the book, because tech books are pretty expensive and find an online tutorial that will get you started in the right direction.

The book or tutorial will teach you things you need to know about the language, but you won’t teach you how to “think” in the language. By building one of your ideas, you will be working on a real world project. You will also care about the results and remember everything you had to go through to bring your idea to life.

Most example applications that you build in programming books were thrown together for the book. They weren’t designed for people who would actually use the application and they are often missing pieces you may find in a real world application because they were forgotten or there just wasn’t enough room in the book.

Start with an idea

For example, let’s say that you have an idea for a freelance purchasing agent application. It would be for people who do a lot of thrift store and antique shopping. The basic concept is that you have an account on the application. And you can add interesting things you find in your shopping trip that you don’t want to buy yourself but you know that others may like. Than other users can bid on it. And if the price goes up to the point it is worth the finder’s time, he can tell the user that he will go buy it and the purchasing user can put money in escrow for the product. Then the finder will get the difference in cost as a finder’s fee minus a small platform fee.

That is an idea for an app that I have actually had but just never had the time to work on. For a beginner, this seems like a lot, but that’s exactly why you need to build it. You can build a little at a time and you will learn a lot. Start with a tutorial that shows you how to build a blog. Find a book or an online tutorial and get to work. Get the blog working and then start asking yourself what are the differences between the blog application and the application you want to create.

The blog application should provide you with the authentication you need to have multiple users. You will also need that for your agent app. The blog may or may not have user profiles. At the very least, users will have a record in the database with there username and password. So how many more details will you need in the database on the user for your agent app. Maybe a full address, a Paypal email address and a few other details.

So now you have to modify a few things in order to add those details. You will have to add columns to the database to hold the data. You will have to add fields to the form for adding a user. You will have to display those fields in another part of the app. So now it is time to hit up Google, the programmer’s best friend and start searching.

So just work your way through your blog app, asking questions while you are slowing modifying it to the app you want to build. And while you make your first pass through the app, you will not be writing the best code or using best practices, but you will get there. Because if this is something you really want to build, you will catch the bug once one little part of your code starts working. It’s addictive.

My experiences using this method

This is the method I used to learn every language or framework I know. In fact it is how I started programming. The first online business I started was on eBay. I slowly built up a store finding products online I could resell. It was slow because it took a lot of research to determine if I could make a profit. At the time, in the early 2000s, eBay didn’t provide marketing tools or an API. I thought if I could sort any eBay search or category by bid, I would find products where the demand was higher than the supply.

So I chose Visual Basic as a language, something I would not do today. But at the time, it meant I wouldn’t have to mess around with the user interface too much. I started piecing together the application using Google, when I knew specifically what I wanted it to do. So basically: search eBay with an invisible browser, page through the results saving the listing data, order the listing data by the bid count and present it to the user.

Since the ability to search Google involves a little knowledge of programming terms, I read through a book on Visual Basic first. I never followed along with the example software being built. I tried to grasp some terminology and get a 10000 foot view of the process. So that I would know what an array was, that I would want to put the eBay search results in one and that I would need to search “Sort Visual Basic Array” in Google.

Since my knowledge of what I could do was limited at the time, I would augment my targeted searches with browsing through “snippet” sites. The equivalent process today would involve taking a walk through Github topics https://github.com/topics that spark your interest. This is how I found the first snippet of code to scrape eBay, because I didn’t even know enough to call it scraping.

Since I didn’t want to learn how to use a database to keep things simple, I output an HTML report. And it worked. I actually used it for product ideas for my own auctions. I also sold a few hundred copies as shareware. I kept learning as I thought of new features the tool needed. And I picked up a more advanced book on Visual Basic and learned a lot more. I had been in the field. I knew what terms meant. As I read the book, I learned how to improve the code I had written.

When I learned PHP and MySql, the process was essentially the same. I got an Idiot’s book on the topic and read through it. Then I built a site that took product datafeeds and generated SEO optimized web pages from them. Shortly after working on this site, I actually got my first job writing code. But I didn’t stop working on side projects when I got the job.

My writing app, Zen Notebook, has gone through multiple versions. It started out using Node Webkit and Angular. Then I went to Electron and Ionic. The last iteration kept Electon and changed from Ionic to React. I eventually am going to create a React Native app. All of these changes were to learn new technologies and the result is a tool I actually use. If it wasn’t, I wouldn’t have learned as much as I had to have a working knowledge of the new technology.

When all I had was a couple of months to learn enough about machine learning to build a fraud detection system, I used competition and prize money as a motivation. I just happened upon a machine learning stock market contest. Instead of even running a toy data set through the platform I was working with, I went directly to using the tournament data. I built and tweaked models until I thought I had a pretty good chance of winning something and managed to get 8th place and prize money with my first entry.

With Golang and blockchain, I killed a few birds with one stone. I wrote Go code for open source blockchain projects on Github and I got paid for it through Gitcoin. Sometimes adding the incentive of a little extra spending money helps you push through the hard parts. At the time, I had no ideas for software I wanted to create in Go. I wasn’t about to create my own cryptocurrency project. That would only be a toy. And I wasn’t in need of any tools at the time. It turns out that I eventually decided on a cryptocurrency trading bot that I will build one day. At the end of my experience with Golang, it became one of my favorite Languages.

To recap

And this is a process you can use over and over to learn new languages. Forget starting with the boring technical book. Start with the motivation. I know you may already have that “light at the end of the tunnel” type of motivation that in a few months or years from now, you can get a job that pays well using what you learned. But unless you are really disciplined, that may not be enough to carry you across the finish line.

So pick a project sized goal. If you have an idea for a tool that you would use, build that. If there is a contest in the language, enter it. If you can make money off of a bounty, then start hunting. You need a reason to finish. You need something real to work on.

Once you have an idea that you want to build, grab a book or find a few tutorials on the topic. You are going to read through it quickly to get a concept of what you will be doing, not worrying about remembering too much. But while you reading, note the similarities and differences in functionality between your application and the one in the book.

Next, you will start building the application in the tutorial or book, using Google to fill in the gaps between it and what you want to build. And I guarantee you will learn more than from working from the book alone. You will do things incorrectly and you will get stuck, but if you picked the right project, you will be driven to work through the issues and come back later to refactor code that just works to code that works right.

Taking it further

Let’s that you already browsed through the coding book, have built your pet project and it’s working well. Now what. Now it is time to get better. Let’s say that you used ReactJS to create your application because that’s the framework you wanted to learn.

Now is a good time to find a more advanced book on ReactJS and read it through. And as you read it, note anything that you read that you could use to take your application to the next level. When you are done, collect all your notes and decide which you want to implement.

Another great type of coding book to read once you have a beginner’s grasp of a language, framework or technology is a recipe book or cookbook. These books usually lists dozens of code snippets or methods of accomplishing very specific goals. Every snippet is a tiny deep-dive into what the language can do and provide inspiration on adding features to your application.

Find applications that are similar to yours and scope out any features you want to add to your application. Then work on adding them.

Or let’s say you like working in the frontend part of the application and you want to learn about that. Well, then play with the design of your application. Take a look at a few applications similar to yours, read more about CSS and work on a redesign.

Or maybe you want to learn more about databases. Find a tutorial on your data source of choice and connect your application to it. Now your application can store data.

If you picked a project you enjoy working on, it will grow with your skills as well as helping you grow your skills.


Subscribe to my mailing list

This post or part of it will be included in my upcoming book: Blue Collar Programmer: A Six Figure Career Guide for College Dropouts. Signup to be one of the first people to get the book!


Stephan Miller

Written by

Kansas City Software Engineer and Author

Twitter | Github | LinkedIn

Updated