While doing the homework of the iOS course I started last week, I noticed that I lacked most of the essential background in computer science. Of course, I knew this already, but I needed to experience it for myself, by not being able to do exercise zero of the CS193P course on iOS programming.
So I did a step back and started the CS106A course on iTunesU, Programming Methodology. It uses Java and Eclipse, which I had to install on Mac OS 10.8. It is going pretty well so far, since I’m already at lecture 6 in only five days! The pace is slowing down, naturally, because the subject matter becomes more complicated and involved as the course goes on. The suggested pace is 2 lectures per week, with 10 weeks as suggested time to reserve for the course as a whole.
I’ve picked up a few useful hints, for example, that it is important to give credit to the creator of code, in the sense that if you didn’t write it that you state where you got it from (who wrote it). You simply can’t take credit for other people’s work if you want to become any good at this software development stuff. The ability to solve problems on your own (and not merely combining code others have written, using some kind of script) is key, as is developing a writing style for your code that makes it easy to understand for outsiders (which might include you, after having not looked at the code for a long time). For that reason I will not share any of my CS106A code on this blog. I don’t want to tempt others not writing their own code, and thusly missing out on an essential educational experience.
Having a working program is not as important as having a program with source code that is easy to read, since 80 to 90 percent of the energy of writing code is spent on maintaining code, and the rest on writing new code. If your source code is easy to read, bugs can be removed easily. And if changing conditions require the code to be revised (read: partially rewritten), well written code in a consistent style is a good investment of time, even if it takes longer to write as you write it.
Another realization I had with CS106A is that coding is only part of what software developers do. What is a computer program anyway? It is an artifact that solves a particular problem or set of problems. Problem solving is what it’s all about. A computer program is merely the medium in which the solution to a problem is expressed.
Computer science, therefore, can be seen as the science of solving problems in a predictable manner.
It is perfectly feasible to write software that solves problems in a convoluted way, not using any of the established patterns of computer science. If you don’t take a step back now and then, merely concentrating on having a working piece of code, you will never become a good programmer. You will stay at the level of a script kiddy, making use of the work done by others, without really understanding how to create such work yourself. You need to be able to fully understand what you are doing, what you are trying to accomplish as a whole, as well pay attention to details that matter for a correct execution of code. The former is the creative part of software development; the latter is more like the artisan part.
The course makes me feel humble, realizing how little I know about writing good code, nor how to solve problems in a consistent and predictable manner, nor even how to spot problems to be solved.
Understanding something is a problem that could be solved I suppose is an important trait to have as a software engineer. Most people (grudgingly) accept difficult situations as they are, without realizing some of them could be turned into something that is easy to deal with, if they just had the proper tools and some training. Good software solves a problem people didn’t even realize they had. It takes a curious mind to discern something is making people’s lives less than optimal, and a determined mind to find a solution to this perceived problem.
Thanks for reading and I will keep you posted on my progress of CS106A and, after that, CS106B.