It takes a list of classrooms, each containing a letter and a list of kids, and returns a subset of them, using rules from separate list of classrooms and parameters for transforming the data. It's a bit of a complicated operation by nature, but it could have been broken down or broken out into sub-steps. Writing one massive convoluted fold is not the way to go.
This technically works, but I'm seriously glad I never had to make any sort of change to it, and I can only tell you what it does now because I remember the problem, not because looking at this code means anything to me.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think this snippet of ReasonML is pretty horrible, from my very first larger functional programming project:
It takes a list of classrooms, each containing a letter and a list of kids, and returns a subset of them, using rules from separate list of classrooms and parameters for transforming the data. It's a bit of a complicated operation by nature, but it could have been broken down or broken out into sub-steps. Writing one massive convoluted
foldis not the way to go.This technically works, but I'm seriously glad I never had to make any sort of change to it, and I can only tell you what it does now because I remember the problem, not because looking at this code means anything to me.