02-07-2019 10:13 AM
wiebe@CARYA wrote:
Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.
Yes, true, but reordering Enums can sometimes be dangerous. 🙂
/Y
02-07-2019 10:20 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.
Yes, true, but reordering Enums can sometimes be dangerous. 🙂
/Y
Agreed and exactly where do you put the documentation to warn those that follow?
It would be better to be explicit in the code and spare those that inherit the code.
Who is that has the signature;
"Code like the person that will follow you is a psychopath that knows where you live."
Ben
02-07-2019 10:25 AM
"Code like the person that will follow you is a psychopath that knows where you live."
Wise words to live by!
02-08-2019 02:27 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
Or make the 'invalid' enum value the first value of the enum. That would return 'invalid' as default in case of error.
Yes, true, but reordering Enums can sometimes be dangerous. 🙂
/Y
Of course, of course. Especially\only when certain rules (using named (un) bundles) are not followed, it will be tricky.
That brings us to the topic of avoiding the Variant To Data altogether. OO would probably eliminate the need for it completely...