To learn new things about software design, I often analyze .NET framework source codes.
During my study today the Microsoft.AspNetCore.Http.StatusCodes
class drew my attention when I saw it is not implemented as an enum, but rather as a static class with public const int
fields (not even properties).
Why would you not use an enum
for this purpose when it seems like a perfect solution? What might be the thought process behind this design decision?
I think I might be missing something here and I would be more than happy to learn something from this experience.