This breakdown is much more useful. “Writing a computer program” means defining what information you’re starting with, defining a series of steps that describes exactly what the computer will do with that input, and defining the output the computer will return when the program is finished running.
Think of a flowchart, which appears to be a useful mental hook for how programs work. You start the process with certain inputs. Along the way, you take certain actions when specific conditions are true or false. The process ends when you reach the end of the flowchart, and you’re left with the output: the end result of the complete process the flowchart describes.
Creating a computer program seems to be a different way of doing the same kind of thinking you do when you create a flowchart. You ask the same sorts of questions:
What am I starting with? What happens at the beginning of the process? What happens after that? After that? When does the process end? What do I have when the process is done?
That’s basic programming, really. Defining inputs. Setting variables. Creating processes that lead to the desired outputs.
Thinking through those processes like a flowchart, adding conditionals and exceptions as necessary. If all goes well, you supply the inputs, run the program, and get the desired output. This is a massive oversimplification of a very complex activity, but it’s detailed enough to be useful for someone new to programming. By deconstructing programming in this way, it’s easier to know where to start.
The First 20 Hours: How to Learn Anything . . . Fast! by Josh Kaufman