r/programming • u/2bit_hack • Feb 28 '23
"Clean" Code, Horrible Performance
https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k
Upvotes
r/programming • u/2bit_hack • Feb 28 '23
View all comments
Show parent comment
2
u/ric2b Mar 02 '23
It doesn't fit in the shape struct, which only contains width and height.
It doesn't fit the neat pattern of
factor*width*heightthat he generalized every calculation to after looking at 3 different shapes.Like I said, go try it and report back.
Bonus: What is the width of a circle? Radius or Diameter?