I was wondering if using a member statement is correct . in the following way:
someVector = (segment.getFirst() - segment.getSecond()).normalize().normalCCW();
I just did it to show two different things that I was interested in, namely, if using (expressions).member/function() and foo.getBar().getmoreBar() corresponded to the spirit of readability and maintainability. In all the C ++ codes and books that I learned about, I have never seen it that way, but it's intoxicatingly easy to use it as such. You do not want to develop any bad habits, though.
Probably more (or less) important than that, I was also wondering if there would be any gains or losses in performance using it that way, or unforeseen errors that could lead to program errors.
Thank you in advance!
source share