Programming and art
Why programming is more art than a science
When observing how people program I found that it is more like people do art than science. I thought of that and I've come to idea that true scientific research has very deep difference with other humans' activity. When you do natural science you have the ultimate criteria - a scientific experiment which shows you (at least we hope that) whether you ideas, laws, formulas etc. somehow correspond to the objectively observable behavior of the nature. And that is why you do not need any additional assessment of your results. Moreover when you do mathematics the main criteria is correctness which can be independently established and the second one (not very important though:) is "do the results you have achieved in math is needed by someone?"
All those give the direct way to create-verify/measure-analyze-loop lifecycle of all scientific activity. From the other point of view the only reasonable criteria of engineering activity is utility. Utility is however not what can be independently or objectively achieved, and we need to involve other human beings to perform an assessment.
The same story is with art. Art in this sense is fully engineering discipline :) Compare two scenarios: one writes a program and another guy writes a piece of art like painting. Both have an idea of what they do and both are professionals, having all necessary tooling and skills. They do the stuff step by step from "big picture" to details, experiencing the similar problems when something needs to be corrected or remade. They may or may not use external sources of "utility" while doing their work, one can easily imagine "agile" style of painting for example. You create, assess it (by running tests or just by looking at), analyze and loop.
And even having more strict tools to assess you program than the art piece (like compilers, debuggers, powerful testing suites, sandboxes, containers etc.) the result is measured only by utilization by other agents - the same as with art. Only methods slightly differ and tools are more restrictive, but not the overall philosophical process.
The learning methodology and the feedback principle
The learning method of math for instance and programming sit on different principles. Nobody will teach you math or physics based on feedback principle. You basically have to know, realize and understand that and why
$$2 + 2 = 4$$
and
$$E = m c^2$$
You just have no ability to verify all mathematical formulas or physics laws just suggesting them, running tests or something and coming up with idea of what is definitely correct.
There is a lot of texts on philosophy of science and the very basic principle under it and that is the way we live now. Science is subject to be reconstructed from scratch based on a small series of axioms (at least much smaller than all possible results) and despite the fact of myriads possible theories or formulas we have just three main filters: internal correctness, nature correspondence and sometimes Occam's razor (the anthropic trick to choose almost equal theories ceteris paribus).
The opposite is with programming - that is like you are taught how to speak with computer based on its' response. So you perform code-run/test-analyze-loop cycle. Where analysis is based only on your own perception or tests which are also of your creation. The feedback principle lies in basis of education of many disciplines and it is because of the very nature of human brains - the same principle gives a boost for artificial neural systems. You just treat the object of investigation as a black or grey box at maximum and given some clues (or even without them) try to establish the communication. That is the way how we learn to code and how we later code being professionals. How we are trained so way you act, nothing strange...
Despite the fact that actual computer and software are white boxes in the most cases they are very complicated such that it is really hard (almost impossible) to predict how they reflect to complex impact. And the trick here is - formalize (parameterize) the impact in a way to easily reformat it, make it and analyze the reaction. The more structured are both impact and reaction - the more fast and successful is education curve and professional growth - the more money you - loop.
After that just eliminate all structures and based on the same principle one can make an art piece. The funny thing here that despite of the fact that art is less structured it is more known and studied than engineering and most of the people problems which humans face during last millennium arise again in engineering and in computer programming as well.
That all because feedback we wait from the studied object without satisfactory tools to measure the outcome independently. However formal methods in computer science can give this tool and they really give it, but... The problem still persists because nobody can specify - give the formal description of what and how the awaited artifact should do and perform.
Could we specify a piece of art
Yes and no. From one point of view you can say to painter or writer - "draw the elephant" or "write a story about love". You can either specify what tools she should use, or what materials or artistic techniques but I can say having two different painters and based on maximal possible specification you will have equal results with 0 probability. (The same is with programming:)
If you say "draw me funny, smiling, and kind elephant" you can later assess whether the resulting creature is elephant, is it funny, smiling or kind, and with non zero probability you will get a negative assessment. Then you can ask the painter to correct something or totally remake the "masterpiece" - doesn't remind anything, does it? And finally when you would satisfied with the result, you can think of project as done.
Now ask yourself, can you in principle give the specification at the very beginning to have the resulting elephant as good as it was intended to be? I think - no.
But the happy story exists. If you ask the similar professional things for mathematician, e.g. prove this theorem or create a theory to solve certain types of equations - you will have later a proof or series of operations which lead or do not lead to the goal, exclusively. You will in every case say - does the result satisfy the task or not. So the assessment in this case is decidable. And this kind of decidability is the very key of why "sciences" have much more pure and predictable way of development than art and... programming.
Because in one case the assessment of result against specification is decidable and in another - not and cannot be until the main criteria is utility.
What is next
Next we will think more about decidability of programs assessment, and find the most suitable example from common life to compare programming with. That is because we cannot just finish on the statement like "programming is art", because it is definitely not only art, and rater not art at all, but what it is like then? Maybe like surgery, maybe like mosaic or puzzle collection, who knows... The thing we are trying to do in computer science is to learn how to specify the programs to do our magic formal methods later. But what if we can not do it in satisfactory way and we base ourselves on false illusion of specification feasibility?
So shortly our next step is to realize why programming in NOT an art :)