Search This Blog

Loading...

Wednesday, December 19, 2007

Nobody cares about what your code looks like? Really?

Jeff Atwood wrote about why maybe beautiful code is not very important after all. What is more important, is to do what the user wants, not write well-polished or nice code that is easier for programmers to read.

Sure, we programmers are paid to care what the code looks like. We worry about the guts of our applications. It's our job. We want to write code in friendly, modern languages that make our work easier and less error-prone. We'd love any opportunity to geek out and rewrite everything in the newest, sexiest possible language. It's all perfectly natural.

The next time you're knee deep in arcane language geekery, remember this: nobody cares what your code looks like. Except for us programmers. Yes, well-factored code written in a modern language is a laudable goal. But perhaps we should also focus a bit more on things the customer will see and care about, and less on the things they never will.


Jeff Atwood's post is always entertaining, and very informative as well. Apparently, he is dead right on this one: beautiful code is not necessarily more useful to the users, and useful code may be very ugly.

What is omitted from his post is, easy-to-read code is much more easier to change, and can respond quickly to new requirements, whereas ugly code is very hard to maintain. Customers do care a lot about what they see and what they get, and it's true that they don't care much about how the code looks like. But they will not forgive you if you can't upgrade your apps according to their expectation within a reasonable time frame. And if so, they will forget what they previously saw and got. Pang, you are doomed. You don't just lose the sales, you lose the good will as well.

The best defense against this crisis, is to write good code so that one can easily find and fix bugs, expand on top it to create new sets of features and is beautiful.

That's why you need all the design patterns, software development methodologies and tools. They all help you to create better code, easy to read and understand code so that the customers will not have to wait forever for a fix.

Programmers may not care about how the code is like initially, but they will care if they need to do maintenance job (Is this the reason why programmers generally abhor maintaining code in favor of writing new ones?). Customers may not bother about how you construct your code, but they are the first to complain if they don't receive bug fixes and new features. In this sense, beautiful code does not only have aesthetic appeal, it is also vital for a company's survival.

For those who can produce popular software despite writing ugly code, Congratulation! But I bet most of us can't. Writing maintainable code is the only sensible path for us to take.

5 comments:

RobM said...

What you might be missing is that the users don't care about your problems with poorly organised code. They're called *your problems* for a reason.

There are obvious benefits to well maintained code that is easy to debug and to maintain, but to the majority of end users these things are the part of the iceberg that they never see.

Soon Hui said...

Robm, you are absolutely right in your comments. Your points actually reinforce mine and make them clearer:

Customers may not bother about how you construct your code, but they are the first to complain if they don't receive bug fixes and new features. In this sense, beautiful code does not only have aesthetic appeal, it is also vital for a company's survival.

ddoctor said...

Poorly written code isn't just more difficult to maintain, its more likely to have bugs in the first place. Shoddy code that still manages to work well from the user's perspective, is like a polished turd.

We, as programmers, need to apply a strong degree of craftsmanship and professionalism to our work.

Producing nothing but pristine code should be a BARE MINIMUM requirement of all coders. It's not hard. Its called being professional.

Honestly, too many programmers get away with too much crap. With some of the poor quality code I've seen... i keep thinking: if this was the work of a doctor, someone would have died as a result.

Michael B said...

"Poorly written code isn't just more difficult to maintain, its more likely to have bugs in the first place."

irrelevant, to the extend that what kills you is that with ugly code and fixing bugs; regression is more likely to show up.

this is because the code is such a mess, ppl are more dependant upon the documentation. Causing much more 'guessing' causing other code to start depending on bugs.

willCode4Beer said...

I think he does mention it. For example, when he talks about how hard it is to maintain and add new features to BugZilla.

The effect is indirect. Ok, the code works. But, as time goes by and the product is left behind because maintenance is so difficult, the quality of the code *does* show.