Recently, a software developer colleague at my company presented on the topic of programming efficiently in C#. At the end of his presentation, he left us with the remark that programming is an art. The question of whether programming is an art or some other sort of discipline has been discussed since the early days of electronic machines. The discussion has involved academicians and practitioners and continues today. While there is no consensus, it seemed interesting to me to offer a survey of articles on this topic. I refer to a few articles I found on the internet that rely on comments vetted through the publications of the Association for Computing Machinery. There are many blogs and articles and web pages discussing this topic of programming as art or science, and I use the ACM as a filter. Although the ACM is an international organization, there is likely a Western slant to this filtering (apologies to my colleagues in India).
My colleague left us with a quote from Knuth's famous paper on the topic [1], "Premature optimization is the root of all evil". Knuth writes about early attempts to encourage a more scientific approach to programming, "This was at the time C.P. Snow was beginning to voice his alarm at the growing polarization between 'two cultures' of educated people. He pointed out that we need to combine scientific and artistic values if we are to make real progress." Knuth perceived aesthetic properties of programming and respected them.
The problem I have with Knuth is that (in 1974) he seems to think of programming as a series of one-off exercises. Each program is a new thing, possibly beautiful but unrelated to all previous programs. Knuth does not suggest programming needs to be repeatable and feels experience with programming simply begets ever more beautiful programs. But, in my opinion, programming is not a jazz improvisation; it needs to be repeatable and predictable.
In 2005, Denning [5] seems concerned the general public perceives programming as not just an art, but as the arcane practice of a secret society. He writes, hopefully, "The scientific paradigm, which dates back to [17th century scientist] Francis Bacon, is the process of forming hypotheses and testing them through experiments; successful hypotheses become models that explain and predict phenomena in the world. Computing science follows this paradigm in studying information processes. As younger computer scientists advance in the field, they are improving testing procedures to validate results, and they improve the perception of CS as an actual science." Yes, this notion is closer to my own feelings.
For Green and Ledgard [2], coding is simultaneously subjective and non-subjective. (I'm not sure I agree the choice of an IDE is subjective, especially for a team.) Coding guidelines are provided, and intended to be IDE-independent, although their guidelines don't match the default behavior of each and every IDE, and the rightness or wrongness of this is subjective. The article emphasizes code formatting, especially for code that will be read and modified over time. I agree it's important to consider future maintainers, but it's tough to make specific suggestions that are appropriate in all cases, forever.
Haider [3] takes my own approach as that of the practitioner quoting the famous teachers and writers. He notes writers make the case for a discipline that combines art and science, but argues for a more obvious split. Some programmers are more artist, some are more engineer. His arguments intertwine in the end, which is unfortunate, because he was just getting interesting. Still, Haider feels there is a necessary and obvious split. Some programs exist because the programmers were artists, and the other engineers succeed because of the artists. My observation is that some programmers seem either more artistic or engineer-ish, although most do their best to make the art seem like a product of careful thought.
The ACM Code of Ethics [4] is yet another approach mixing the objective ("obey the law", "access resources only when authorized") and subjective ("maintain competence", "be fair"). The code demands that programming is not just about performance and usability and elegance, but also about privacy and legality and just generally making the world a better place. Still, developers don't achieve, say, privacy just by being good citizens. We achieve it through user interfaces and service calls and by knowing which technical decisions make a difference for end users.
In conclusion, I tend to view software development as more engineering than art. There is science in measuring performance or usability, but once we know the experimental results, we put that in practice. There is definitely a thing called Computer Science, but programming is a subset that focuses on practice and implementation, i.e., engineering. I certainly perceive aesthetic qualities of source code, and that I'd rather maintain and read the code of some developers than others. However, I think it's all teachable, and good code is more the result of good practice than some divinely inspired artistic ability. And, our users depend on that.
Bibliography