C++ Logo

sg20

Advanced search

Re: "Clean" Code, Horrible Performance

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 1 Mar 2023 13:03:44 +0200
On Wed, 1 Mar 2023 at 12:59, Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
>
> On Wed, 1 Mar 2023 at 11:34, Yehezkel Bernat via SG20
> <sg20_at_[hidden]> wrote:
> >
> > 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).
>
> I don't have a problem with that writeup. It's applying architectural

I mean, other than the part "So out of the five clean code things that
actually affect code structure, I would say you have one you might
want to think about and four you definitely shouldn't.". Everybody
should definitely think about the four other rules, rather than just
dismissing them off-bat.

Received on 2023-03-01 11:03:57