* Jerry Coffin:
> In article <6aok2tF38n2siU1@mid.dfncis.de>, bloodymir.crap@gmx.net
> says...
>
> [ ... ]
>
>> int foo(int param)
>> {
>> int result;
>> if(bar(param))
>> {
>> result = 10;
>> }
>> else
>> {
>> result = -5;
>> }
>> return result;
>> }
>>
>> there is mode code necessary to handle the SESE (single entry, single
>> exit) than there is for actual behaviour. I can't stand it. It's not
>> readable in my opinion.
>
> This can be made SESE with no flow-control at all:
>
> int foo(int param) {
> int rets[-5, 10];
>
> return rets[(bool)bar(param)];
> }
Uhm, I think you must have been coding in some other language recently... ;-)
Anyways, as implicit in my article else-thread, I'd simply use a conditional
expression rather than a look-up.
That is, if I chose to make this a function at all.
Cheers,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?