Found this gem while helping someone on Freenode. I'd be interested in seeing how this code evolves if they decide to use floating points instead of integers. Increment by some arbitrary step? "0.01 should be good enough for anyone."
At least the indentation is nice. Some other things that bother me:
Passing point and rect by value instead of pointer or reference
The struct is named rect, but the function calls it a rectangle
67
u/RFC793 Dec 20 '16 edited Dec 20 '16
Found this gem while helping someone on Freenode. I'd be interested in seeing how this code evolves if they decide to use floating points instead of integers. Increment by some arbitrary step? "0.01 should be good enough for anyone."
At least the indentation is nice. Some other things that bother me:
Passing
pointandrectby value instead of pointer or referenceThe struct is named
rect, but the function calls it arectangleiandjinstead ofxandyNested
if'sInconsistent whitespace around operators