How to Misuse a Computer

pancy

Pan Chasinga

Posted on February 10, 2020

How to Misuse a Computer

In an ideal world where humans write code to grow intellectually, they will write in LISP.

LISP has jokingly been called “the most intelligent way to misuse a computer.” I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.

— Dijkstra (the smart Dutch guy with an algorithm named after himself)

Okay, maybe I’m getting ahead of myself here by writing about programming. But I promise this isn’t one of those geeky, techie posts.

In fact, I’d go so far to say that this isn’t a programming post in the sense that you’d have to follow, install something unsuccessfully, and then left hanging not knowing what to do next. This is something anyone could use as an ice breaker in a party at the bar. Well, maybe a party in Silicon Valley. But still.

What do you program for?

Ask yourself this question. Hard. Are you programming for career advancement and income increase? To meditate (I do)? Are you doing it to improve your understanding of the universe? Whatever your primary reasons are, there’s no judgment here.

But if most people could just program to learn and grow and does not have to think about their careers, I’d bet the top TIOBE index of most popular programming languages (IMO a pretty self-absorbed one) would have looked quite different than this:

tiobe index

Languages like Erlang, Elixir, Ocaml, Rust, and of course Clojure and LISP would probably have made it among the top alongside Python, Java, and JavaScript.
Programming Epiphany

Are you familiar with that dopamine kick we all get when checking our Instagram and seeing more likes? You get that too when writing code, but you get it only when you get your mind blown discovering something so awesome. That is what keeps you codin’ at night regardless of how malnourished you are. One way to get this kick is to always be shipping, and another is to learn a new language or tool that will bring you down a new adventurous path.

LISP is a language that can do that.

It was the world’s first elegant language (when you call Ruby elegant, that’s the definition). Very few languages can be said to be elegant. Elegant is when a martial art master scribbles calligraphy with a giant brush with such energy and liberation and it just comes out perfect.

a scene from Hero

Expression

;; LISP
(+ 1 2)        ;; boom! This is equal to 3
Enter fullscreen mode Exit fullscreen mode
// Js
1 + 2; 
Enter fullscreen mode Exit fullscreen mode

Since an expression often needs to be stored for later use, we could bind the result to a variable

;; LISP
(let ((sum (+ 1 2))) sum)
Enter fullscreen mode Exit fullscreen mode
// Js
let sum = 1 + 2;
return sum;
Enter fullscreen mode Exit fullscreen mode

Note that in the first LISP snippet, the let expression returns a value, while the JavaScript counterpart (the first line with let keyword) is a statement that assigns the value of the expression 1 + 2 to a namespace called sum. An equivalence in JavaScript would be

(() => { let sum = 1 + 2;  return sum; })()
Enter fullscreen mode Exit fullscreen mode

Not as elegant now. As my own personal rule, an elegant language should implicitly return the last expression.

The reason why these two let s are different is that LISP let acts like a function (or macro, but we won’t talk about that). When you close that let with a pair of parentheses, it’s become a “value bomb” ready to explode. let in JavaScript is a keyword that "says this variable won’t be available outside of this scope". It’s an improvement to its var counterpart to emulate the behavior of the let you find in LISP.

Oh shoot, what? I got carried away. This has turned into a programming blog post.

Originally posted on BETA School - unlearning schools and relearning life. Subscribe to my newsletter of you aren't following the norms.

💖 💪 🙅 🚩
pancy
Pan Chasinga

Posted on February 10, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

How to Misuse a Computer
lisp How to Misuse a Computer

February 10, 2020