Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 09:47:26 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Code as Art. Discuss...
Pages: [1] 2
Print
Author Topic: Code as Art. Discuss...  (Read 6382 times)
Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« on: February 03, 2009, 02:11:04 AM »

I love well indented, well formatted and clever code, but could well designed code be art?
Logged

One day I'll think about doing something to stop procrastinating.
Kekskiller
Guest
« Reply #1 on: February 03, 2009, 02:16:22 AM »

It's more a craft, imho... Or "arts and craft". Or abstract ASCII art.
Logged
Hajo
Level 5
*****

Dream Mechanic


View Profile
« Reply #2 on: February 03, 2009, 02:18:45 AM »

In the same sense as engineers consider well-made gears, machines, constructions in general, to be art, code can be seen as art.

On the other hand, this kind of art does not aim for artistic freedom, but excellence in execution. Still there is room for being creative, doing things that have been done before, in better ways - while better here usually means things like "more efficient", "less weight" ... technical aspects.
Logged

Per aspera ad astra
Colonel Mustard
Level 0
**


View Profile
« Reply #3 on: February 03, 2009, 03:07:50 AM »

When I read the topic I thought of this:
http://lab.polygonal.de/2007/09/09/quadtree-demonstration/

I know it's not what you had in mind, but the beautiful illustration of the structure is just elegant.
Logged
HannesP
Level 0
***


View Profile WWW
« Reply #4 on: February 03, 2009, 03:40:28 AM »

It's more a craft, imho... Or "arts and craft". Or abstract ASCII art.

Even though the purpose of a ceramic fruit bowl is to keep the fruit in place, it can still be a beautiful piece of work, right? Wink

IMHO code is somewhat like a car. Its exterior (the "looks" of the code) might be pleasing to eye, but it's the clever solutions of its inner workings (the code itself) that stuns you. Of course it's harder to get stunned offensively ugly car. Tongue
Logged
Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« Reply #5 on: February 03, 2009, 04:00:53 AM »

When I read the topic I thought of this:
http://lab.polygonal.de/2007/09/09/quadtree-demonstration/

I know it's not what you had in mind, but the beautiful illustration of the structure is just elegant.

The demo is awesome :D
Logged

One day I'll think about doing something to stop procrastinating.
J.G. Martins
Level 2
**


AKA anvilfolk


View Profile WWW
« Reply #6 on: February 03, 2009, 04:34:59 AM »

When I read the topic I thought of this:
http://lab.polygonal.de/2007/09/09/quadtree-demonstration/

I know it's not what you had in mind, but the beautiful illustration of the structure is just elegant.

The site is awesome :D

Quoted (and modified) for truth Smiley



Also, I take Kekskiller's viewpoint on this. Code is much too formal, well-defined and deterministic to really be called art. I find that craft is much more meaningful in this sense, because it implies so many things.

I like programming for sort of the same reason I like blacksmithing, for example. For me, personally, they are both crafts: in crafts, typically, you can't just jump in an do something cool, good-looking or effective. You have to go through years and years of experience, always striving to learn more and new things every day.

When one looks at a piece of craft, one marvels not only at the solutions found for the problems that came up during its creation, but also at the skill of the craftsman and the ingeniousness of his creation. This is, I feel, a sort of generalization of what HannesP said in his post.

So, long story short, I don't think code is artistic in a direct sense, but a craft in that its beauty and elegance lie in the skill of the maker.
Logged

Gold is for the mistress -- silver for the maid --
Copper for the craftsman cunning at his trade.
"Good!" cried the Baron, sitting in his hall,
"But iron, cold iron, is the master of them all."
--- Rudyard Kipling
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #7 on: February 03, 2009, 05:56:47 AM »

If it's intentionally created to be read by others, e.g. a tutorial, I think it can be art. Art to me is something which was created primarily to be experienced, not for any useful work. Programming is usually more like plumbing: when it works, you don't care how. Does anyone here know how in detail their home's plumbing works? The layout of the pipes might be beautiful as anything, but if you don't see it, you don't care.

Useful things can have artistic elements, that's called decoration, but a fruit bowl that has pretty flowers on it doesn't make the bowl itself art in the same way that a painting of flowers is, because the painting was created to be experienced, whereas the bowl was created to hold fruit (although sometimes people can just use them for decoration and never hold any fruit in them, so it is contextual).

But code written to be read by others is intended to be experienced, not intended to just be useful, so I think it qualifies.
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #8 on: February 03, 2009, 06:00:00 AM »

You can also have code-formatted jokes, and that can be art in the same way that jokes are art.

E.g.

Code:
while($lifes_a_bitch) {
live();
}
die;
Logged

Gravious
Level 2
**


"Swedish meatballs"


View Profile WWW
« Reply #9 on: February 03, 2009, 06:36:43 AM »

You can also have code-formatted jokes, and that can be art in the same way that jokes are art.

E.g.

Code:
while($lifes_a_bitch) {
live();
}
die;

i loled
Logged

One day I'll think about doing something to stop procrastinating.
Kekskiller
Guest
« Reply #10 on: February 03, 2009, 06:55:40 AM »

Sometimes programmers are really artists:

Code:
#!/usr/bin/perl -w                                      # camel code
use strict;

                                           $_='ev
                                       al("seek\040D
           ATA,0,                  0;");foreach(1..3)
       {<DATA>;}my               @camel1hump;my$camel;
  my$Camel  ;while(             <DATA>){$_=sprintf("%-6
9s",$_);my@dromedary           1=split(//);if(defined($
_=<DATA>)){@camel1hum        p=split(//);}while(@dromeda
 ry1){my$camel1hump=0      ;my$CAMEL=3;if(defined($_=shif
        t(@dromedary1    ))&&/\S/){$camel1hump+=1<<$CAMEL;}
       $CAMEL--;if(d   efined($_=shift(@dromedary1))&&/\S/){
      $camel1hump+=1  <<$CAMEL;}$CAMEL--;if(defined($_=shift(
     @camel1hump))&&/\S/){$camel1hump+=1<<$CAMEL;}$CAMEL--;if(
     defined($_=shift(@camel1hump))&&/\S/){$camel1hump+=1<<$CAME
     L;;}$camel.=(split(//,"\040..m`{/J\047\134}L^7FX"))[$camel1h
      ump];}$camel.="\n";}@camel1hump=split(/\n/,$camel);foreach(@
      camel1hump){chomp;$Camel=$_;y/LJF7\173\175`\047/\061\062\063\
      064\065\066\067\070/;y/12345678/JL7F\175\173\047`/;$_=reverse;
       print"$_\040$Camel\n";}foreach(@camel1hump){chomp;$Camel=$_;y
        /LJF7\173\175`\047/12345678/;y/12345678/JL7F\175\173\0 47`/;
         $_=reverse;print"\040$_$Camel\n";}';;s/\s*//g;;eval;   eval
           ("seek\040DATA,0,0;");undef$/;$_=<DATA>;s/\s*//g;(   );;s
             ;^.*_;;;map{eval"print\"$_\"";}/.{4}/g; __DATA__   \124
               \1   50\145\040\165\163\145\040\157\1 46\040\1  41\0
                    40\143\141  \155\145\1 54\040\1   51\155\  141
                    \147\145\0  40\151\156 \040\141    \163\16 3\
                     157\143\   151\141\16  4\151\1     57\156
                     \040\167  \151\164\1   50\040\      120\1
                     45\162\   154\040\15    1\163\      040\14
                     1\040\1   64\162\1      41\144       \145\
                     155\14    1\162\       153\04        0\157
                      \146\     040\11     7\047\         122\1
                      45\15      1\154\1  54\171          \040
                      \046\         012\101\16            3\16
                      3\15           7\143\15             1\14
                      1\16            4\145\163           \054
                     \040            \111\156\14         3\056
                    \040\         125\163\145\14         4\040\
                    167\1        51\164\1  50\0         40\160\
                  145\162                              \155\151
                \163\163                                \151\1
              57\156\056

It's fucking awesome, to see such a code. But good looking code doesn't need to be good (I think it was said here before). And that's why the code above is just art, the resulting text is art, the look of the code and also the thought itself. But looking at needed code we still need a lot of work to make a useful code look like art. So, you can say craft or art - it's rarely both.
Logged
David Pittman
Level 2
**


MAEK GAEM


View Profile WWW
« Reply #11 on: February 03, 2009, 11:19:27 AM »

This reminds me of one of my favorite programming quotes, from the Mythical Man-Month:

Quote
Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination.

Whether or not a piece of code can be considered art on its own, creating code certainly feels like an artistic endeavor. Which, incidentally, is almost exactly what the quote in my signature also says.
« Last Edit: February 03, 2009, 11:42:08 AM by David Pittman » Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #12 on: February 03, 2009, 11:22:16 AM »

It doesn't for me. Designing a game feels artistic, drawing feels artistic, writing music feels artistic, but coding just feels mechanical. I'm not in a "how do I make this pretty/interesting/wonderful" mindset when coding, the way I am with those other things. I'm in a "how do i get this darn thing to work" mindset.
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #13 on: February 03, 2009, 11:24:39 AM »

One reason for that is coding can be extremely frustrating. I mean sometimes you make mistakes when drawing or use an off-note when writing music, but mistakes while coding can break the whole thing and make it completely fail to work, and sometimes be nearly impossible to fix, whereas a mistaken line or a bad note won't break the whole drawing or song. Drawing and writing music and writing stories by contrasts is way more peaceful and not frustrating at all.
Logged

David Pittman
Level 2
**


MAEK GAEM


View Profile WWW
« Reply #14 on: February 03, 2009, 11:41:24 AM »

I actually find similar challenges in writing code and composing music. I start with a basic idea in my mind of something I want to create. How a system should work, or how a piece of music should sound. Then I start building it, writing code or arranging chords and melodies. On a good day, it all just works, but sometimes things don't fit together so nicely: my interfaces aren't well-architected, or a harmony sounds dull and trite, or a matrix transformation isn't working the way I thought it should, or I can't find the right chord change to segue into the prechorus the way it sounds in my head. If the problem gets really hairy, I step through one line at a time in a debugger, or try every combination of notes until I find the right ones. And in both cases, I find that the more I practice, the more it comes naturally and I learn to anticipate and avoid the tricky problems in advance.
Logged

bateleur
Level 10
*****



View Profile
« Reply #15 on: February 03, 2009, 12:17:18 PM »

I think code can be art, but you'd have to be an extremely good programmer to write such code and a fairly good one even to appreciate it.

Thing is, most of us can't even get the functional aspects of code right without expending a lot of effort. The necessary degrees of freedom to introduce artistic expression are there in principle, but we can't exploit them.

Best analogy might be writing. Beautiful calligraphy is definitely art, but a six year old who has only just learned to write cannot produce art in this format.
Logged

genericuser
Guest
« Reply #16 on: February 03, 2009, 12:46:46 PM »

In my opinion, code can be art. However, it's "functional art", with the emphasis on "function".
This makes it harder to see the beauty in a piece of code, since it'll most likely be created with the intention of performing a task, rather than being a piece of art.

Of course there's the exceptions, like the "camel code" Kekskiller posted, but then again; there's a reason why most people don't code like this- it's harder to debug, harder to write, harder to understand, and it just takes more time.

Kind of like using pantomime instead of saying "I'd like a burger" at the counter.
Logged
Gold Cray
Level 10
*****


Gold Cray


View Profile WWW
« Reply #17 on: February 03, 2009, 01:06:04 PM »

In my opinion, code can be art. However, it's "functional art", with the emphasis on "function".

Yet another reason to learn Lisp. I really will do that one day.
Logged
J. Kyle Pittman
Level 6
*


PostCount++;


View Profile WWW
« Reply #18 on: February 03, 2009, 01:31:01 PM »

Is program code itself art?  I don't think so.  I can look at a piece of code and judge its readability.  If I integrate it, I can judge its usability.  If I study it, I can judge its efficiency.  But the text of the code, taken either within or without the context of the functionality it represents, holds no aesthetic or emotional value to me.

The process of designing code is another matter.  It takes a creative mind to invent clever, elegant solutions to problems.  The steps of recognizing and understanding a problem or inventing a feature, imagining a solution, planning the internal structure of the code and its API, implementing and iterating, and finally being able to use it...that feels artful.

I suppose that's part of why I tend to gravitate towards engine code over gameplay code -- there's more systems design involved.  Gameplay code does often tend to feel rote or mechnical.

I sort of resent the idea that programming is inherently frustrating.  Yes, some problems are frustrating.  It's frustrating when code doesn't do what you expect, and it takes hours of debugging to find out why the code is misbehaving.  But once the problem is understood, the process of inventing a solution is...maybe not fun, that might be overstating it, but...it satisfies a creative urge, and it's rewarding to see it work in the end.
Logged

BeskarKomrk
Guest
« Reply #19 on: February 03, 2009, 06:23:08 PM »

I don't really think coding is art, but that doesn't mean it isn't rewarding or creative. I guess it depends on the person.

For me, I go about other creative endeavors much the way I code: I go very linearly. That's just the way I am. Obviously, not everybody is like that, which leads to differing opinions.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic