Beauty Is in Simplicity

From WikiContent

(Difference between revisions)
Jump to: navigation, search
Current revision (13:21, 16 August 2009) (edit) (undo)
 
(3 intermediate revisions not shown.)
Line 1: Line 1:
-
I love quotes. There is one quote that I particularly think is good for all software developers to know and keep close to their heart:
+
There is one quote that I think is particularly good for all software developers to know and keep close to their hearts:
-
''Beauty of style and harmony and grace and good rhythm depends on simplicity'' — Plato
+
 
-
In one sentence I think this sums up the values that we as software developers should live by.
+
:''Beauty of style and harmony and grace and good rhythm depends on simplicity'' — Plato
 +
 
 +
In one sentence I think this sums up the values that we as software developers should aspire to.
There are a number of things we strive for in our code:
There are a number of things we strive for in our code:
-
* readability
+
* Readability
-
* maintainability
+
* Maintainability
-
* speed of development
+
* Speed of development
-
* and the elusive quality of beauty
+
* The elusive quality of beauty
Plato is telling us that the enabling factor for all of these qualities is simplicity.
Plato is telling us that the enabling factor for all of these qualities is simplicity.
-
What is beautiful code? This is a very subjective question, and peoples perception of beauty depend on their background (just like all our perceptions depend on our background). People educated in the arts have a different perception or at least approach to beauty than people educated in the sciences. Arts majors tend to approach beaty in software by comparing software to works of art (duh), while science majors tend to talk about symetry and the golden factor, and try to reduce things to formulas. In fact, in my experience, simplicity is the foundation of most of these arguments.
+
What is beautiful code? This is potentially a very subjective question. Perception of beauty depends heavily on individual background, just as much of our perception depends on our background. People educated in the arts have a different perception of (or at least approach to) beauty than people educated in the sciences. Arts majors tend to approach beauty in software by comparing software to works of art, while science majors tend to talk about symmetry and the golden ratio, trying to reduce things to formulae. In my experience, simplicity is the foundation of most of the arguments from both sides.
 +
 
 +
Think about source code that you have studied. If you haven't spent time studying other people's code, stop reading this right now and find some open source code to study. Seriously! I mean it! Go Google for some code in your language of choice, written by some well-known, acknowledged expert.
 +
 
 +
You're back? Good. Where were we? Ah yes... I have found that code that resonates with me and that I find beautiful has a number of properties in common, chief among which is simplicity. I find that no matter how complex the total application or system is, the individual parts have to be kept simple. Simple objects with a single responsibility containing simple focused methods with descriptive names. Some people think the idea of having short methods of 5 to 10 lines of code is extreme, and some languages make it very hard to do this, but I think that this should none the less be the goal.
 +
 
 +
The bottom line is that beautiful code is simple code. Each individual part is kept simple with simple responsibilities and simple relationships with the other parts of the system. This is the way we can keep our systems maintainable over time, with clean, simple, testable code, keeping the speed of development high throughout the lifetime of the system.
 +
 
 +
Beauty is in simplicity.
 +
 
 +
By [[Jørn Ølmheim]]
 +
 
 +
This work is licensed under a [http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3]
 +
 
-
Think about source code that you have studied. Seriously, if you haven't studied other people's code, stop reading this right now and find some open source code to study. Really! I mean it! Go Google for some code in your language of choice, written by some well known, acknowledged expert.
 
-
You're back? Good. I have found that code that resonates with me and that I find beautiful, have some common properties, chief among which is simplicity. I find that no matter how complex the total application or system is, the individual parts has to be kept simple. Simple objects with a single responsibility containing simple focused methods with descriptive names. Some people think the idea of having short methods of 5 to 10 lines of code is extrem, and some languages make it very hard to do this, but I think that this should none the less be the goal.
+
Back to [[97 Things Every Programmer Should Know]] home page

Current revision

There is one quote that I think is particularly good for all software developers to know and keep close to their hearts:

Beauty of style and harmony and grace and good rhythm depends on simplicity — Plato

In one sentence I think this sums up the values that we as software developers should aspire to.

There are a number of things we strive for in our code:

  • Readability
  • Maintainability
  • Speed of development
  • The elusive quality of beauty

Plato is telling us that the enabling factor for all of these qualities is simplicity.

What is beautiful code? This is potentially a very subjective question. Perception of beauty depends heavily on individual background, just as much of our perception depends on our background. People educated in the arts have a different perception of (or at least approach to) beauty than people educated in the sciences. Arts majors tend to approach beauty in software by comparing software to works of art, while science majors tend to talk about symmetry and the golden ratio, trying to reduce things to formulae. In my experience, simplicity is the foundation of most of the arguments from both sides.

Think about source code that you have studied. If you haven't spent time studying other people's code, stop reading this right now and find some open source code to study. Seriously! I mean it! Go Google for some code in your language of choice, written by some well-known, acknowledged expert.

You're back? Good. Where were we? Ah yes... I have found that code that resonates with me and that I find beautiful has a number of properties in common, chief among which is simplicity. I find that no matter how complex the total application or system is, the individual parts have to be kept simple. Simple objects with a single responsibility containing simple focused methods with descriptive names. Some people think the idea of having short methods of 5 to 10 lines of code is extreme, and some languages make it very hard to do this, but I think that this should none the less be the goal.

The bottom line is that beautiful code is simple code. Each individual part is kept simple with simple responsibilities and simple relationships with the other parts of the system. This is the way we can keep our systems maintainable over time, with clean, simple, testable code, keeping the speed of development high throughout the lifetime of the system.

Beauty is in simplicity.

By Jørn Ølmheim

This work is licensed under a Creative Commons Attribution 3


Back to 97 Things Every Programmer Should Know home page

Personal tools