DRYing the world
Ingmar Dasseville - VIGOR day 2015
on't
epeat
ourself
GoUp(1)
Rotate(120)
GoUp(1)
Rotate(120)
GoUp(1)
Rotate(120)
GoUp(1)
Rotate(90)
GoUp(1)
Rotate(90)
GoUp(1)
Rotate(90)
GoUp(1)
Rotate(90)
We Enjoy Typing
WET code
polygon(n) {
for (int i = 0 ; i < n ; i++) {
GoUp(1)
Rotate(360/n)
}
}
DRYing
with loops
polygon(n) = replicateM n (do
GoUp(1)
Rotate(360/n)
)
DRYing with higher order functions
?
As long as you're not reading the fine print, it is.
{
∀ x y: Reachable(x,y) ↤ Edge(x,y).
∀ x y: Reachable(x,y) ↤ ∃ z: Reachable(x,z)
& Reachable(z,y).
}
in 80%* of the theories
*non-scientific number
C-style macros
When creating a language, enable the programmer to program DRY!
My question for you:
≟