Recently I came across an article I remember reading quite some years ago and having quite an influence on my thinking.
A short summary in my own words. Creating software is usually viewed as a form of engineering, hence the name software engineering. Engineering consists of designing constructs and building them. What exactly is then programming? In engineering of products like hardware, house-hold devices, bridges, or houses – hard products– first a design is created, then a the actual product is build. How can engineers know if they’re design is correct? They create mock-ups, use calculations and their knowledge to verify correctness of their design (nowadays usually with help of software) and show mock-ups and visualizations of design to end-users, product managers, marketing or other people involved.
Finally they have the product actually build by robots or contractors. Many people, even many software developers think programming is part of the building phase. Is this correct? Programmers write code and frequently use their IDE, compiler, automatic unit tests to verify the correctness. Then, they’ll show the outcome to all parties involved. When all is good, the software is packed and installed to servers or pressed on CD-ROMS to made available to the public. When comparing to other enginering jobs as listed above, these tasks are all part of the design task, except maybe for the part of releasing/publishing (which is often not done by the software engineer but by either an automatic process or a system administrator). So all in all software engineering, as well as programming, is design all the way.
See code as design for the source.