in reply to Re^3: if statement confusion
in thread if statement confusion
Yes, I'd always want an expert to be the one handling my contracts, medical diagnosis, etc. But does that mean that they should be made as complex as possible so that ONLY an expert can understand it?
No. But then, I never suggested that. Requiring more than "a glance" is not the same as "complex as possible".
And suggesting that every program should be written so as to be understandable by the most inexpert of programmers is a crock.
Eg. There are some algorithms that are very cleanly and concisely described using recursion, that require verbose, intricate and vastly more complex descriptions when done without it.
But there are quite a few "programmers" -- including some I've encountered in quite senior positions with 'many years of experience' -- who simply cannot 'get' recursion. Avoiding recusion because there are some people that will never get it is ridiculous.
Finally, there is nothing "complex" or "difficult" about the ternary statement:
, which is where this subthread got started.my $var = cond ? constantA : constantB;
|
---|