Ugly Code, Debating It, and Successful Products

I’ve read numerous debates and discussions about code quality, architecture, different coding styles, and all sorts of things like this in programming and software engineering circles. While these are definitely important, from the discussions I’m often around you’d think these things were the most important thing. After years of mulling this over I’ve come to the realization that this is just not the case and I can show it off by example.

What is the most important thing?

To dig into this we need to first ask this question. This will be different for different people. In the discussions I’m around the list usually looks like:

  • Build a product that sells and people like.
  • Solve a technical problem that’s useful.
  • Build an easy to update website for a client.
  • Make enough money to pay the bills.

Now, your important things list may be somewhat different than this list. For example, you may want a “clean” architecture for what ever definition of “clean” you have. But, is that more important than building a product that sells, solving a technical problem, or making enough money to pay the bills?

I’m not saying you can’t have a good architecture. There are lots of products that do and it’s fantastic. But, when we look at what’s important for the people I encounter I see this as a lesser goal that all too often dominates the conversation over what is considered more important.

By Example: Wordpress

Wordpress has always fascinated me. It is currently powering 17% of the websites on the Internet. Have you looked at the code? I couldn’t bring myself to link to the code because every time I read it I shed a tear for code quality. Yet, with its poor code quality Wordpress is a dominant product that many content authors love. The end product has not been matched by anything else in the blogging and simple content management space which is what most people need.

This goes well beyond Wordpress. I’ve had the opportunity to see a lot of ugly successful code. Some in embedded devices, some in web services, and some in a CMS I’ve worked on. Some of the best ideas I’ve seen were written by people who were more interested in their idea than in clean architecture and code. Being focused on this is what made it successful.

A Different Set of Debates

Maybe we focus too much on clean code and architecture when we don’t have something else to focus on. Maybe we are jumping into debates and discussions established by others and are just following along. What ever the case, it might be a good idea to break the cycle.

Taking that important things list above and flipping it around I end up with questions like:

  • How do I make the product I’m working on something it’s users and target audience will like and find useful?
  • What technical problem am I trying to solve? How can I do that well?
  • What will my client find easy to use? What will be intuitive for them?

When I start to think about these questions the focus on architecture goes away because other things are in the forefront. Building the answer to these questions could be done well. But, that’s just an implementation detail. Not the thing to obsess about.