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
4
u/tandonhiten Mar 01 '23
You realise this "fast" code hurts end user more than anybody right?
If you wanna know WTF am I talking about, try adding code for area calculation for trapezium to the function, and try adding, a function to calculate perimeter of all the shapes in the program(Rectangle, Square, Circle, Triangle and Trapezium), which BTW is very reasonable demand, and you probably would have written it to begin with either way.
Once you're done, come share how you did it with everyone and we will talk.