Posts in the “programming” category

A nice story about Lisp

twobithistory.org has a nice story about Lisp titled, How Lisp became God’s own programming language. That page links to Paul Graham’s old Beating the averages post where he shares this Eric Raymond quote: “Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.”

An honest reviewer of apps

A friend of mine is an honest reviewer of apps. When I asked her to use the AAA iOS app while we were driving back from Florida, she said, “OMG, please don’t make me use that piece of crap again.”

The lack of type safety was difficult to scale ...

From this AirBnB article about using React Native: “JavaScript is an untyped language. The lack of type safety was both difficult to scale and became a point of contention for mobile engineers used to typed languages who may have otherwise been interested in learning React Native ... A side-effect of JavaScript being untyped is that refactoring was extremely difficult and error-prone.”

Kent Beck’s Four Rules of Software Design (also known as “Simple Design”)

For the first time in many years I just came across Kent Beck’s Four Rules of Software Design:

  1. Passes the tests
  2. Reveals intention (should be easy to understand)
  3. No duplication (DRY)
  4. Fewest elements (remove anything that doesn’t serve the three previous rules)

There are wording variations on those rules, but I got those specific words from this Martin Fowler post. As he notes, “The rules are in priority order, so ‘passes the tests’ takes priority over ‘reveals intention.’”

For more information on Kent Beck’s Four Rules of Software Design, see that link, or this link to the original rules on c2.com.

What is the value of learning lambda calculus?

When asked, “What is the value of learning lambda calculus,” Gary Bernhardt replied, “My favorite reason to learn a bit about the lambda calculus: it shows us 1) how simple computation is (at first it seems too simple to compute anything ‘real’); and 2) all of our programming complexity is invented by us (for reasons both good and bad).”

Understanding how the Y-Combinator works

I haven’t watched this video from Ruby Conf 2012 by Jim Weirich yet, but if you’re interested in learning about functional programming only for the sake of learning, here’s the description: “One of the deepest mysteries in the functional programming world is the Y-Combinator. Many have heard of it, but few have mastered its mysteries. Although fairly useless in real world software, understanding how the Y-Combinator works and why it is important gives the student an important insight into the nature of functional programming.”

Making wrong code look wrong (Joel on Software)

A long time ago — 2005, to be exact — I read this article named Making wrong code look wrong, and it was a big influence on me. These days I don’t know how many people use variable naming conventions, but when working on web applications I still like the “us” (unsafe) and “s” (safe) convention for handling user input. As Joel Spolsky discusses in that article, that convention has a good way of making wrong software code look wrong.

A definition of DRY in programming

Last night I was reading the classic old book, The Pragmatic Programmer, and came across this definition of DRY, an acronym that stands for Don’t Repeat Yourself:

“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”

That’s well stated, especially after a recent experience in which I found some code where I created an “Add Widget” dialog in a different way than I created its related “Edit Widget” dialog. I created the main pane of the dialog the same way, but I managed the details of the two dialogs that contained that pane differently, and I realized what I had done when I decided to make the dialog resizable. When I discovered what I had done, I refactored the code so both the Add and Edit dialogs were created by a single method.

The old -0 error

Whenever I see a programming error, I try to imagine the circumstances behind it.

AlphaZero generalized to learn more games by itself

From this Cornell University page, Google’s AlphaZero algorithm has been generalized to learn new games given only the game rules: “In this paper, we generalise this approach into a single AlphaZero algorithm that can achieve, tabula rasa, superhuman performance in many challenging domains. Starting from random play, and given no domain knowledge except the game rules, AlphaZero achieved within 24 hours a superhuman level of play in the games of chess and shogi (Japanese chess) as well as Go, and convincingly defeated a world-champion program in each case.”