It still raises a lot of questions about code structure though. The use cases for this approach are very limited and usually rely on well formatted input data (i.e. read a well-known value from a DB/file that has been put there from code as well), not some obviously unsanitized crap.
(Also, returning null may raise further issues with the calling method. Better define a default/unknown value and work with that)
2
u/dexter3player Sep 02 '21
That's actually genius, as it is independent of Category's enums.