Skip to content

Instantly share code, notes, and snippets.

View jsturg's full-sized avatar

Josh Sturgeon jsturg

View GitHub Profile
@jsturg
jsturg / pure-impure.md
Last active January 18, 2017 21:53 — forked from tomekowal/pure-impure.md
Pure vs impure

Pure vs impure and why should I care?

Some of the most important advancements in programming came from adding restrictions to the way we program. Famous article by Edsger Dijkstra Go To Statement Considered Harmful shows how introducing one statement into programming language breaks many key properties of that language. Using goto gives us freedom and solves a couple of simple problems like breaking from nested loops easily, but it can make programs very hard to understand.

This happens, because we cannot look at two pieces of code in separation. The execution can jump to some other place in code or even worse: it can jump from another piece of code to here and we need to keep that in mind.