Is Programming an Art or a Science?

Started by: Zed | Replies: 29 | Views: 2,042

Zed
2

Posts: 11,572
Joined: Feb 2009
Rep: 10

View Profile
Dec 31, 2013 7:50 PM #1133708
Cronos and Gyohdon are making some bold claims. I call cow-crap.

Quote from Gyohdon
Oh dude that reminds me of that awesome discussion we had about whether programming is art


Quote from Cronos
That was a good discussion indeed.


Quote from Zed
Who was on which side?


Quote from Gyohdon
He argued it was I argued it wasn't. In the end he turned me lol

I was looking at programming as more of a mathematical and structural thing so I thought "that ain't no art", but because of the discussion I saw the error of my foolish ways


Programming is clearly a science. Given a language and a set of axioms it is an objective fact whether or not a program does what it is intended to do, and there is an objective fact as to whether or not it does so in the fewest possible number of steps. There is a goal and there are measurable degrees of success. Neither of those are found in an art. The value of art depends on the observer. The value of a program is intrinsic.


Quote from Cronos
It comes down to what you personally define as art. So I am neither right or wrong.

I ask only that we criticize our own definitions of what the word 'art' entails.


Unless we want to get deep into language games, an art is something which invokes feelings based on something other than fact. It is valued by the individual, not by some rock-solid measure. That's basically the opposite of programming.
Cronos

Posts: 5,440
Joined: Apr 2009
Rep: 10

View Profile
Dec 31, 2013 7:52 PM #1133711
Gyohdon, can you copy/paste our conversation into this thread?

Just to begin the debate. It's 4:00am right now and I am about to sleep.

EDIT: Fuck it, I've got it.


Discussion (Click to Show)




--------------------------------------------------------------------------


Let me first ask you this Zed.

What is art but human expression? What is art without recognition?

Write me a program without expressing yourself in one way or another. You're looking at the underlying tools, which are based on science (or more specifically, the result of abstraction layer upon abstraction layer, beginning with basic boolean logic) and telling me that they are purely scientific. Which they are. They exist because they are logically coherent. When we apply these rules, we can expect predictable outcomes.

Yet these are just tools. These are just tools much the same way in which paintbrushes are just tools. Tools of expression. It's up to you to define the difference in expressing yourself through the tools of conventional art (brushes, canvases, pencils, clay, acting, singing, music... ect) and the tools presented to you via the basic foundations of programming.


Why is using your vocal chords to create pressure waves an art, while using abstracted boolean logic to create programs is a science. They are both possible because of science. Yet it's how we use these tools that matters.

Directly address this paragraph.


Also:

Definition of abstraction layers: http://en.wikipedia.org/wiki/Abstraction_layer , because I often refer to this, and it's one of my favorite topics to address. I personally think abstraction is the key to achieving true sentient AI, the singularity and just about anything. It's such a simple idea, yet one that almost no one outside of computer science actually appreciates directly.
Exile
Administrator
2

Posts: 8,404
Joined: Dec 2005
Rep: 10

View Profile
Jan 1, 2014 12:36 AM #1133772
Quote from Zed
Programming is clearly a science. Given a language and a set of axioms it is an objective fact whether or not a program does what it is intended to do, and there is an objective fact as to whether or not it does so in the fewest possible number of steps. There is a goal and there are measurable degrees of success. Neither of those are found in an art.


You could describe music in a very similar way. It's a language of notes, and music theory provides a framework for virtually any arrangement of them. Notes are arranged into chords, which relate to each other depending on the key you're using. If your goal is to create a sense of resolution at the end of a song, it only takes a minimal familiarity of music theory to know a V-I chord sequence will create the resolution you're looking for (assuming the song is in a major key). If you use inverted V and I chords, the sense of resolution will be diminished, and if resolution is your goal, you'll achieve varying degrees of success depending on how you arrange the notes according to their theoretical framework.

They're not "rules" in the same sense as programming, but music is still the end-result of a very organized system that, at its simplest level, involves individual notes, which are just waveforms with pre-determined wavelengths. None of this seems to affect its established status as "art". What's the difference between music and programming that makes the latter inherently non-artistic?
Hewitt

Posts: 14,256
Joined: Jul 2012
Rep: 10

View Profile
Jan 1, 2014 1:06 AM #1133778
Neither. Programming is a medium in which it could either be made as an instrument of science or art. We've seen art pieces before that utilize mathematical shit like the Golden Mean and the Fibbonacci Sequence. We've also seen art pieces that rely on creativity and an alternate perspective. Programming can be done both ways; you can sloppily code something without structure, or you can do everything neatly in arrays and loops and both methods will produce the same result.
Raptor
Moderator
2

Posts: 5,891
Joined: Aug 2010
Rep: 10

View Profile
Jan 1, 2014 3:05 AM #1133852
I edited a spoiler into your post if you don't mind Cronos.

Are we saying something without structure or organization isn't art? I feel that all of programming itself can be interpreted as art, but I don't think it can be considered one or the other depending on the circumstances. In all cases I can think of, it either is or it isn't.
Zed
2

Posts: 11,572
Joined: Feb 2009
Rep: 10

View Profile
Jan 1, 2014 10:01 AM #1133995
Quote from Exilement
You could describe music in a very similar way. It's a language of notes, and music theory provides a framework for virtually any arrangement of them. Notes are arranged into chords, which relate to each other depending on the key you're using. If your goal is to create a sense of resolution at the end of a song, it only takes a minimal familiarity of music theory to know a V-I chord sequence will create the resolution you're looking for (assuming the song is in a major key). If you use inverted V and I chords, the sense of resolution will be diminished, and if resolution is your goal, you'll achieve varying degrees of success depending on how you arrange the notes according to their theoretical framework.

They're not "rules" in the same sense as programming, but music is still the end-result of a very organized system that, at its simplest level, involves individual notes, which are just waveforms with pre-determined wavelengths. None of this seems to affect its established status as "art". What's the difference between music and programming that makes the latter inherently non-artistic?


Quote from Hewitt
Neither. Programming is a medium in which it could either be made as an instrument of science or art. We've seen art pieces before that utilize mathematical shit like the Golden Mean and the Fibbonacci Sequence. We've also seen art pieces that rely on creativity and an alternate perspective. Programming can be done both ways; you can sloppily code something without structure, or you can do everything neatly in arrays and loops and both methods will produce the same result.


The outcome of the program might be art, but that doesn't mean the act of programming isn't a science. You could scientifically construct music, as Exilement pointed out, but the music itself will still be open to interpretation and different people will get different things out of it. Likewise, people will have different reactions to the outcome of a program - I have a strongly positive reaction to the program known as "Skyrim" - but programming is a different matter. There is an objectively right or wrong way to make a program do a certain thing. Skyrim is a magnificent piece of artwork, but the code beneath it all is open to objective measurement.

I'm not sure how well music or paintings fit as analogies here, because I can't think of any way to change the underlying structure of a piece of music without changing the way it sounds.

Quote from Cronos


Write me a program without expressing yourself in one way or another. You're looking at the underlying tools, which are based on science (or more specifically, the result of abstraction layer upon abstraction layer, beginning with basic boolean logic) and telling me that they are purely scientific. Which they are. They exist because they are logically coherent. When we apply these rules, we can expect predictable outcomes.

Yet these are just tools. These are just tools much the same way in which paintbrushes are just tools. Tools of expression. It's up to you to define the difference in expressing yourself through the tools of conventional art (brushes, canvases, pencils, clay, acting, singing, music... ect) and the tools presented to you via the basic foundations of programming.


I don't know any programming language well enough to write a program, but I do know proofs.

Language P (Click to Show)


Formal System PS (Click to Show)


Let's say we are given the task of proving (p' -> p').

We can do:

1. (p' -> ((p' -> p') -> p')) . . . . . . . . . . . . . . . . . . . . . . . . . . Axiom 1
2. ((p' -> ((p' -> p') -> p')) -> ((p' -> (p' -> p')) -> (p' -> p'))). . Axiom 2
3. (((p' -> (p' -> p')) -> (p' -> p'))) . . . . . . . . . . . . . . . . . . . . 1, 2, modus ponens
4. (p' -> (p' -> p')) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Axiom 1
5. (p' -> p') . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3, 4, modus ponens

Or we can do:

1. (~p' -> ((~p' -> ~p') -> ~p')) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Axiom 1
2. ((~p' -> ((~p' -> ~p') -> ~p')) -> ((~p' -> (~p' -> ~p')) -> (~p' -> ~p'))). .Axiom 2
3. (((~p' -> (~p' -> ~p')) -> (~p' -> ~p'))) . . . . . . . . . . . . . . . . . . . . . . . .1, 2, modus ponens
4. (~p' -> (~p' -> ~p')) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Axiom 1
5. (~p' -> ~p') . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3, 4, modus ponens
6. (~p' -> ~p') -> (p' -> p') . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Axiom 3
7. (p' -> p') . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5, 6, modus ponens

Or you could write this, which doesn't work:

1. (~p' -> ((~p' -> ~p') -> ~p')) . . . . . . . . . . . . . . . . . . . . . . Axiom 1
2. ((p' -> ((p' -> p') -> p')) -> ((p' -> (p' -> p')) -> (p' -> p'))). . Axiom 2
3. (((p' -> (p' -> p')) -> (p' -> p'))) . . . . . . . . . . . . . . . . . . . . 1, 2, modus ponens
4. (p' -> (p' -> p')) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Axiom 1
5. (p' -> p') . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3, 4, modus ponens

Proof 1 and proof 2 both achieve the objective, but proof 1 is objectively the better (best, I think) proof, because it gets there in fewer steps. Proof 3 is objectively wrong (step 3 doesn't follow). Programming is exactly the same. Sure, there are many ways to get to the goal, and the goal itself might be beautiful in some way, but programming is a method of getting to that goal and the method can be criticised.

Why is using your vocal chords to create pressure waves an art, while using abstracted boolean logic to create programs is a science. They are both possible because of science. Yet it's how we use these tools that matters.

Directly address this paragraph.


If anything this just proves that singing is not an art. Otherwise we can extend it to anything which is generally considered a science. Suddenly there's an art to testing soil-samples for the presence of nitrogen, or whatever.

Creating the noise is an aspect of science. The noise itself is art. Creating a program is a science, even if the program itself is something artistic like creating patterns of light.
Cronos

Posts: 5,440
Joined: Apr 2009
Rep: 10

View Profile
Jan 1, 2014 1:00 PM #1134034
You're trying to simplify programming to the point where there's a single goal that must be achieved. As if it's an obvious, rigid, unambiguous goal.

With enough complexity, it's impossible to discern the most efficient way to reach your goal. The possibilities are infinite. Just as it's impossible for an artist to hand pick the most efficient way to express his/herself through his/her medium in order to reach their goals (whether that be accurately expressing an idea, pleasing people, making money ect).

Painting a picture is just as scientific as making a program. You're just not aware of just how much work your brain is doing behind the scenes in order to abstract the underlying information and present it to you in a meaningful efficient way. You're still following rules. Also, for example listening to music... As Exilement said; music sounds like music because it makes mathematical sense to your brain. Because it's following a set of rules, whether that be the higher level rules of music theory, or simply the complementing frequencies of the notes being played. Music is very much based on rules, yet you would be hard pressed to find anyone who would dare say it isn't an example of art.

It's all about using tools that complement your skills (whatever those tools may be) in order to achieve a goal. Just because the tool itself is rigid, mathematical and logical, doesn't mean the way you apply that tool will also be rigid and mathematical.

Also, quick read:

http://www.futurechips.org/thoughts-for-researchers/computer-engineering-art-science.html
Scarecrow
2

Posts: 9,168
Joined: Oct 2005
Rep: 10

View Profile
Jan 1, 2014 1:17 PM #1134041
Quote from Zed
Proof 1 and proof 2 both achieve the objective, but proof 1 is objectively the better (best, I think) proof, because it gets there in fewer steps. Proof 3 is objectively wrong (step 3 doesn't follow). Programming is exactly the same.


I disagree. The implementation of the program can be done in any one of hundreds of ways, and there are definitely ways in which code can be written such that it can be considered as 'beautiful' or 'ugly', regardless of the fact that both versions achieve the same thing.

Scripting has more dimensions than just being functional or not. Code can be written to be more verbose, more flexible, more concise, more convoluted, more efficient, and so on. You can code in a way such that anybody can read it, or you can code in such a way that you are the only person who knows what's happening. You can code with script efficiency in mind, or you can code quickly and hack together something that works. Any functional code can have its own style imbued in it by its author, and no style is really wrong; which manner of implementation is the most fitting and elegant is determined by context. For example, just as an artist can choose to either make something with a certain audience in mind or just do things the way they feel like doing things, the programmer can code with co-workers in mind, or can code to just make something that works for them.

I immediately get an impression as soon as I take a look at someone else's code, the same way you might get an impression by looking at a painting. If I'm working with somebody on a project, and I have to work on their code, and all the variables are single letters instead of descriptive titles, and there's no commenting to describe what's happening except for bits copied from onlinetutorials, I would immediately consider their work ugly and amatuerish. No heart was put in to this. A script that's a little bit confusing but with clear explanations in commenting where necessary would demonstrate both capability and commitment; a good piece of work. If they've managed to make their code both descriptive and concise such that there isn't even any need for commenting, I'll appreciate them as someone with real talent.

My point is that by looking at a script and considering its context, it's possible to tell at a glance whether the author is (figuratively) a kid playing with crayons or actually a talented artist.


[edit]
quoted from the article cronos linked above, a more concise way of saying what i am trying to convey:
"3. There exists style and taste in programming. Different programmers program differently. There is aesthetics involved and there exists tips and tricks that vary from person to person.This man-to-man variation exists because it is an art and involves creativity."
Zed
2

Posts: 11,572
Joined: Feb 2009
Rep: 10

View Profile
Jan 1, 2014 3:13 PM #1134091
There are two different aspects of programming at work in your post, and I'm not sure they're both really programming. On the one hand you have the code itself and the number of steps taken to achieve the objective. On the other hand you have whether or not anyone can read your code afterwards. I'd compare this latter part to a scientist remembering to properly label his beakers. You'd certainly expect any experienced scientist to label everything properly, but the labelling isn't a part of the science itself, and a scientist who does his labelling in beautiful handwriting isn't turning his science into an art. In the same way, having code which is readable, and which you can come back to six months later without having to remember every variable, isn't really part of the programming.

Quote from Cronos
You're trying to simplify programming to the point where there's a single goal that must be achieved. As if it's an obvious, rigid, unambiguous goal.

With enough complexity, it's impossible to discern the most efficient way to reach your goal. The possibilities are infinite. Just as it's impossible for an artist to hand pick the most efficient way to express his/herself through his/her medium in order to reach their goals (whether that be accurately expressing an idea, pleasing people, making money ect).


Even without knowing whether your program is the best program possible, it is still possible to strictly rank a given set of programs from good to bad. Likewise with the artist, if his goal is making money it is possible to judge how successful he has been in his goal and we can say objectively whether something else would have achieved his goal better. Making money is not art. Programming is not art.

Painting a picture is just as scientific as making a program. You're just not aware of just how much work your brain is doing behind the scenes in order to abstract the underlying information and present it to you in a meaningful efficient way. You're still following rules. Also, for example listening to music... As Exilement said; music sounds like music because it makes mathematical sense to your brain. Because it's following a set of rules, whether that be the higher level rules of music theory, or simply the complementing frequencies of the notes being played. Music is very much based on rules, yet you would be hard pressed to find anyone who would dare say it isn't an example of art.

It's all about using tools that complement your skills (whatever those tools may be) in order to achieve a goal. Just because the tool itself is rigid, mathematical and logical, doesn't mean the way you apply that tool will also be rigid and mathematical.

Also, quick read:

http://www.futurechips.org/thoughts-for-researchers/computer-engineering-art-science.html


The reason that music and painting are regarded as art is that different people appreciate different music to differing degrees. Sure, there are measurable aspects of each of these things, and in those respects art can be surprisingly scientific (note that this doesn't translate to science being surprisingly arty). The difference is that the measurable aspects are not the whole story. In spite of all the mathematical rules which go into interpreting a painting, different people will have different preferences. This is simply not the case with programming. Given any two programs you can judge which one is better and no one can disagree with you. Given two pieces of art it is possible to have opinions.
Cronos

Posts: 5,440
Joined: Apr 2009
Rep: 10

View Profile
Jan 1, 2014 5:13 PM #1134152
Quote from Zed
There are two different aspects of programming at work in your post, and I'm not sure they're both really programming. On the one hand you have the code itself and the number of steps taken to achieve the objective. On the other hand you have whether or not anyone can read your code afterwards. I'd compare this latter part to a scientist remembering to properly label his beakers. You'd certainly expect any experienced scientist to label everything properly, but the labelling isn't a part of the science itself, and a scientist who does his labelling in beautiful handwriting isn't turning his science into an art. In the same way, having code which is readable, and which you can come back to six months later without having to remember every variable, isn't really part of the programming.



Even without knowing whether your program is the best program possible, it is still possible to strictly rank a given set of programs from good to bad. Likewise with the artist, if his goal is making money it is possible to judge how successful he has been in his goal and we can say objectively whether something else would have achieved his goal better. Making money is not art. Programming is not art.



The reason that music and painting are regarded as art is that different people appreciate different music to differing degrees. Sure, there are measurable aspects of each of these things, and in those respects art can be surprisingly scientific (note that this doesn't translate to science being surprisingly arty). The difference is that the measurable aspects are not the whole story. In spite of all the mathematical rules which go into interpreting a painting, different people will have different preferences. This is simply not the case with programming. Given any two programs you can judge which one is better and no one can disagree with you. Given two pieces of art it is possible to have opinions.


'Given any two programs you can judge which one is better and no one can disagree with you. '

False.

I know from experience that in most cases choosing the better program is almost entirely subjective. As is choosing the better painting/music ect. Sure you can choose a program for its efficiency, but what about its maintainability, structure, readability, expandability. What about the various different algorithms that could be utilized to solve just one problem. There is no absolute structured outline one must follow in order to create something that excels above the rest in all of these areas.

Your brain is presumably some form of software/hardware interface, giving you the ability to create and perceive art in the first place.

En
2

Posts: 2,481
Joined: May 2009
Rep: 10

View Profile
Jan 1, 2014 5:13 PM #1134153
Quote from Zed
There are two different aspects of programming at work in your post, and I'm not sure they're both really programming. On the one hand you have the code itself and the number of steps taken to achieve the objective. On the other hand you have whether or not anyone can read your code afterwards. I'd compare this latter part to a scientist remembering to properly label his beakers. You'd certainly expect any experienced scientist to label everything properly, but the labelling isn't a part of the science itself, and a scientist who does his labelling in beautiful handwriting isn't turning his science into an art. In the same way, having code which is readable, and which you can come back to six months later without having to remember every variable, isn't really part of the programming.


Labelling the flasks is important for organisation but it would not a compulsory part of the experiment in order to obtain the desired result. It serves no purpose in the reaction (if you are talking about chemistry). In programming, each line has its own function; I would compare them to the reactants. Saying that each step is equivalent to ink on glass undermines their importance.

So to change your comparison if I may, it would be like a scientist using unnecessary precursors to obtain the end product. It is still science in that the scientist must understand the relationship between the chemical reactions. Likewise, with a programmer he/she must understand how one line of code influences the next. To identify the most efficient way to obtain a result, the scientist would have to utilize his knowledge of chemicals and a deal of creativity to figure out what combinations would be best. Similarly, a programmer must draw on his knowledge of the language, Boolean algebra, etc along with the same creativity like the scientist, to find out the best arrangement.

Quote from Zed
Even without knowing whether your program is the best program possible, it is still possible to strictly rank a given set of programs from good to bad. Likewise with the artist, if his goal is making money it is possible to judge how successful he has been in his goal and we can say objectively whether something else would have achieved his goal better. Making money is not art. Programming is not art.

Efficiency is important, as I have mentioned, but it is not the only factor. At times, programmers work within a group and one piece of code will be passed from one person to the next. So the criteria for what is the best program will change from what is the most efficient, to what is the most understandable; hence subjectivity now becomes an influencing factor.

Like what Cronos has said, programming is complex. The language is vast. You may be able to achieve the same level of efficiency (or close to) as the other in an entirely different way. If one were to write an essay debating a certain point, and another person sharing the same position argued using different points, how would you know which one is better?

Quote from Zed
Even without knowing whether your program is the best program possible, it is still possible to strictly rank a given set of programs from good to bad. Likewise with the artist, if his goal is making money it is possible to judge how successful he has been in his goal and we can say objectively whether something else would have achieved his goal better. Making money is not art. Programming is not art.

You see you are focusing on the product rather then the process. The artistic aspect of programming exists during the construction of the program while the person is trying to figure out a way to create it using what they have learnt. Therefore the program is a product of art; of ones creativity. Sure you can argue that the program is not art, but you can't deny that the act of programming did not involve some level of creativity and personal touch.
Cronos

Posts: 5,440
Joined: Apr 2009
Rep: 10

View Profile
Jan 1, 2014 5:14 PM #1134154
Quote from Envoy

You see you are focusing on the product rather then the process. The artistic aspect of programming exists during the construction of the program while the person is trying to figure out a way to create it using what they have learnt. Therefore the program is a product of art; of ones creativity. Sure you can argue that the program is not art, but you can't deny that the act of programming did not involve some level of creativity and personal touch.


This exactly.

Also look at this:



Imagine the amount of different ways different people would approach the goal of creating something like this.
Zed
2

Posts: 11,572
Joined: Feb 2009
Rep: 10

View Profile
Jan 1, 2014 5:51 PM #1134171
Quote from Envoy
Labelling the flasks is important for organisation but it would not a compulsory part of the experiment in order to obtain the desired result. It serves no purpose in the reaction (if you are talking about chemistry). In programming, each line has its own function; I would compare them to the reactants. Saying that each step is equivalent to ink on glass undermines their importance.

So to change your comparison if I may, it would be like a scientist using unnecessary precursors to obtain the end product. It is still science in that the scientist must understand the relationship between the chemical reactions. Likewise, with a programmer he/she must understand how one line of code influences the next. To identify the most efficient way to obtain a result, the scientist would have to utilize his knowledge of chemicals and a deal of creativity to figure out what combinations would be best. Similarly, a programmer must draw on his knowledge of the language, Boolean algebra, etc along with the same creativity like the scientist, to find out the best arrangement.


The point of my example was to respond to Scarecrow's case of a programmer who uses one-letter variables rather than descriptive titles. I know that you can't just use whatever string of letters you like on each individual line. The point is that it's a non-essential part of the process which might make things easier for other reasons but isn't really important here.

Does the scientist, or the programmer, need to use creativity? Both need to be able to think around whatever problem they're trying to solve, but that's certainly not creativity in the same way as a novel-writer is creative. It's more a case of being able to work without just following a set of instructions, but that's just a pragmatic issue. Programs, and (some) science, are too complicated for us to actually have a set of steps laid out in advance - that's why they're done by people and not computers - but in theory we could do just that. There is an ideal program for a specific task (given a language, etc.) and we could lay out instructions for how to write that program. There is an ideal mix of chemicals or whatever for the scientist, and we could lay out instructions for how to mix them. We could not lay out instructions for how to write a perfect novel because there is no such thing. A computer could be trained to program perfectly, and a computer could be trained to do science perfectly, but a computer could not be trained to paint perfectly.

For comparison, consider chess. A chess grandmaster doesn't have a set of instructions for how to win - he thinks creatively around the situation in the same way as a programmer thinks creatively around his problems. But we have trained computers to play chess perfectly because chess, like programming, is not an art - it is a science.

Efficiency is important, as I have mentioned, but it is not the only factor. At times, programmers work within a group and one piece of code will be passed from one person to the next. So the criteria for what is the best program will change from what is the most efficient, to what is the most understandable; hence subjectivity now becomes an influencing factor.

Like what Cronos has said, programming is complex. The language is vast. You may be able to achieve the same level of efficiency (or close to) as the other in an entirely different way. If one were to write an essay debating a certain point, and another person sharing the same position argued using different points, how would you know which one is better?


Depends on the arguments. If both are cast-iron logical then whoever used fewer steps did better, otherwise it's a tie. If it's persuasive then that is an art. It's why philosophers get BA's and not BSc's.

Regarding programmers working as teams, can you really say that the objective of the program is to be understandable? And even if that was part of the objective, it's not clear to me that this would make it an art. "Being coherent" is not enough to get you into a gallery as an exhibit.

You see you are focusing on the product rather then the process. The artistic aspect of programming exists during the construction of the program while the person is trying to figure out a way to create it using what they have learnt. Therefore the program is a product of art; of ones creativity. Sure you can argue that the program is not art, but you can't deny that the act of programming did not involve some level of creativity and personal touch.


I'll bring out the chess example on this part too. The fact that you need to think around the problem does not mean that there isn't an objectively right answer.
Scarecrow
2

Posts: 9,168
Joined: Oct 2005
Rep: 10

View Profile
Jan 1, 2014 7:54 PM #1134218
for the sake of discussion, i've built an example. here we have two different styles approaching the same problem (which is borrowed from a challenge thread a while back, that i wasn't able to find. if anyone remembers it that would be a great example also): using only actionscript, make a circle that changes direction and colour and moves around the screen. for the sake of comparison i've made the scripts both behave in the same way; the circles both move at the same speed, and change direction and color at 1 second intervals.

import flash.display.MovieClip;
import fl.motion.Color;
import flash.geom.ColorTransform;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;


//EXAMPLE 1
var moveSpeed:Number = 2;
var speedX:Number = 0;
var speedY:Number = 0;
var i:int = -1;
var circle_mc:MovieClip = new MovieClip();
circle_mc.graphics.beginFill(0x000000);
circle_mc.graphics.drawCircle(0,0,40)
circle_mc.graphics.endFill();
circle_mc.x = (stage.stageWidth / 2);
circle_mc.y = (stage.stageHeight / 2)
addChild(circle_mc);

function randomizeDirection(totalSpeed:Number):void{
speedX = Math.random()*totalSpeed;
speedY = Math.sqrt(totalSpeed^2 - speedX^2);

var negative = Math.round(Math.random())*2;
speedX *=(-1 + negative)
negative = Math.round(Math.random())*2;
speedY *= (-1 + negative);
}

function moveObject(object:MovieClip):void{
object.x += speedX;
object.y += speedY;
}

function randomTint(object:MovieClip):void{
var color:Color = new Color();
color.setTint((Math.random() * 0xFFFFFF), 1);
object.transform.colorTransform = color;
}

function moveCircle(e:Event):void{
if(i >= 0){
i--;
} else if(i < 0){
i = stage.frameRate;
randomizeDirection(moveSpeed);
randomTint(circle_mc);
}
moveObject(circle_mc);
}

addEventListener(Event.ENTER_FRAME, moveCircle);
//END EXAMPLE 1






//EXAMPLE 2
var mvDir:Number = Math.random()*Math.PI*2;
var col:Color = new Color();
var circ:MovieClip = new MovieClip();
circ.graphics.beginFill((Math.random() * 0xFFFFFF));
circ.graphics.drawCircle(0,0,40)
circ.graphics.endFill();
circ.x = (stage.stageWidth / 2);
circ.y = (stage.stageHeight / 2)
addChild(circ);
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, changeDir);
timer.start();
addEventListener(Event.ENTER_FRAME, mvCirc);
function mvCirc(e:Event):void{
circ.x += Math.cos(mvDir) * 2;
circ.y += Math.sin(mvDir) * 2;
}
function changeDir (e:TimerEvent):void{
mvDir = Math.random()*Math.PI*2;
col.setTint((Math.random() * 0xFFFFFF), 1);
circ.transform.colorTransform = col;
}
//END EXAMPLE 2


here's the swf file with both programs running at the same time: http://filz.us/26nM

example 1 was built with things like legibility and reusability of code in mind, and is clearly longer because of this. example 2 was built with efficiency in mind, in terms of both time taken typing it and its performance (the difference is visible in the swf; the circles become out of sync... on my shitty laptop at least). but both ultimately do exactly the same thing, and neither is better than the other as a whole; they are both good in their own ways. as with art, which style you choose to use depends on the taste of the programmer and the needs of his audience.

of course the outcome and final code is bound to be somewhat restricted by the goals of the project, but the same can be said for graphic designers who are given sketches for an advertisement and told to make it happen.
Jeff
Administrator
1

Posts: 4,356
Joined: Dec 2007
Rep: 10

View Profile
Jan 1, 2014 9:09 PM #1134247
This feels like a flawed debate. I don't consider programming itself a form of art, but the resulting creation could easily be. Programming is more of a tool, like the paintbrush is to a painter. You use that tool to achieve the image in your head. The act of painting itself isn't art. Neither is the act of playing an instrument. It's the result that you're after.