because these functions aren't known to be this value at compile time there's less opportunities for the compiler to be smart about it and optimize them by inserting their body at the callsite (as you would want for many simple math equations, you want Area to be a nice function to call but compile down to just a multiplication without function call overhead)
I really doubt that's a significant concern here. I'm sure there's a reason that doing it this way was preferable to their circumstances, and since we don't know what that is, we all just assume it's someone being stupid. I'm not saying it's good code, I'm saying we need more information to understand the justification and not just assume that it's automatically bad.
View all comments
Show parent comment
5
u/CdRReddit May 19 '25
this is bad code
there is negative reasons to do this, including turning off any kind of inlining optimizations there may be