Anyone can write software and anyone can learn to do it. This short 7-part series is a guide-book on writing software. The primary goal is to give a compact overview of software development. A secondary goal is to serve as a jump off point to help you get started writing software. The guide is practical and real-world oriented rather than theoretical in nature. The statements made should be a basis for understanding but anyone who reads the series should come away with their own thoughts on how to do things.
I spent a considerable amount of time on Quora.com reading many answers of the form, “how do I get started writing code?” Exposure to many questions of this variety has influenced my understanding of what people understand about software development. Everything I write here, I have written before, but scattered in various places. This guide is my attempt to consolidate my views regarding this general question.
First Rule of Programming
You cannot write any code if you do not know why you are writing code. You must have a reason for writing code in order to write it. Code writing is not a creative writing exercise as it is based on fundamentally logical precepts. Purpose is required for writing code.
Computer programming is the process of transforming data. You will take data, convert it to a new piece of data. Next, you will take that new data and another piece of data and transform it and so on. That is the primary extent of your efforts.
A Computer Program
Computer programs can be very small, very large, and many levels in between. A program is the embodiment of the conditions from the First Rule of Programming enacted through sequences of transformations that achieve the major and minor goals for which the program was created. The computer itself only executes the sequences that define the program, but the effect of executing those sequences had or retains meaning for those that commissioned the creation of the program. The program does something valuable.
What you should understand at this point is the goal of programming is not programming itself but to achieve something useful. That you will encounter writer’s block if you do not have that useful purpose in mind. Laying out and verifying the sequence of steps to go from one starting point to an ending point that makes that purpose real describes some of the effort of writing code.
I will introduce you to command-line programs. A command-line program (as well as an inline program) is the minimum program you should be able to write. Most goals that can be encoded into a computer can be done in the form of a command-line program. Since command-line programs are so basic in form, they are also the perennial program type through which to learn how to code.