I often find myself writing (by which I mean generating) functions to convert enums to strings. A naïve implementation of such a function might look like: