News for hackers. Stuff that matters.
Re:“Clean” Code, Horrible Performance by fartsucker69 on Wednesday March 01, 2023 @04:01AM (#34980258)
There is nothing more maintainable about the clean code variant either.
Re:“Clean” Code, Horrible Performance by gjulianm on Wednesday March 01, 2023 @04:21AM (#34980344)
There is. The first one is that the code with the switch pattern can only process simple shapes. Let's say you want to get the area of a donut now. Well, you need to change the whole code to compute the area of the union. Or imagine that there are other places in the code that need to know the area of a single shape. Do they need to copy/paste the same code?