---
title: "Programming Wisdom"
description: " [The] length of a variable name should be proportional to its scope.\nI come across this from time to time. This quote is by stirner in this HackerNews thread.\nMake illegal states unrepresentable\nThis …"
image: https://deterministic.space/programming-wisdom-og.png
url: https://deterministic.space/programming-wisdom.html
author: "Pascal Hertleif"
date: 2017-01-20
categories: ["tech","incomplete"]
---

# Programming Wisdom

> [The] length of a variable name should be proportional to its scope.

I come across this from time to time. This quote is by stirner in [this HackerNews thread](https://news.ycombinator.com/item?id=13443686).

> Make illegal states unrepresentable

This is what type systems are for: Statically preventing things from being wrong. I first saw this in [this "F# for fun and profit"](http://fsharpforfunandprofit.com/posts/designing-with-types-making-illegal-states-unrepresentable/) post of the same title. You should read it if you haven't yet. It's definitely an easier read than the Wikipedia article on the Curry–Howard correspondence.

> There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.

Quote from Jeff Atwood's [tweet](https://twitter.com/codinghorror/status/506010907021828096), which credits the original quote (without the "off-by-one") to Phil Karlton.

> Replaced "clean code" with "predictable code" because 'clean' is subjective and a platitude.

André Staltz [on Twitter](https://twitter.com/andrestaltz/status/826438154232201216).

