Last night I had a rather confused and confusing conversation with Bayard (http://blog.generationjava.com/roller/page/bayard/) regarding Code being Data and vice versa. We came to a general conclusion that it was best discussed over a beer. Still, since I opened the discussion I thought I should blog on it.
Code being Data is clear - have a look at your source files. They're structured and have meaning to the programmer.
The converse is slightly more tricky. Data (as input) is invariably interpreted by some computer process. It is a set of instructions to some process about how to proceed. Let's say we have a relational DB table called house. A house might have a number of bedrooms. The program which displays this data will make some decisions on the basis of number of bedrooms, e.g. instead of displaying "bedrooms: 0" it might say "No Bedrooms". Another clear(ish) example is in system parameters - often held in a data structure (DB table again, XML file, CSV, etc) but these clearly influence the operation of the 'interpreter' or the code.
Calling this distinction between code and data can be useful, but I believe it's an artificial boundary that can cause confusion. Where does business knowledge end and coding start?
Saturday, April 22, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment