Programming is the art of solving problems. Specifically, computer programming is the art of solving problems using computer software, or sometimes computer hardware.
The art of software programming involves several important steps.
The first step involves identifying the problem: Just what is it the program is supposed to do? It can be something relatively simple, such as converting a set of data to a different kind (e.g., converting a bitmap from one file format to another), or something quite involved and complex (e.g., connecting different computers around the world, making them talk to each other, understand each other, i.e., creating the Internet).
The second step usually is the how-to phase. It involves analyzing the problem, breaking it down to smaller chunks, each of which may produce new problems that need to be solved. Because of that, this step may be recursive. This second step may take anywhere from several minutes to many years, depending on the complexity of the problem and the urgency to find a solution. This is also the most invisible step of programming, one that can happen at the oddest of times, not just while you are sitting at your computer, but while you are taking a shower, attending a party, watching TV, even while asleep (relaxed mind always helps).
The next step involves finding out if the problem or a part of the problem has already been solved by someone else, and if so deciding whether that solution is sufficient (in which case your work is done), or can be adapted to the problem at hand, or perhaps needs to be be redone from scratch.
Once the problem has been broken down to the smallest subproblems possible, the programmer needs to identify the proper tools, which typically involves finding the appropriate programming language. This step is often neglected, especially when the programmer thinks of himself as a C programmer, or a Fortran programmer, or a Java programmer (etc), rather than simply a programmer. Yet, this step is just as important as all the ohers: It is certainly easier and more efficient to create a web counter in several lines of Graphic Counter Language than in ten thousand lines of Cobol, to name an obvious example.
The next step is the most visible (to the public), namely coding, i.e., writing the code for the program. If done too early in the process, it may involve a lot of trial and error. But if done after all the previous steps have been fully completed, coding can be like automatic writing, appearing almost effortless.
The final two steps involve testing and debugging. Unfortunately, these are often skipped, especially when there is corporate pressure to release the software early and start making money quickly, and more money by releasing upgrades which may or may not include debugging of the previous version.
All of the above steps can be done by the same person called programmer, or they can be done by a group of persons, some of whom may be better at certain steps than others. The best software is generally produced when a single individual is capable of going through all the steps, but not all programmers have that ability.