Using the right tool for the job
Posted by therightnotes on June 12, 2007
We’ve been having a discussion internally among the Notes developers about how to best write hide-when formulas based on user roles. There was a group who usually used @contains, but we have run into problems where the substring is Null, because then @contains always returns True. I’ve always advocated using @ismember because it seems to be a more accurate function when I want to know whether or not a person is enrolled in a particular roll.
My supervisor, who is a brilliant coder, prefers to write hide-when formulas in this way: write a formula for who should see the item, then make it a negative using the ! operator (and changing booleans as necessary). I’ve always found this a bit difficult because my mind doesn’t work this way. Also, I chafe at things like !@ismember when there is a function called @isnotmember. I feel certain that the latter must be faster (albeit fractionally), and I find it easier to read. I guess it’s just my feeling that we should try to use the tools given to us that are best suited for the task.
Stephan H. Wissel said
@Contains is not only problematic with empty string, but also quite slow. For a discussion of @IsMember and friends have a look at this entry.
stw
Pinochle said
Somehow i missed the point. Probably lost in translation
Anyway … nice blog to visit.
cheers, Pinochle!!!