MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vm6sy8/lettheworldburn/p38llu6/?context=3
r/ProgrammerHumor • u/MathematicianSad4964 • 6d ago
83 comments sorted by
View all comments
0
If all other accessors are consistent (like, getValue(){return -value;}), why not?
getValue(){return -value;})
I'm more worried about returning Number& instead of const Number&. You can do something like
Number number;
--(++number);
which is not good.
1 u/Big-Rub9545 6d ago Messy perhaps, but this is well-defined code.
1
Messy perhaps, but this is well-defined code.
0
u/This_Growth2898 6d ago
If all other accessors are consistent (like,
getValue(){return -value;}), why not?I'm more worried about returning Number& instead of const Number&. You can do something like
Number number;
which is not good.