Am 29.08.2014 16:26, schrieb Axel Dörfler:
Am 28/08/2014 22:44, schrieb Julian Harnath:Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> schrieb:Furthermore, removing the else makes it clearer that the function returns something useful.While you're right that the 'else' is not necessary, I don't really see how it becomes clearer without it...In this particular case there is indeed not much difference :-) IMO the else somewhat disguises that the clause before exits the function. Still, it's part of our coding style IIRC. If it's not, it should be in there.
I don't agree. The function returns either this or that, based on the condition, and the formatting makes this pretty obvious. With a your proposed formatting, one would have to mentally translate it first. Not very difficult, but I don't believe applying the style guide in corner cases like this when it makes the code a bit more obscure.
Best regards, -Stephan