5

Inspired by this question, I started wondering - is there or has there ever been such a thing as a "well designed application"? One where the architecture would be perfect and no refactoring would ever be needed; code would be easy to read and understand even for someone new to the project; changes could be done with a 100% certainty that they won't break anything; etc?

I must admit that whatever codebases I've worked with, they've all been more or less a mess. Even code that I start myself only stays organized at the start, and then slowly deteriorates as the time passes. I'm even starting to accept this as part of life and can't figure out whether I should be worried about that or not.

So... is there such a thing as a "well designed application"? Or is all our code so shitty that there isn't even a point in trying to make it better, because it will never be good anyway?

5 Answers 5

6

Always fix broken windows

That way your code will continuously improve and reach that nirvana we dream of.

It can be done - I have experienced it myself.

1
  • 1
    Or at least, get very close to the pearly gates.
    – Sergio
    Mar 3, 2011 at 16:07
5

I've never run into a perfectly designed application, but I have come across blocks of code that seem immaculately produced. Because most applications involve many developers and "perfect" is such a matter of opinion when it comes to code that it's impossible to build an application perfectly.

Although, I can't think of a single improvement that could be made to the "Hello World!" application. That one seems to meet all of its requirements perfectly.

3
  • 1
    Well, obviously trivial apps like "Hello World!" are outside of the scope of this question.
    – Vilx-
    Mar 3, 2011 at 12:11
  • @Vilx - Well, obviously it was a joke. Mar 3, 2011 at 12:18
  • Well, obviously, I fail @ recognizing a joke. :P
    – Vilx-
    Mar 3, 2011 at 12:55
1

There are some basic elements of good design, but many are subjective and relative to the current use of the application, the team that built it, those who have to maintain it, and the future implementation (Good luck knowing that.).

Polymorphism is great until it becomes too complicated. Your 45 character function is clear, but it's a pain to type.

I saw an app written in Basic for MSDOS. Elegant code for it's time. Sold it to hundreds of customers and in 8 years never changed the main data structures. Someone decided it needed a GUI and completely rewrote it in VB. This steaming pile of mess took almost a year just to get the major bugs worked out.

Just think, no matter how good your code is, it will eventually get thrown away. 99% of all iPhones will end up in a landfill.

1
  • And on the other hand - I'm currently working on a 15 years old app that has survived several platform upgrades (currently stuck on Delphi 5, but trying to migrate to Delphi 2010), and is selling strong. Ehh... sometimes world sucks. :P
    – Vilx-
    Mar 3, 2011 at 14:18
0

I have a couple of times. In fact, in my current project we just had to change the way we connect to the database, and I was able to make the (fairly significant) change in only a couple of days. The database code was modular, well-factored (we used the Strategy pattern to isolate DB-specific sections) and we were careful to always call it through interfaces. Abstraction and design patterns FTW!

0

Well, I've ceirtanly never seen anything like this:

One where the architecture would be perfect and no refactoring would ever be needed; code would be easy to read and understand even for someone new to the project; changes could be done with a 100% certainty that they won't break anything; etc?

Having said that, I did work on a couple of very well designed projects. Both were very modular and imposed the principle of a single responsibility. The one I liked better was somewhat simpler - no home-built component system, less implementation inheritance, more compile-time checks.

But yeah, other than these two projects, everything else I have ever seen is a mess.

Not the answer you're looking for? Browse other questions tagged or ask your own question.