I'll take a wild stab in the dark here and say that people fall into two camps:
Personally, I would tend to always write a meaningful return
statement in main
in my production code (if only because my production main
s tend to also contain code paths that end up returning something other than 0
, generally in exception handlers), although I wouldn't bother for a trivial main
that never returns anything else; for example, I don't think I've ever done so in, say, a Coliru post for a Stack Overflow demonstration.
Some would say that it's absurd to alter a codebase to flip between these two states, that the arguments are both very weak in the grand scheme of things, and that such a personal choice is not worth risking the introduction of bugs.
But I'd say this depends almost entirely on what your environment is like. If you're halfway through a release cycle, of course you're going to make code maintenance improvements and style adjustments: this is the best time to avoid accruing technical debt, and you absolutely want to do that. But if you're planning to make this change directly on a production server, or in version control one week before that big release, you're out of your mind.
(Hopefully your policies prevent such madness anyway. Code freeze, yes? No changes to production, right?)
So, although it goes without saying that the underlying choice is highly subjective, we can quantify the risk/benefit of enforcing such a choice after-the-fact.
But never mind real life, what about on Code Review? Well, I have no idea; you'd have to ask them. Personally, on those specific examples, I probably would have removed it too, albeit with the written caveat that this were purely a style choice. Whether purely style changes are appropriate on Code Review is a question for Code Review Meta.