# «Recursion is hard!» Does a hi-school student studying math find the law of indices: x<sup>n+1</sup> = xx<sup>n</sup> hard? **Do they even notice** that this is a recursive definition/specification? Translate this to haskell. Along with x⁰ = 1 and you get x `power` 0 = 1 x `power` n = x * x `power` (n-1) (You can interchange between infix x ‛power‛ n and prefix ‛power x n‛ to your taste) A running program! Recursion in its infinite forms is one of the core-**est** subjects in CS. See [partial list](http://blog.languager.org/2012/05/recursion-pervasive-in-cs.html) # A Warning And so... "recursion is hard" is a warning sign - you're using the wrong language - you're a terrible teacher - your student is really dumb - (other possibilities) - recursion is really *really* hard Most people order this list starting backwards!! Just to be clear: If the problem goes away on correcting the first point, why go on? This question is not rhetorical : the language choice may be easier or harder to negotiate. # It's worth checking out Seriously!! «Recursion is hard» is the canary in the mine calling out it's warning call The real killer methane-in-the-mine is assignment/mutation Excise these from your usage (or better language) and see things fall into place! # PS Those who think "functional programmers like recursion" may find [Evolution of a haskell programmer](https://willamette.edu/~fruehr/haskell/evolution.html) both entertaining and useful. No I don't (need to) understand all the intermediate arcane versions. You can just jump to the last : "Tenured Professor" 😇