BYTE.com
RSS feed

Newsletter
Free E-mail Newsletter from BYTE.com
Email Address
First Name
Last Name




 
    
             
BYTE.com > Features > 2003

Elegance in Computer Programming

By Will Warner

July 21, 2003

(Elegance in Computer Programming :  Page 1 of 1 )



Describing the Standard Model of elementary particle physics, theoretical physicist Steven Wienberg wrote, "we still have too many arbitrary features" in the model. It has 18 numerical quantities, the values of which are known from experiment, but "we don't know why nature chooses those values. Any theory with 18 free parameters is too arbitrary to be satisfactory." If this is how aesthetics enters into particle physics, that discipline has something in common with computer programming.

Even though most of my work answers real needs in the real world (I write embedded code for medical devices and scientific instruments), computer programming has enduring interest for me only as an art form. Because it is art, coding does for me what giving milk does for a cow, to paraphrase H.L. Mecken.

There are always many ways to structure and code a program that will achieve the goals set for it. Some ways are brutal and some elegant. What constitutes beauty in a computer program? I can only tell you what my eye beholds.

To make things concrete, let's assume a simple program that runs on a PC. Its purpose is to measure and display voltage and current using an external meter. The program has the graphical user interface (GUI) depicted in Figure 1. It communicates with the external meter through one of the PC's COM ports. To complete the scenario, assume that the program must activate a start relay in order to initiate a measurement.
graph of system
Figure 1: Depiction of a system to measure and display voltage and current using an external meter. A program running in a PC has the graphical user interface (GUI). The program communicates with the external meter through one of the PC's COM ports. The program must activate a start relay in order to initiate a measurement.

Spinal, Not Cerebral

Most importantly, a program should be spinal, not cerebral.

 Page 1 of 1 


BYTE.com > Features > 2003
Dr. Dobb's Media Center

Extending Enterprise Value with Web 2.0
In this webcast we will talk about how to simply build and quickly remix Web 2.0 applications and the role of the IT department and how they support mashups. We will discuss how IBM can help IT teams adapt existing enterprise systems as well as develop unique ones that can support end user driven mashups in a reliable, scalable and secure way. We will highlight a simple scenario adapting an enterprise information source for mashups and how to test it. We will also cover how IBM can help you build agile, fast and simple web applications based on dynamic scripting languages that dramatically reduces development time. Wednesday, September 24, 2008 - 12pm PT / 3pm ET

2008 International Mathematica Conference
Dr. Dobb's interviews Wolfram Research's Theo Gray, co-founder and Director of User Interfaces, and Roger Germundsson, Director of Research and Development, about the upcoming 2008 International Mathematica Conference.

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE: Volume 2 - Heuristic Algorithms
The Best of BYTE: Volume 2 - Heuristic Algorithms
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.

© 2008 Think Services, Privacy Policy, Terms of Service, United Business Media Limited
Site comments: webmaster@byte.com
Web Sites: BYTE.com, dotnetjunkies.com, Dr. Dobb's Journal, SD Expo, Sys Admin, sqljunkies.com, Unixreview



MarketPlace
simple helix is the most trusted name in the hosting industry! Join us and host with the experts!
Fast online exception analysis. Capture customer crash data online.
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.
and develop 10 times faster ! ALM, IDE, .Net, PDF, 5GL, Database, 64-bit, etc. Free Express version
Certificates & Degrees in IT from Accredited Online Colleges! Request Free Information!
Wanna see your ad here?
 

web2