>>19
Holy shit, I clicked the link a second time and somehow it was worse than the first.
Ok, let me try this again... I have an array of pairs of strings. Say they represent (first_name, last_name). I want to be able to sort the list by either first_name or last_name. In C, I'd probably use a simple data structure that's an array of
structs, where each
struct contains two
char * pointers. To sort them, I walk through the array in whatever fashion my particular sort algorithm requires and I swap
structs here and there until my algorithm says that they're all sorted.
In doing this, I've definitely changed a lot of "state" because I've moved those
structs around and overwritten memory contents. What's so bad about that, and how does functional programming do better?