Yes of course ! It's true that I could show it with operator overloading, but I thought that only a function could easier. I can write it down in the next post 🤩 Thank you for your comment @leprechaun !
You are viewing a single comment's thread from:
To me its easier to use operators rather than words because there are many code patterns that could exist for a class to do a subtraction operation:
a.subtract(b) or subtract(a,b) or a.minus(b) or minus(a,b) and then camel case vs. snake case conventions and so on which don't apply to subtract but you con conceive this being an issue with "divided by".
The fact that the method exists at all proves some people prefer methods to operators. There is no accounting for taste.