C++ Logo


Advanced search

Re: "Clean" Code, Horrible Performance

From: Yehezkel Bernat <yehezkelshb_at_[hidden]>
Date: Wed, 1 Mar 2023 11:33:56 +0200
Couldn't agree more. This transformation is easy to do when you have a
single member function, not when you have dozens of them, and more class
trees for other parts of your system. Not to mention that they picked up
only the simple shapes, where it's possible to multiply width by height and
then by some factor :)

BTW, for the "corner count" example, I think common guidelines would
suggest making it a data member that is saved in the base class and
initialized by the c-tor, not a virtual function (but some maybe wouldn't,
as it increases the size of each object).

On Wed, Mar 1, 2023 at 10:39 AM JC van Winkel via SG20 <
sg20_at_[hidden]> wrote:

> Hi,
> I came across this article
> <https://www.computerenhance.com/p/clean-code-horrible-performance>
> (summary of a video <https://www.youtube.com/watch?v=tD5NrevFtbU>) that
> says that we are teaching people the wrong things.
> My feeling is that the presenter is cherry picking the worst possible
> examples and values micro-optimizations over maintainability and I wonder
> how often the presenter has worked on really large code bases...
> JC
> --
> SG20 mailing list
> SG20_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg20

Received on 2023-03-01 09:34:14