Being documented doesn't still make it good. Unless some tiny perfomance edge is really important, one should choose a way that is intuitive to understand. Less bugs, easier for others to modify.
I find it relatively intuitive to say "return the message or the number." It should only take a brief glance to understand it. And mentioning the documented behavior is just to point out that it's not relying on any hacks or unintended behavior, and is thus a perfectly legitimate line of code.
View all comments
Show parent comment
2
u/Nghteye Jan 16 '14
Being documented doesn't still make it good. Unless some tiny perfomance edge is really important, one should choose a way that is intuitive to understand. Less bugs, easier for others to modify.