KludgeCode

is Ben Rudgers

Remarks: Epigram 1

This is the first writing exercise around Alan Perlis‘s Epigrams in Programming.

Originally written in Journal 3, [bracketed] remarks are extensions of the manuscript.

1. One Man’s Constant is Another Man’s Variable

1. We write programs for a purpose – what we need is what we need and there are are no universals which solve every problem – To be a universal implies that something is both in the problem and its solution, and thus it would cancel out of the solution [There’s nothing like a Spinozan scholasticism to get the brain started]

2. Even a mathematical term like π may be a variable – first it is a symbol then a value then a reference then as a value with different precision. What I am getting at is that there is no single true way to represent π within a program, and our program may choose to treat it several ways [or ignore it completely, in which case what does this say about it being a constant in the formal sort of way of computer languages?]

3. Take a web application which selects tires for cars. makeOfCar is a variable…right up until I select “Dodge.” Then it is passed to an algorithm/program/closure which for all intents and purposes expects it to be a constant. In other words, makeOfCar does not change to “Ford” while I am paging through the list of tires matching my query. [To go Hickian, “The programmer’s variable is the User’s constant – I just watched Simple Made Easy.]

4. What is the meaning of a constant within a closure? It’s just a variable with lexical scope [then again every constant is limited to the lexical scope of the program that uses it].

5. What’s really going on in a Lispy sense is that we are lumping together vaules and the pointers which referense them. 3.14 is persistant. I can point to it any damn way I want. Is the assembly language x00f80044 a constant (assuming that is where 3.14 is stored)?

6. Aha!

7. “Variable” and “Constant” are syntactic sugar. They are useful in so far as they make writing a program which does what we want done, easier to write and no further. [Or is it simpler? No. Hickey doesn’t like variables because they complex value and time]. “Variable” and “Constant” are valuable because they give us a clue about expected behavior not because of some essence. [Alas, now they are leading the way into <Type> safety].

8. Modern transaction friendly languages have better terminology. Things are either mutable or immutable. “Variable,” “Mutable,” etc. all can give us clues as to the programmer’s intent. However, in the typical case, the primary primary insight is to the language designer’s intent [Thus references to Hickey].

9. A language with immutable values referred to by variables [sic, Symobls?] indicates the language designer’s intent to foster a functional programming style and support concurrancy. [Or perhaps correlates is a better description].

Whether or not, the choice of a language having those features tells us something about the programmer is less clear cut. We cannot ignore the possibility of FORTRAN in another language.

10. If Perlis were alive, <Type> safety would have several epigrams of its own.

11. <Type> safety matters to the extent it makes writing a particular program easier [Warning! Warning! Will Robinson] and no further. [Does <Type> safety make our programs simpler?] It is not something worth debating. The best option seems to be a language where <Type> safety may be turned on when required at the discretion of the programer [e.g. to keep pesticide out of my soup bowl].

12. Perhaps π is one of a small group of universal constants – something all programs can agree on? 

13. Nah. My program may want π = c/2r or some definition from integrals or trig functions.

14. Here I want a π symbol. There I want a π value. And in the other place I want a different π value stored on the plist of π-the-symbol. Later, I might just want π printed.

15. Even 3.14 may be a floating point or a fixed point or a string which I can convert to a number. But I might want to convert it to “π” or “pi”. [How do these uses hold together with the idea of π as a constant? Pragmaticism says the thing is it’s effects].

16. Is there something cultural about Alan Perlis’s association with Yale and Algol?

The format follows the journal entry. Obviously, this was not written as an essay