TITLE: Good Sentences, Programming State Edition AUTHOR: Eugene Wallingford DATE: April 01, 2013 3:16 PM DESC: ----- BODY: I've read a couple of interesting papers recently that included memorable sentences related to program state. First, Stuart Sierra in On the Perils of Dynamic Scope:
Global state is the zombie in the closet of every Clojure program.
This essay explains the difference between scope and extent, a distinction that affects how easy it is to some of what happens in a program with closures and first-order functions with free variables. Sierra also shows the tension between variables of different kinds, using examples from Clojure. An informative read. Next, Rob Pike in Go at Google: Language Design in the Service of Software Engineering, a write-up of his SPLASH 2012 keynote address:
The motto [of the Go language] is, "Don't communicate by sharing memory, share memory by communicating."
Imperative programmers who internalize this simple idea are on their way to understanding and using functional programming style effectively. The inversion of sharing and communication turns a lot of design and programming patterns inside out. Pike's notes provide a comprehensive example of how a new language can grow out of the needs of a particular set of applications, rather than out of programming language theory. The result can look a little hodgepodge, but using such a language often feels just fine. (This reminds me of a different classification of languages with similar practical implications.) ~~~~ (These papers weren't published April Fool's Day, so I don't think I've been punked.) -----