Just Testing RSS

Random ramblings by me.

Archive

May
24th
Thu
permalink
I just realised why functional programming is simpler for novice programmers, and especially first-year computer science students. You can get working code while considering fewer levels of abstraction than in an imperative language, especially C. I just got back from a lecture where I tried to explain how to implement depth-first graph search in C using an explicit stack (instead of recursion) and an adjacency-matrix graph representation. The code is short and I thought quite easy to understand, but the students had a hard time “seeing” the recursive function on the graph that all the pointer and stack manipulation really represented. That’s an extreme example, but it shows the general trend.