[Scip] Design choices

Benjamin Hiller hiller at zib.de
Fri Jun 28 10:03:12 MEST 2013


Hi Michael,

On 06/27/2013 10:23 PM, michael.winkler at zib.de wrote:
>> Ah, well i should have looked into the documentation for that one. That's
>> the reason I dislike boolean values in function calls by the way: The
>> purpose is not clear at all, better use enum.
> 
> Imo, in most cases boolean values are better understandable then enums and
> also enums seem to make you wonder whether there are more then two
> possible values.

I think that Sefan was (indeed) thinking of enums with more than two
values, e.g.

SCIP_IS_INITIAL = 1
SCIP_DO_SEPARATE = 2
SCIP_DO_ENFORCE = 4
SCIP_CHECK_FEASIBLE = 8
...

so one could put

SCIP_IS_INITIAL + SCIP_CHECK_FEASIBLE

instead of

true, false, false, true

And I'd prefer this, too, but in a long-running project like SCIP things
are as they are and it it is not easy to change them. I'm sure it started
out with two or three bools, which wasn't too bad, and grew more ugly over
time.

Best,

Benjamin


More information about the Scip mailing list