Skip to content

The art of programming

There has been a lot said about code being art, and there are quite a few different reasons for this, but I won’t go into them here. There is truth, in that code is art, the problem is that in most cases, programmers misunderstand the term art, and believe that art is whimsical, people look at a painting done by Jackson Pollock using his drip technique and they go:

“Oh, but I can do that!, it just paint splashed in a canvas! How hard can it be?”

The same happens when they hear a cool Rock song:

“Oh! I’m going to be a guitarist, and land me some chicks! How hard could it be to play guitar?”

Well as it turns out, it’s easier to play three chords on a guitar, than to paint like Jackson Pollock or Picasso. But the premise of art being simple, does not make it easy, the same way, that it being complex, does not make it hard. Learning a programming language, is not an easy task, it takes weeks or days to “learn”, but years to use it correctly; just like some one can learn the notes on a pentagram, and the scales, in weeks, but it will take them years for them to write a Symphony.

There is a lot more to just sitting down and banging words out on a keyboard, you need to:

  • plan or design.
  • structure the information your code is going to handle (data structures)
  • the efficient use of said information (algorithms).

There are those that believe, that all the above is only needed for big projects –They believe so because they read articles on how Linus wrote GIT on a few days, or how “X” wrote “Y” in three days. They are wrong.

The truth is that you won’t see me with a UML program, doing diagrams, use case scenarios, and class diagrams, not because I don’t like them, I like them, and use them, when communicating ideas to others, but for the most part I the design in my head, and can visualize it. Before I even consider writing code, I work out the different scenarios in my head, this is easy to do for me, but it might not be easy for you, and that’s fine, sometimes I need to do an outline, or a brain map, before writing code, this is all part of the process of writing.

It’s the same way for a composer when he’s got a commission for a new piece, composers can’t wait for the muse to come when they have a due date for the work –oh, yes composers, writers and painters have due dates.

Composers devise ways of making themselves efficient, and be able to complete their work with enough time, to proof read, re-write, revise, etcetera.. It’s here where some programmers deviate, once the code is written, compiles and runs as expected, only a bug , will make the programmer look at the code again.

Programmers don’t proof read, and they sure as hell don’t like to re-write, and revising is not liked much either. Some do unit testing, which in some cases can cause the programmer to go back, and refactor/revise the code, but in most cases, the programmer just fixes the bug, and does not even care to investigate why the bug was there in the first place, also programmers don’t really look for the most efficient way to code, they avoid making their life easier.

This brings me to the fact that most programmers don’t think about their craft; there are hundreds of books about the craft of music composition, writing a novel, and very few that deal with the craft of programming.

Most programmers don’t even realize that programming, goes beyond the language being use, the language is just a tool; you don’t see painters having flame wars on whether the smaller brush, is better than the bigger brush, for doing a sky line? I’ve never seeing construction workers arguing about which brand of hammer is the best for the job, but you will see that with programmers.

After a long time working on different teams, with different tools (languages) I’ve concluded that most programmers don’t take their craft seriously, and in most cases they sabotage themselves, by not taking the time to look for ways of being more efficient with their time, and their code.

Programming is an art, there is no question about it in my mind, but for it to reach the level of recognition, of the other arts, there is still a long way to go. The knowledge of algorithms, logic, design, and the abilities to do this things well, are worth nothing, if they are not accompanied by thorough, efficient and intelligent coding, do not fool yourself into thinking, that you will be able to make a finished product in a few days. Care for your code, at the end it’s your creation, it exists because you exist, and you made it.

Frederick Brooks had the following to say in his book, “The Mythical Man Month: Essays on Software Engineering”:

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. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”

7 Comments

  1. You changed the visual presence of the site on me!! I really liked the previous one better!

    This is just a very well written, very well portrayed article. Have little to add. I agree with you 100%.

    Posted on 22-Jun-07 at 6:17 am | Permalink
  2. Yes, I’m still trying out themes, and plugins so bare with me, I liked the other one too.

    Please feel free to add to it, as that it’s the idea :).

    Posted on 22-Jun-07 at 6:48 am | Permalink
  3. This one is rad too (check timestamp to see which in one I am referring to). I prefer who this one handleds the on screen widgets. Very web2.0y.

    Yet overall, still liking the first one ;)

    Posted on 22-Jun-07 at 11:58 am | Permalink
  4. You are also getting a lovely error message when I try to post, you might want to check that out. I took your email out just in case.

    Message failed to send to *************@****.*** from tamgo
    Warning: Cannot modify header information - headers already sent by (output started at /home2/xmonk/webapps/blog/wp-content/plugins/swift-smtp/st_swift.php:118) in /home2/xmonk/webapps/blog/wp-comments-post.php on line 67

    Warning: Cannot modify header information - headers already sent by (output started at /home2/xmonk/webapps/blog/wp-content/plugins/swift-smtp/st_swift.php:118) in /home2/xmonk/webapps/blog/wp-comments-post.php on line 68

    Warning: Cannot modify header information - headers already sent by (output started at /home2/xmonk/webapps/blog/wp-content/plugins/swift-smtp/st_swift.php:118) in /home2/xmonk/webapps/blog/wp-comments-post.php on line 69

    Warning: Cannot modify header information - headers already sent by (output started at /home2/xmonk/webapps/blog/wp-content/plugins/swift-smtp/st_swift.php:118) in /home2/xmonk/webapps/blog/wp-includes/pluggable.php on line 331

    Posted on 22-Jun-07 at 12:00 pm | Permalink
  5. Will check it out, it seems it’s the plugin I use for notification, and it seems to happen with pre-approved comments.

    Posted on 22-Jun-07 at 2:00 pm | Permalink
  6. did you ever figure out the resolution to your smtp plugin problem (above)? i have the same issue with me WP installation with swift-smtp with threaded comments.

    Posted on 13-Apr-08 at 2:48 pm | Permalink
  7. Well yes and no. I solved it by using another plugin called wpPHPMailer, it’s not much of a solution, but it would have taken me alot more time to debug and patch the swift-smtp properly, and it seems at that time the author of the plugin wasn’t much interested on the problems, so why should I?

    wpPHPMailer is kind of abandoned, but it works fine with WP-2.5 so no complaints in that front.

    Posted on 13-Apr-08 at 2:58 pm | Permalink