Posts in the “programming” category

Data types show you understand the problem

I like the statement in this image because it says something I’ve always thought: Your design of the data types show that you understand the problem (or not). Every time I start writing code without understanding the problem, I waste a lot of time. (If you don’t understand the problem, exactly what code are you going to write?)

Learning FP: Experiences on the Elm language

This image is from a tutorial titled, Learning FP: Experiences on the Elm language.

I don’t know much about Elm yet, other than it’s an FP language for writing browser code, and it looks a lot like Haskell. As the tutorial author states, “Elm is a programming language that compiles to HTML5: HTML, CSS and JavaScript.” Another good quote is, “There are no worries about bugs due to weird mixed state as the state is always a direct result of input.”

The importance of flow to programming

Psychologists have identified a state of mind called flow in which we’re capable of incredible concentration and productivity.

The importance of flow to programming has been recognized for nearly two decades since it was discussed in the classic book about human factors in programming Peopleware: Productive Projects and Teams by Tom DeMarco and Timothy Lister (Dorset House, 1987). The two key facts about flow are that it takes around 15 minutes to get into a state of flow and that even brief interruptions can break you right out of it, requiring another 15-minute immersion to reenter.

DeMarco and Lister, like most subsequent authors, concerned themselves mostly with flow-destroying interruptions such as ringing telephones and inopportune visits from the boss.

Less frequently considered but probably just as important to programmers are the interruptions caused by our tools. Languages that require, for instance, a lengthy compilation before you can try your latest code can be just as inimical to flow as a noisy phone or a nosy boss. So, one way to look at Lisp is as a language designed to keep you in a state of flow.

Examples of the Miranda programming language

In the last few weeks I learned that Miranda is a lazy, functional programming language that preceded and greatly influenced Haskell. Here are some examples of the Miranda language.

The name of this language, along with the use of the name in the movie Serenity, got me wondering about its origin. BehindTheName.com states, “Derived from Latin mirandus meaning ‘admirable, wonderful.’ The name was created by Shakespeare for the heroine in his play ‘The Tempest’ (1611). It did not become a common English given name until the 20th century. This is also the name of one of the moons of Uranus.”

What do you enjoy about programming?

Seibel: What do you enjoy about programming?

Peyton Jones: For me, part of what makes programming fun is trying to write programs that have an intellectual integrity to them ... so I think a good attribute of a good programmer is they try to find a beautiful solution.

The Zen of Python

From the python.org website: “Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.”

Parinfer, a tool for Lisp editing

Parinfer is a tool that is currently in development, and it’s intended to help with the management of all those parentheses in languages like Lisp and Clojure. It looks like it is written in JavaScript, and intended to work with editors like Atom and Sublime Text.

Why we can easily distribute Erlang programs over multicores or networks

“In Erlang it’s OK to mutate state within an individual process but not for one process to tinker with the state of another process ... processes interact by one method, and one method only, by exchanging messages. Processes share no data with other processes. This is the reason why we can easily distribute Erlang programs over multicores or networks.”

Joe Armstrong, in the book Programming Erlang

Making art is like jumping from the edge of a cliff

This quote from Meredith Monk on LionsRoar.com reminds me of writing software and designing things:

“I’ve always thought that making art is like jumping from the edge of a cliff. At the beginning of every new work — and every day of work — is the unknown. Being an artist is being unsure, asking questions, stumbling around with only an inkling of what will manifest and tolerating the fear of hanging out in the unknown. When curiosity and interest become more present than discomfort, the mystery becomes enjoyable and its exploration vivid and vibrant.”

Three golden rules for giving code reviews

Three golden rules for giving code reviews, from this article on sofiacole.com: 1) Ask questions rather than give statements, 2) Limit personal preference, and 3) Check its purpose.

Regarding the second rule, I don’t know anything about it, as I’ve never been on a team that allowed “personal preference.” Each team (or company) agreed on coding standards, and used them.