3 ms·
I agree. If a function isn't side-effect-free, then you've got other problems besides whether it's used with a ternary operator. My primary language, Object P
by TimJYoung 9y ago
I agree. If a function isn't side-effect-free, then you've got other problems besides whether it's used with a ternary operator.
My primary language, Object Pascal, even goes to the length of naming functions (return values) and procedures (don't return values) differently. It really helps to focus the mind on the purpose of each: one almost always expects procedures to do something and, most likely, modify something that may introduce side effects. Functions are almost always side-effect-free in "decent" Object Pascal code.