|
|
On 02/05/2011 18:26, Darren New wrote:
> I find it mildly distracting that I can't do this:
>
> void xyz() { ... }
>
> void abc()
> {
> if (...)
> return xyz();
> else blah blah blah;
> }
>
> I can do it if xyz and abc return values, but not if they don't. I have
> to instead
> if (...)
> {
> xyz();
> return;
> }
>
> which significantly expands a function that has lots of such dispatches.
> It also makes it unclear to the casual reader that this is a tail call.
How about just
if (...)
{xyz(); return;}
else...
That's slightly less load.
Of course, The Real WTF is "functions" that return void. ;-)
> Also, I realized I tend to have larger functions than necessary because
> most languages I'm using don't let me nest functions.
No comment. ;-)
Post a reply to this message
|
|