Programming Doesn’t Suck! Or At Least, It Shouldn’t

So, two different posts crossed my transom recently, that I felt I had to respond to. First, and most egregiously, there’s The Daily WTF’s Programming Sucks! Or At Least, It Ought To. Then there is this blog post on Why Functional Programming Doesn’t Catch On.

I am of the opinion, having covered much of the computer industry one way or another, that there are no non-trivial, uninteresting problems. The reason is just this- any problem that is boring, trivial, and/or mechanical should be done by the computer. I mean, come on, people! We’re programmers. If anyone anywhere should be able to harness the power of computers to make our work easier, it should be us programmers- the ones harnessing the power of computers to make everyone else’s work easier!

If programming sucks, it’s because we’re being incredible stupid. Five lines of code duplicated over and over again, just to set some UI properties? Dear gods, people. Hasn’t any heard of subroutines? Abstraction? How about straight up code generation, or maybe implementing a DSL? OK, maybe if you’re only replicating those five lines a couple of times it’s not worth the bother. But if you’re replicating (with minor variations) those same lines of code over and over again, it’s probably worth it to step back and consider how to abstract things.

Abstraction helps up the percentage of interesting code vr.s boring grunt work code, by minimizing the amount of boring grunt work code. If you can turn five lines of code, replicated ten thousand times, into one line of code, replicated ten thousand times, you’ve just turned a 50 KLOC project into a 10KLOC project, doable at least 5 times faster (and probably more like 25 times faster). Get the crap work out of the way fast, so you can get on to the more interesting stuff.

I’m not even talking about leaving your language of choice, I’m talking about thinking outside the box, or even just thinking. But learning new languages is an advantage in making programming not suck, because if nothing else, it gives you new tools for your tool box, new ways to consider abstracting the code. And some languages are better than others, and the more you know, the more likely you are to know a good one. And if you don’t know the better language, you can’t use it.

My initial response to the DailyWTF post was that it was another classic example of the starving child in Africa syndrome. You’ve seen the pictures. A child in some hell-hole of a third world, generally Africa but parts of Asia and South America qualify as well. The child is hungry, maybe starving, disease ridden, bug infested, and destined for a life that was nasty, brutish, and short. But they’re smiling away, happy as can be, simply because they don’t know any better. Everyone they’ve ever known, seen, or even heard of has been in exactly the same boat they are. That’s just what life is like. I often times think that many programmers are just like that staving child. They put up with, indeed don’t even see anything wrong with, having to write half a dozen lines of code just to set some UI properties, because they’ve never known any better. Bug ridden, virus invested, bloated, slow, impossible to maintain, that’s just what programming is.

The second post is convincing me that the situation is much, much worse than that. That it’s not just ignorance is the problem. It’s not just that many programmers don’t know any better, it’s that many programmers don’t want to know any better, and are looking for an excuse, any excuse, to stay ignorant. It’s as if that starving child doesn’t want food, and would reject food if offered.

The reason that post is causing to me think this is because I’ve heard this argument before. All of them. See, I lived through the last great paradigm shift, when the industry moved from Procedural to Object Oriented- and heard the dying remnants of the one before that, from unstructured to procedural programming. I’ve heard all these arguments, or should I say excuses, before- from people trying to avoid learning C++ and Java.

And excuses are what they are, because it impossible to jump through the hoops. For example:


  • Any example of less than several thousand lines of code is a toy or a trick, and thus irrelevant. Real programs are tens or hundreds of thousands of lines long, and saving a line to two here or there is pointless. Any example more than a dozen lines long won’t be read, and thus is irrelevant.

  • Any example that uses the advanced idioms and features of a language simply proves that the language is too weird, complex, and hard to learn. Any example that doesn’t use the advanced idioms and features of a language is irrelevant because that’s not how programmers competent in that language would write the code.

  • Any example that is not directly applicable to what the programmer is doing right now is irrelevant, because that’s not what real programmers do. 3D rendering to games developers, server programming and database access to business logic programmers, GUI interactions to the desktop applications developer- if you’re not writing my code for me, what good are you?

  • Comparing the productivity of different teams of developers is irrelevant because different programmers are differently capable. Comparing the productivity of the same team of developers in different languages is irrelevant because the the same programmer will be differently capable in different languages. Solving the same problem(s) in the same way(s) is irrelevant because the nature of the solution will favor one language, and that’s not how you’d solve the problem in the other language. Unless you solve the problems in different ways, in which case you’re comparing apples to oranges. Not having a ready made comparison simply means there is no proof of your biased claims.

  • The object code produced by my compiler for my language (which has had thousands of man years of effort put into it’s optimizer) is much faster than the object code produced by your compiler for your language (the optimizer for which was written by some guy in his basement over a long weekend). And this is the way it will always be.

  • The only way for a language to become popular is to have shelves full of books on it at your local bookstore, glossy magazines for your boss to read, thousands of programmers in the language lining up for the thousands of jobs in the language, etc. I.e. the only way for a program to become popular is to already be popular. And since your language isn’t already popular, it’ll never become popular.

  • Your language is hard to learn. My language is easy to learn, because I already know it. People won’t learn what they don’t already know.

I heard every single one of these argument used against C++ and Java back in the day. Every single one. If these arguments were valid, then we’d still be programming in Fortran and Cobol. In fact, I’d argue that we still are. What made Cobol suck so bad wasn’t the language. It was the fact that it took five lines of code to set up some UI parameters- and even more so, because the Cobol programmers didn’t abstract, did look for the general case (which is, in general, interesting), but simply replicated the five lines over and over again.

I’ve done the “boring” data processing job. Turns out there’s a deep and interesting problem in the middle of that “boring” code. When I sing the praises of this language or that paradigm, I’m not trying to sell you a bill of goods, I’m offering you a way out of sucky programming. Come with me, if you dare- to a magical land full of interesting and deep problems, where drudge work is rare and quickly disposed of. A land of mystery- where the game is always afoot, Watson! Can it be done, how can it be done, can it be done better? Come with me to where programming doesn’t suck, but achieves it’s place as one of the great art forms and engineering miracles of the age.

What’s the first step, you ask? Well, first you need to learn a new language…

This entry was posted in Classic, Programming Language Punditry. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

13 Comments

  1. Posted February 22, 2009 at 10:05 PM | Permalink

    “We just need you to translate our Photoshop mock-ups and use cases into a web app using the Foo framework.”

    That kind of coding is pretty dreary. Every once in a while, you can manage to squeeze a glimmer of an interesting problem out of it — but it’s usually tangential to the actual goal. Hell, it took me a while to learn to not make problems for myself by trying to be fancy out of sheer boredom: it’s really better to just crank through it the easy way and then get onto other fun stuff.

    Given encouragement (and funding) to explore and innovate, any programming job can be interesting. But the reality is that there is a very large, very popular category of jobs which are simply churning out web applications, and innovation and exploration aren’t in the budget. A lot of this stuff is heading overseas — which is fine by me — but it still makes up a large percentage of contracts out there. And while these contracts do a just fine job of paying the bills, I wouldn’t choose to do that stuff in my free time.

    Ultimately, the issue is a lack of opportunity to innovate and explore, and a lack of appreciation for innovation and exploration (for solid good business reasons). This is part of what I was so frustrated about when I wrote The Programmer is Dead; Long Live the Developer!: a standard set of technologies defines the boundaries of what can and can’t be done, and innovation is considered both risky and extraneous to business — at least partially because it requires a much more expensive breed of developer to take over the code down the road.

  2. Brian
    Posted February 23, 2009 at 12:05 AM | Permalink

    I suppose some people like boring. Some people don’t mind being on maintenance and life support. It’s not your life, it’s just your job. That’s cool. But if programming sucks, if programming is making your life miserable, GET OUT. Life is too short. Go get that doctorate in theology, take a different job (again, knowing the better language can help you land the better job), go into a different line of work, whatever- just stop being miserable. Take a pay cut if need be- if you’re in it just for the money and don’t mind being miserable, become an investment banker. They make lots more money than programmers. My point was that there are options- being stuck in the boring miserable job isn’t the only game in town.

    But this is one excuse I considered mentioning, but discarded: “The boss won’t let me.” Really? The boss controls what you do in your spare time? Not only can you not work on new languages at work, but they also disallow you working on new languages at home? It’s rare for new technologies to be imposed from the top down- generally they sneak in the side door when no one is looking. That’s how Perl, Python, Ruby, Linux, even PCs, got into the work place. And don’t underestimate the power of getting a different job- organizations, like people, vary in adoption rates. Some are early adopters, some late. Getting a job at a more early adopter sort of company can do wonders for what your boss will let you do.

  3. Richard G.
    Posted February 23, 2009 at 6:48 AM | Permalink

    Great post.

    My personal experience is that much of the boredom comes when people start development without any thought into the design. By jumping in, people are restricting themselves to the most straightforward implementation, which usually involves a lot of copy-and-paste. If a little time is taken, then some of the repeated functionality can be identified up-front and handled before repetition gets grandfathered in. In some cases, real elegance can be achieved.

    A favorite technique is the use of functions in a local scope. Haskell can do this (let, lambda, where) and, IIRC, Java can too. You create a function inside of another function to handle grunt-work, like setting UI parameters. Since this inner function isn’t visible outside of the outer function, you can create quick abstractions that don’t require larger commitments or planning. It also provides a great place to start refactoring.

  4. Posted February 23, 2009 at 11:28 AM | Permalink

    I believe you’re skipping over a couple of things. In the real world:

    * You spend a shitload of time working around bugs and limitations in closed-source third-party software that you depend on. This is not an interesting problem.
    * There is no such thing as a design. I don’t care so much for a spec, but I like (as you do) to have some kind of structure in my codebase. Business “logic” is more often than not conflicting, ambiguous, formless and so on. No fun there.
    * The codebase is a godawful mess that the previous cowboys left in their wake as they rode their horses into the sunset. But it works! And it has to keep working! Exactly the way it works now, except for that we want this and this and this and this, and oh MINOR DETAIL there is no spec and there are no tests whatsoever. Fun!

    All the refactoring in the world couldn’t change the fact that the vast majority of real world programming SUCKS. And none of the real world programmers I’ve worked with gave a shit or could be bothered to clean up unused code or even INDENT their code (I once worked with a guy who wrote everything — and I mean EVERYTHING — on ONE SINGLE LINE). Whether those are good things to do isn’t very relevant — I’m clearly not the only one that likes keeping things clean, and yet I’m so, so alone. And I actually LIKE cleaning up messes, but the suits won’t allow it.

    Sticking our heads in the sand won’t change a thing. We must acknowledge the fact that business applications suck and will always suck. Then we must figure out how t
    o make it possible for all of us to work on interesting stuff and leave the tall mirror buildings to crumble in their tangled messes of globals and jumps and angle brackets.

    It can’t be emphasized enough that firing bosses is a viable alternative to sucking it up. Avoid mortgages/kids/wives because they’ll put you at your boss’ mercy. If you want a bearable life as a real-world computer programmer, you will have to be completely indifferent to money. Don’t look for a new job before you quit because t
    he new one will always look better than your current job. Instead, be job-free for a couple of months and then look for a job that you’d rather do than not having to work at all ever.

    I know, I’m rambling — I’m writing this on the boss’ dime and it’s time to go home (wouldn’t want to put in overtime). Have a good one!

  5. Peter {works with SharePoint}
    Posted February 23, 2009 at 2:30 PM | Permalink

    I didn’t carefully read Alex’s post, but what I took away from it is that if you’re trying to derive satisfaction from your business-oriented programming job by making your coding chores more aesthetically pleasing, then you’re shooting for the wrong goal. You should instead derive satisfaction for solving a real-world problem (as Alex says works for him.) That’s all I read into the article.

    Your response says that this is just one excuse among many, that he’s not reaching high enough, that if he learned some advanced techniques, he’d be able to turn the rote tasks into a more challenging, interesting problem to solve.

    Which is true, but if you’re developing on certain platforms (e.g. SharePoint), the heights are so lofty that maybe I should take Alex’s advice over yours…at least when working with SharePoint. I spent 30 minutes Friday reordering SharePoint’s User Profile fields via the web interface, each click moving one field one space up or down.

    I could have developed a solution to programmatically reorder the fields, but the truth is, the SharePoint User Profiles API is undocumented and I’d have to do a lot of extra work, all to save me the 30 minutes of grunt mouse clicks. And I’m probably never going to use the User Profiles API again, so learning this API isn’t as valuable as learning, say, how to do Regex. I could have made this dull problem interesting, but I didn’t.

    So in some contexts, Alex (and I) should look for a better way before giving up and doing the grunt work. And in other contexts, I should go with the grunt work, or better yet, probably find another job.

    Or maybe I’ve just listed an excuse for you to put on your list, something you’ve heard before but forgot to include when writing the post :)

  6. Posted February 23, 2009 at 4:57 PM | Permalink

    “It’s as if that starving child doesn’t want food, and would reject food if offered.”

    Actually, it’s even worse than that. The starving child is proud of starving, and looks down on you for eating. And, judging from the comments on the DailyWTF article, there are a lot of hungry kids! It’s gotten to the point where I can’t tell who’s serious and who’s trolling!

    I couldn’t agree with you more, especially since I was around for the arguments against Java.

    If something’s repetitive and boring, the computer should be doing it. Metaprogramming can even be done in SQL.

  7. Posted February 25, 2009 at 12:29 PM | Permalink

    It the propensity of programmers to utilize brute force to get the job done, that I find so interesting. Yes, if you cut-and-paste your way into a million-line programming hell, your job will suck. And it will suck badly, until you do something about it (clean it up, leave, get fired, etc.)

    Most horrible code is self-inflicted, yet most programmers don’t want that to be the case, so they choose to look elsewhere …

  8. Posted March 7, 2009 at 6:40 AM | Permalink

    A point well made. I could laugh at the list of “convincing” arguments because I’ve heard them all… still, it is important to remember this article when I’ll come across them next time. And there will be a next time. I can relate because I’ve always strived to make my live easier by code. I wrote code generating code in 1996 and started using Ruby to refactor my C++ code in 2006. An learning Ruby and Haskell really helped my C++ .. thinking out of the box can certainly be enforced. I’d recommend 3 years of Python or Ruby to every C# / Java / C++ programmer out there and vice versa. Once you’ve learned your language, take a trip to something else and look back critically on your way of doing things. You’ll certainly come up with some improvements. And, as Brian pointed out, stop to think about what you are doing. I’ve made it a point to mull a new project over by discussions, scribbling on paper and sleeping one night before I write the first actual line of code. I’ve never regretted that strategy.

    All the best and thanks for the post!

    Axel

  9. RaiulBaztepo
    Posted March 28, 2009 at 5:36 PM | Permalink

    Hello!
    Very Interesting post! Thank you for such interesting resource!
    PS: Sorry for my bad english, I’v just started to learn this language ;)
    See you!
    Your, Raiul Baztepo

  10. joshen
    Posted January 27, 2010 at 11:15 AM | Permalink

    I googled “programming sucks” just to see what others have to say cos my fellow students are all complaining about the monotony, and the frustration of getting involved with programming.. I have not touched a single programming tool even once and can barely understand jargon like C++, JAVA and etc… Dont even know what they do… but I’m interested to find out and as i heard them ramble, i was thinking to myself: How hard can it be?

    Your post makes me wonder even more.. =/

  11. Posted January 27, 2010 at 11:18 PM | Permalink

    Joshen: You’ll never regret taking a programing course. Having some knowledge of programming will help you almost no matter what you end up doing. The most powerful way you can interact with a computer is to program it- and most jobs these days involve interacting with computers in some form or another. Even if it’s just throwing spread sheets together or doing some simple visual basic macros.

    Back in the late 70′s or early 80′s, there was this one fad diet (I forget the name), where the idea is that you eat nothing but rice for two weeks straight. My mom commented, when she read about this diet, that at the end of the two weeks, you would either love rice, or hate rice, and there would be no doubt in your mind which it was, by the end of those two weeks. I always thing about that when someone asks me if programming is a good career or not. It really depends upon how much you love rice.

    Which is why I recommend taking the course in programming. This is sort of like trying the rice-only diet for just a couple of days. If you find yourself liking it, then maybe going whole hog (or at least going a lot farther) is in order. On the other hand, if you find yourself growing tired of it, you can quit (or at least choose a different career) before it destroys your will to live.

    On the up side, it pays well, they let you play with all sorts of cool toys and solve all sorts of interesting problems, and there is always something new to learn. And you do it sitting in a comfy chair in an air-conditioned office.

    On the downside, you have the fact that Office Space was a documentary. Or almost as bad, you’ll find yourself middle aged, out of a job, and unemployable because you only know technologies that are 15 year obsolete and that no one uses anymore. And even if you avoid those pitfalls, you will end up spending days if not weeks tracking down obscure bugs in programs that damned well should work, all the while your boss throwing fits about missed deadlines and blown schedules. Oh, and there’s always some new technology or fad rocking the boat, and that the way you’re used to doing things, that was perfectly acceptable a year or ten years ago, isn’t how we’re doing things now. And you’ll have to learn everything all over again. Whether you want to or not.

    If money is your object, and you don’t care if you hate your job and it’s destroying your soul, become an investment banker instead. They get paid lots more than programmers do.

    Programming can really, really suck. Or it can really, really rock. My suggestion: try it. If you like it, welcome to the club. If you don’t, you’ve still learned something valuable.

  12. Posted January 28, 2010 at 8:20 AM | Permalink

    @joshen

  13. Posted January 31, 2010 at 5:45 PM | Permalink

    Programming in Java and C/C++ feels like putting my balls in a vice, personally. No language is perfect (Mostly because languages tend to copy from C/C++ or Java (See: Go).), but damn do those two make it hard.

    post script: What the hell does your comment code have against names longer than 20 characters?

    Signed,
    Kurtis Rainbolt-Greene

3 Trackbacks

  1. [...] to be bored. Oh, and as always Brian and Robert over at Enfranchised Mind are always putting out good [...]

  2. [...] Programming Doesn’t Suck! Or At Least, It Shouldn’t [...]

  3. [...] to Google App Engine or getting Google Maps to display what you want. Brian’s right, and Programming Doesn’t Suck! Or At Least, It Shouldn’t: but a lot of what developers do these days barely constitutes programming. It’s just [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">