Even if you have extensive training in Mathematics, the average Mathematics paper is undistinguishable from the ramblings of a madman. Many of these papers seek to solve narrow problems. And yet, we respect Mathematicians.

Software programming is a form of communication, usually between human beings and machines. While different in style, programming is a subset of the language of Mathematics. If you dig into the average source code, it is undistinguishable from ramblings, even if you are an expert developer.

Yet, we denigrate programming. Many will even deny that it is a Mathematical language. But Mathematics and Programming are not so different:

Mathematics Programming
Building on the previous research papers requires you to dig through endless piles of boring, badly written research papers. Maintaining millions of lines of codes written by various people over the years is difficult, boring, error-prone.
Inventing new theorems or new mathematical theories requires much creativity. Coming up with the next best iPhone application requires much creativity.
For most people, mastering even part of Mathematics requires a decade or more. Please read Teach yourself programming in ten years by Peter Norvig.
The language of Mathematics has directly contributed to technological progress. Electricity, engines, nuclear power, space travel all required extensive use of Mathematics. Google changed the world through the brilliance of its software engineers. The open source revolution has changed how people think about collaboration.
Some Mathematicians are widely recognized as being extremely smart. Some famous people have done a fair share of difficult and technical programming : Donald Knuth and TeX, Tim Berners-Lee and the Web, Linus Tovarlds and Linux.

Why is programming getting so little respect?

  • The intense commercialization of programming has commoditized it. As Paul Graham might say : painters where initially “portrait takers”. It is only when painting lost its commercial function that it became recognized as a noble art. However, just like painters always used their free time to create great art, the best programmers are open sourcing beautiful code all the time.
  • The study  of programming itself remains rather informal. You can get degrees in Computer Science, Computing Engineering or Software Engineering, but there is no degree in Programming. Programming is taught in universities, but generally only in the first few courses of a degree. Yet, there are degrees in Communication, Fine Art, Architecture, Music or Dance. While a degree in Computer Science or Software Engineer can make you a better programmer, the fact remains that your professors are not expert practitioners.

How can we fix this? I have this secret dream of setting up the equivalent of “Creative Writing” program, but for programmers. Call it “Creative Programming”. Basically, students would come together to write great code. Yes, such code might be useful commercially, but that would be a secondary consideration. The pursuit of greatness would be the only goal that matters. It would treat programming as a bona fide language. It would attract the best programmers as guest lecturers. Would this ever work out? I do not know.

I am sure that many will point out that my secret dream is impractical. Beauty should not come first : we want cheap, reliable, maintainable code. We also want programmers to be replaceable, inexpensive and practical. However, human beings can both pursue greatness while being practical. Compromise is possible.

Let me conclude by quoting Donald Knuth:

(…) computer programming is an art, because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and especially because it produces objects of beauty. A programmer who subconsciously views himself as an artist will enjoy what he does and will do it better.

Further reading: The best software developers are great at Mathematics? and Is programming “technical”?

29 Comments

  1. Just who – exactly – denigrates programming, and why should I in any way respect their opinion?

    My guess would be this has something to do with the academic background of you and many of the other readers of this weblog.

    Admittedly, the greater bulk of code is uninspired and unoriginal. (Then again, the same could be said of many teachers I had in past.) Much software only has to be “good enough”, and does not have to meet any major challenge.

    The “Creative Programming” class where “students would come together to write great code” … that class already exists, though more often referred to as “open source software”. The classroom is the Internet, and learning is incidental (though deeply interwoven). The stream of new ideas and practices tumbling past in my feed reader offer much to be learned and used.

    But what is the role of academia in all this?

    Over the weekend was poking around through the RepRap sites. Fascinating stuff. Class is very much in session, with no (or many) instructors, with no lectures (but wikis and weblogs).

    Comment by Preston L. Bannister — 8/3/2010 @ 15:28

  2. @Bannister

    Governments and some companies will not hire you for certain jobs unless you have some university education.

    Moreover, when academia formally recognizes something, its prestige level tend to rise. It may not help the current practitioners, but it helps people who want to start out.

    For better or for worse, programming is often seen as a “necessary evil” for university-level programs. Somehow, we must teach it, but just enough so that we can get to more interesting topics.

    Comment by Daniel Lemire — 8/3/2010 @ 15:56

  3. On programming as art: one problem is that the code that has activated beauty centers in my brain has often turned out to be a nightmare to debug. Trivially extensible, elegant: yes. But not fun when something isn’t working. I suspect it has something to do with art being related to saying a lot with a few words/brush strokes: ‘Elegant’ math proofs are usually the short versions. Being overly verbose in code removes the beauty, but increases the practicality when you’re debugging. I’m positive this isn’t a universal rule (overly long code often being worse than too short code), but it does discourage me from getting too elegant at work.

    As to ‘creative programming’, the solution might be to teach programming earlier in middle/high school. If programming takes 10 years to master, it might be too soon a year in to expect appreciation of code beauty from the practitioner. Given how much science requires computation and how many office tasks can be replaced with a perl script, I think programming is becoming generally useful enough to teach children.

    Comment by Paul — 8/3/2010 @ 16:58

  4. If it sounded as though I am hostile to the notion of academia … I am not. But I am hostile to ingrained organizational behaviors that no longer make sense.

    Universities used to be these wonderful little islands of knowledge and sharing, with relatively limited outside contact. As a student, going to University was wonderful (long ago in my case). Much progress was at universities, as sharing among the isolated minds outside university was limited.

    Now the situation is almost the reverse. All those minds that left university are now more closely connected (and communicating!) than were on-campus folk just a few decades back. Old organizational habits have on-campus minds publishing into places hidden from public view. (If you cannot find it in a Google search, to a large measure it does not exist.)

    All of which tends to render academia less relevant, and that is very sad. Odd that once-centers of advancement are so behind.

    The software group at the local university (UCI) offers an “ISR Distinguished Speaker” series. Been to a few (some were good). But getting to the campus, and driving back (almost invariably in Friday afternoon rush hour traffic) is not fun. Walking out on a bad presentation is uncomfortably rude (for me at least).

    (Something odd about an “Institute for Software Research” that still cannot manage a webcast, and has trouble posting videos.)

    There is another possible side to this. Programming and placing your work in the very-public place of the Internet means many more minds will see your work. If your work is not very good, it will be hard to hide. Some egos may not be able to bear the risk.

    Comment by Preston L. Bannister — 8/3/2010 @ 17:10

  5. @Bannister

    I agree with everything you wrote. But who said that classes and lectures had to be offered solely on campus?

    Comment by Daniel Lemire — 8/3/2010 @ 17:17

  6. Guess I have drifted a bit from your starting point. From my point of view, the “center” of progress has largely moved outside universities (at least for software). I think that is unfortunate.

    Google and Yahoo have developed a habit of capturing interesting videos and posting to the web. I would hope that universities could re-capture those centers (if they have good folk doing interesting work, this should be very possible).

    Heh. I wonder if a future measure of an academic might be the number and quality of the subscribers to their weblog – not so dissimilar to peer review. :)

    Yes, I would hope for universities to place all they could onto the web.

    Comment by Preston L. Bannister — 8/3/2010 @ 17:54

  7. I think until a 17 years old kid can make a video chat system in two weeks that can attract 1,5 million users a day, there is no way he will ever can be motivated by his school to do it as a homework. In this area /programming/ it’s unprecedently easy to materialize your thoughts into a product, while for most mathematicans first you need a context or team who will build that rocket using your calculations.

    Comment by dH — 9/3/2010 @ 1:18

  8. If programming takes 10 years to master

    I am a messy but successful programmer (cowboy programming) and it took me 3 months to master the thing during my initial training. I am just as bad/good that I was then, yet I did a few astounding feats like doubling my salary two years in a row (x 4) at the beginning of my career or cloning the IBM HDLC token ring protocol without any documentation whatsoever*, only spying the messages with a line analyzer (about like what Tridgell did with Samba).
    I have no doubt that a few other open source developers have a similar story.

    Maybe the academics are a bit intoxicated by the “learning”?

    *) It took 6 months to graft this into a bare bones point-to-point HDLC protocol and the project manager of this product would not believe I did that so he reviewed all my code and in the end congratulated me for sticking to his programming standards better than his team.
    (I know, I know, I am bragging but this is more to deride “academicism” which really pisses me off…)

    Comment by Kevembuangga — 9/3/2010 @ 11:45

  9. Paul, you have to read some of what Richard Gabriel has been advocating for sometime now, essentially a MFA in Software approach, http://www.dreamsongs.com/MFASoftware.html. I think you’ll find some kindred ideas.

    Comment by gavin — 9/3/2010 @ 13:02

  10. Great post, I just love Knuth citation. To add a few thoughts of mine:

    1) Knuth IS a mathematician, not really a programmer.

    2) I’d rather add to the list of similarities: programmers are known for the bad and buggy code they write (the first versions of the great code are often awful, then, comes refactoring and bugfixing). This is similar to great mathematicians: if you prove a theorem that nobody proved before, the first proof is often buggy, tedious, and contains errors.

    3) The good and reliable code is usually beautiful.

    4) Last, but not least. Education and training did make me a MUCH better and efficient programmer than I was in school.

    Comment by Itman — 9/3/2010 @ 13:03

  11. I suspect it has something to do with art being related to saying a lot with a few words/brush strokes: ‘Elegant’ math proofs are usually the short versions. Being overly verbose in code removes the beauty, but increases the practicality when you’re debugging.

    @Paul, it depends greatly on what you are considering elegant. From what you are saying, I can understand that elegant means some overengineered design. However, in many cases, simple and elegant solutions do make your code simpler, smaller, and much easier to debug.

    Comment by Itman — 9/3/2010 @ 13:06

  12. I think the main difference is that there is not much specialisation inside programming, as compared to mathematics, and that is due to programming being a much more recent activity. Let me explain.

    Originally Mathematics contained a lot of practical as well as theoretical aspects. These included things that are related to geometry (earth measure), accounting, statistics for government purposes, etc. Over a number of centuries, we learnt to divide all this range into theoretical mathematics which represents an investment of humanity for various reasons (potential huge breakthroughs for other disciplines, artistic and aesthetic reasons) and applications which evolved into other disciplines.

    The general public doesn’t differentiate between various levels of computer science, software engineering, programming, etc. Not that we do have clear distinctions, anyway.

    Comment by Muhammad Alkarouri — 9/3/2010 @ 13:55

  13. @gamin: thanks for the link, I do like those ideas alot. In particular I’m fond of the suggestion for analyzing small code choices in detail. The parallel between writing and programming seems very strong.

    @Itman: Yeah, it’s hard to precisely phrase my thoughts here. I agree that simple, easy to debug solutions are often elegant, and certainly lengthy is in no way synonymous with quality. Perhaps examples would state my point better: highly templated C++ code, for one, like you’d find in Boost. There can be so much going on, so many nested templates, but when you finally piece it all together, there’s this paucity of expression in those templates that’s at once beautiful and maddening. Or closer to the over-engineered example, there’s trivially extensible code where whenever you find you need to add a feature it’s only a line or two of code away…but at the cost that the inner workings are so generic it’s never clear what they’re actually doing. Maybe it’s overengineering, maybe certain problems are innately complicated, but from an aesthetic point of view code I’ve really enjoyed reading hasn’t regularly turned out to be the best to debug. I’ll also say this doesn’t really apply to individual algorithms, like you’d find self-contained within a single function.

    Comment by Paul — 9/3/2010 @ 14:15

  14. @Paul,
    I can hear you. There is a fine line between elegance and simplicity. Generally, templates are very useful. As well as C++ macros. But like many other powerful tools, it is easy to shoot off all your limbs.

    Comment by Itman — 9/3/2010 @ 14:23

  15. I would suggest that you add “clarity” as a dimension of “elegance”.

    In C++ you can use operator overloading, overloaded methods, implicit conversions, and templates to write code that looks short and simple – but is entirely lacking in clarity. (Been there, done that – in the early 1990′s when first starting to use C++.)

    No matter how short the code, if you cannot readily understand what the code does, the result is not “usually simple and effective”.

    Comment by Preston L. Bannister — 9/3/2010 @ 16:57

  16. “For most people, mastering even part of Mathematics requires a decade or more.”

    On the other hand, programming doesn’t require anywhere near a comparable level of effort.

    You comparison falls apart in lots of places. Inventing new theorems requires much more creativity and understanding than coming up with a hit iPhone app. Mathematics has also changed the world much more than Google has. (And open source, seriously?)

    Comment by Jon — 12/3/2010 @ 14:05

  17. On the other hand, programming doesn’t require anywhere near a comparable level of effort.

    And nothing like “elegance” according to Joel.

    Comment by Kevembuangga — 12/3/2010 @ 14:28

  18. @Jon,
    To become an “average” programmer, you may be right. The effort level is (presumably) not nearly that needed to become a first-class mathematician. Then again, what level of effort is required to become an “average” mathematician?

    I majored in Physics in school. Rather a lot of math in Physics. Was told by a friend that he thought my workload was a lot higher than his (as a Mathematics major) – and I seem to recall general agreement from the others present in his major. (We tended to study together a lot, due to shared math classes.)

    Seems I might have some relevant notion about workload.

    I think you have this backwards. The level of effort is a product of your interest and ability. The result comes from the effort of which you are capable.

    You can apply a high level of effort to many different areas, if you are capable.

    As to the “hit iPhone app” and the creativity and understanding needed, you are undoubtedly right – some of the time. (Though I could be over-rating the average for Mathematicians.) On the other hand, there are problems in designing software that stretch the mind, and can require all your ability to overcome.

    I would guess that you are far more familiar with what is hard in math, and not so familiar with what is hard in software. :)

    Comment by Preston L. Bannister — 12/3/2010 @ 15:00

  19. @Preston, I cannot agree more. Actually, so called creative math is 90+ percent crap that is neither creative nor correct. Very much like programming.
    As to the programming impact on our world: considering the first tabulating and punchcard machines, it exists for 100 years. Unlike math that exists for thousands. Yet, almost every gadget that we use has a programmable component. And this is only a beginning!

    Comment by Itman — 12/3/2010 @ 20:36

  20. I like this post.

    Comment by Yuhong — 13/3/2010 @ 1:43

  21. “To become an “average” programmer, you may be right. The effort level is (presumably) not nearly that needed to become a first-class mathematician. Then again, what level of effort is required to become an “average” mathematician?

    I majored in Physics in school. Rather a lot of math in Physics. Was told by a friend that he thought my workload was a lot higher than his (as a Mathematics major) – and I seem to recall general agreement from the others present in his major. (We tended to study together a lot, due to shared math classes.)”

    If you are in college, then you choose your own workload (unless you are a slacker, but then why go to college?).

    A math bachelor’s degree does not make you a mathematician at all, much less an average one. A CS bachelor’s degree, or really, much less than that, makes you a decent programmer.

    The number of programmers is so much smaller than the number of mathematicians that this comparison isn’t at all fair. I don’t think that Daniel’s list of distinguished programmers (Knuth et al.) is very impressive, though.

    Comment by Jon — 13/3/2010 @ 15:49

  22. @Jon,
    We have very different standards for “decent”.

    Comment by Preston L. Bannister — 13/3/2010 @ 16:02

  23. @Jon

    A CS bachelor’s degree, or really, much less than that, makes you a decent programmer.

    We are squarely in the domain of perceptions and values. Many Computer Science students at the graduate level cannot program at an expert level, by industry standards.

    Comment by Daniel Lemire — 13/3/2010 @ 18:39

  24. Quote: “Even if you have extensive training in Mathematics, the average Mathematics paper is undistinguishable from the ramblings of a madman. Many of these papers seek to solve narrow problems. And yet, we respect Mathematicians.”

    Quote 2: “If you dig into the average source code, it is undistinguishable from ramblings, even if you are an expert developer.”

    Although the difference is here, it is hard to tell. I am a mathematician, and a hobbyist programmer (I’m no programmer, but I can write code, and read code without any problems, but don’t work directly in software engineering). And have to disagree. I know a lot of people working on real programming, and I can tell (and they can too!) that what they do *are* mad ramblings. Yes, the average mathematician’s paper is also, but it solves something and usually is well-written and documented. But most of the software I’m referring to (mostly bank systems, ATM control centers and such) is… well, not that good. Is just a mix of code, without any real intention to be pretty.

    Programming is an art *sometimes*. There are wall-painter programmers (also mathematicians, mind you), and the art in this is zero. Why programming is viewed as flawed (by some, I don’t think it is as widespread as you say) is because the sheer amount of programmers falling into this category.

    As a little proof of concept, this Coding Horror “Horror” history about interviewing: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

    Comment by Ruben Berenguel — 29/3/2010 @ 9:46

  25. Don’t worry about the code. Users will not see it. Worry instead about creating a new kind of application that will change the world. It’s application — not implementation — level creativity that matters.

    Comment by Amir Michail — 29/3/2010 @ 12:33

  26. Worry instead about creating a new kind of application that will change the world.

    Tsk! tsk! tsk!
    Don’t tell that to Daniel (he doesn’t believe in “heroes”, in programming either I guess)

    P.S. Speaking of programming skills, I have personally known the author of the 4D Database and had made an estimate of his productivity: he were singlehandedly doing the same amount of work than about 40 good developers, sheeesh… nothing to see here, move on!

    Comment by Kevembuangga — 29/3/2010 @ 13:18

  27. Kevembuangga,
    You are comparing to lousy developers. Though, I will agree that productivity varies by an order of magnitude.

    Comment by Itman — 29/3/2010 @ 13:46

  28. You are comparing to lousy developers.

    I don’t think so, I have seen him ditch 15000 lines of code because “they didn’t feel right”, rewrite all from scratch and have the stuff up and running in a week, ever tried that?

    Though, I will agree that productivity varies by an order of magnitude.

    Already in the 70s, according to a US army survey, they found a factor 26 between the best and the worse DOD developers (who were nevertheless qualified professionals).

    Comment by Kevembuangga — 29/3/2010 @ 15:55

  29. Kevembuangga,
    I easily believe the dropping part. :-)

    Comment by Itman — 29/3/2010 @ 21:31

Sorry, the comment form is closed at this time.

« Blog's main page

Powered by WordPress