[haiku-commits] Re: haiku: hrev54281 - src/system/kernel/cache

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 4 Jun 2020 08:31:25 +0200

Am 04/06/2020 um 02:12 schrieb waddlesplash:

On Wed, Jun 3, 2020 at 3:18 PM Axel Dörfler <axeld@xxxxxxxxxxxxxxxx <mailto:axeld@xxxxxxxxxxxxxxxx>> wrote:
> The "else" is superfluous, and should be removed again.
IMHO, this code is so critical that it needs to be as clear as possible, so the fact that there are 2 alternatives for how things are written should be explicitly clear from the code, which is why I left the "else" in. But if you feel more strongly about it, I guess I could remove it.

I actually do feel strongly about it (as far as preferences go :-)); and for the same reasons: It should be as clear as possible. The "else" is distracting from the earlier "return"; it's misleading for me.
And it's therefore also part of our coding style guidelines for a good reason IMO.

We can start a discussion about it again, of course, if there is any need to do that.

With so many other things, it boils down to personal preference in the end. I just prefer clutter free code :-)

Bye,
   Axel.

Other related posts: