By the time I started poking round in LISP, sometime in the mid 1980s, I had bee...

@AmenZwa@mathstodon.xyz

By the time I started poking round in LISP, sometime in the mid 1980s, I had been programming in assembly, FORTRAN, and C for a few years—the weapons of all EE undergrads, in those days. I was #imperative, to the core. Yet, I took to LISP. But I hit the FP wall, when I met ML a bit later.

ML was then far simpler than modern FP languages. Despite being comfortable with LISPy FP, I struggled with the purer MLish FP. With effort, it all clicked. Later in CS grad school, I met early, small Haskell, which was not a big gap for me to cross.

As a grad student, I taught FP, in ML, to upper-level undergrads. Many of them came to the course armed with C or C++, so they faced the same hurdles I did. My personal experience helped me guide them. To my surprise, a few students who took ML as their very first programming language suffered far less. They were lower-level students who lacked programming experience but had already acquired theoretical proficiency. Because they came to ML without imperative prejudices, but armed with theoretical concepts, they got FP immediately.

The #declarative paradigm is indeed a tall step to climb for the imperative #programmers. I would have cracked, had I transitioned from C and Smalltalk directly to Haskell, without the aid from LISP and ML.

Every freshman today enters the CS programme with at least a few years of C++ or Python, usually taught by high school teachers without CS background. And most FP courses now use large, complex, industrial-strength languages like OCaml or Haskell.

In my view, introducing FP using older, smaller, simpler, stabler languages, like R⁴RS Scheme and Standard ML '97, would be far less off-putting to the imperative-minded novices.