Friday, September 3, 2010

Elegance in Coding

To start this blog, I thought I'd quote the first paragraph from my statement of purpose, which I wrote as part of applying for grad school.

Elegance is when an object achieves its telos, designed end, well and simply. For software to achieve elegance, it must be performant as well as satisfying other fundamental requirements like security and reliability. This refined software does not waste its resources: CPU cycles, memory, and device accesses. Instead it makes efficient use of what it requires. Reaching software elegance is often limited by the experiences of developers; important developments require looking beyond the standard realms for which applications are designed, whether the realms consist of workloads or hardware configurations or even the problems being solved.  Academic research provides one setting for the long term investigations required for exploring potential solutions of the next realms of software.

Writing software is not just a logical act of solving a given problem.  Often though it is viewed this way, even by me.  Yet there are days when I see my code as a creative art.  One that isn't about solving the problem, but rather doing so well.  Because in being written well, the source code can be called beautiful.  You may wish to share the code with others, to take it before the class, before the team and let us all admire the work.  Admire its elegance and simplicity.

Yet this art of computer science is not a matter of font selection, or pleasing quantities of white space.  Rather, we see that the problem is solved with efficiency at run time and without defect.  Still, this code has style too.  That it is consistent in using spacing.  The variables are named meaningfully.  Comments are useful.

So I'll be writing sometimes about elegance in programming, more commonly from the negative direction.  But most posts will be about ordinary problems in writing software or brainstorming designs or so many of the other tasks that a computer scientist faces.

No comments: