Arlo Belshee on 18 Jul 2003 18:48:01 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [ALACPP] oh, the tragedy


Jon, Jon, Jon.

You do know, of course, just how evil you're being?

I mean, look at this:

> So... I've got an if-statement that looks like this:
>
> if(somePtr && 1 == somePtr->Count &&
>    (const bool* val = VarWrapperClass(somePtr->Array[0])))

, or even this:

> if(const bool* val = VarWrapperClass(somePtr->Array[0]))

Jeez!

Why not a nice, simple assign, then the condition? Twice the line count,
thrice as easy to read.

const bool* val = VarWrapperClass(somePtr->Array[0]);
if(somePtr && 1 == somePtr->Count && val) ...

I really, really hate it when people use the side effect of assignment (ie,
the return value). It just adds obfuscation. I wish they'd defined the
language so that assign didn't have a return value, by the rule that each
function should either have a return value or a side effect. OK, so I don't
always believe in the rule, but still.

And from such a big Functional Programming person. And our const-nazi! Oh, for
shame. For shame.

<shaking head>

Arlo
_______________________________________________
alacpp mailing list
alacpp@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/alacpp