There are a million tutorials out here on the internet showing you bits of code for whatever language you’re trying to learn or implement. There are not, however, a lot of posts or essays on programming theory and logic in general. It’s imperative to have an academic training that precedes your production experience if your production experience is ever going to truly be top notch. This is true for most things learned and practiced in life. It’s like they say about a house only being as good as its foundation. And if your talking about personal computing and programming, you have to ask yourself where the beginning really is.
I’m going to consider the beginning to be birth of the PC and make reference to a book called Accidental Empires by Robert Cringley. This is a terrific book about how the PC came about and gives a more human look at the lives of Bill Gates, Steve Ballmer, Steve Jobs and the folks at Xerox Parc. It covers the players that were in the industry initially and touches on a program called VisiCalc. While these titans of today were developing the first operating systems and hardware as kids in garages, there was one piece of software that was simultaneously being developed that changed everything: VisiCalc. VisiCalc was a spreadsheet software that did something transformative to society: it gave people a reason to want a computer. It gave them something they could really use. The advent of the spreadsheet gave people this living interactive graph paper with a built in calculator and it was a oft overlooked transformative event for all of human society. In this sense, the spreadsheet was the father of the modern day PC. Without VisiCalc, there would probably be no computer on your desk today. This evolution of how humans interact with data was going to come eventually no matter what, but you would probably turn the clock back years on computer technology had VisiCalc not come along when it did.
What does the spreadsheet have to do with programming? Well, think about this one. At its core, a spreadsheet has data and performs functions on that data. For as much as computing has changed since Steve Jobs was building Apple computers in his garage, this fundamental principal has not changed. Think about PHP today for instance. It’s probably the most popular language out there and it’s similar to a spreadsheet at its core. The PHP/MySQL relationship is functions (PHP) being performed on data (MySQL). I’m over simplifying here, but I’m oversimplifying for a reason: to drive home that point that you have to start at ground zero with the fundamentals. And, the fundamental similarities between PHP/MySQL and VisiCalc are not that different.
So what are the root things you need to start with when it comes to computer programming theory? The basics. You should always begin your curriculum at the building block level. You need to know things like variables, strings, integers, operators, and simple functions first. Then you can move on to conditional logic like IF/THEN statements and WHILE loops and FOR loops. When you understand these things very well conceptually, you can then begin to explore groups of functions and then eventually begin on projects. At about the same time you begin exploring functions, you should also allocate some time to error handling and try to gain experience from someone who has already developed tools to handle the most common errors. Understand what the most common errors are and how to isolate them and spot them. If you don’t learn error handling early, you’re desire to program is going to fizzle out quick. If you do know how to handle errors and correct them, you’ll be rewarded with the result of your work actually functioning as you would think it should and you will really be able to enjoy the art/science of programming.
When you have learned the fundamentals and you have followed a simple chronology to develop everything that should be in your foundational knowledge, your learning curve will be an exponential graph as compared to the guy or gal who just jumped in and started with projects.
With the basics under your belt, you’re now ready to endeavor into the realm of projects and actually make things and take things apart. A smart programming technique is to “blueprint’ your application with pencil and paper. You should have a good idea of the project’s structure in mind before you start fleshing it out. You are now ready to start building and adding functions to your tool box. This is truly what is going to separate the average programmer from the good one or great one. You really only get to know how to use functions from practice and finding their applicability to real world solutions. Now is the time to start gaining that knowledge.
One way to really measure how you have progressed is to save your work. With computers being an ever present part of our lives, you will have developed an electronic portfolio of files that define your experience as the years pass by. If you can keep those files and keep them organized, you will have a nice history of electronic information to dip into as a repository when you come to situations that you have come across before. But, more than that, you can go back to some of your older work and review it and ask yourself if you would do it the same way today. If you’re progressing properly, the answer should be that you would do it entirely different.
One of the most important things you should strive for is simplicity. One of the roads you should take to get there is readable code. You should always write your code as if you were going to hand it off to somebody in a hurry. If it can’t be picked up and read by anyone who knows that language in a matter of a few short minutes, it’s not very good code. Furthermore, I don’t think you can claim an application good from the front end if it’s shit from the back end. The two really go hand in hand.
From there, I think you’ll find you’ve reached a summit when you can go back and read your code from long ago and realize how you would have done it different today. I’m picturing a bell curve in my head. In the beginning you’re churning out great work but you’re busting your ass as you climb the hill of knowledge. When you reach the summit, you realize what used to be difficult is now easy. You realize that you have tools now that you didn’t have when you were at the bottom of the hill. Now you can go sliding down the other side of the bell curve being just as productive but use almost half effort because you’re going down hill. This is when you can go back and look at some of your old work and realize that you would have done it with half the keystrokes that you used back then. This is when you understand what simplicity truly is. Simplicity is when you can take two or three functions that do something together synergistically that replace 100 lines of code that you wrote when you were a beginner.
Throughout your learning curve, you can be certain of something: The fundamentals will not have changed. Visicalc, which gave way to Lotus, which gave way to Excel, may give way to Open Office. But, a spreadsheet will be a spreadsheet, functions will be functions, and conditional logic will be conditional logic. Learn this and strive to make your life and your code simple.