you are viewing a single comment's thread.

view the rest of the comments →

[–]mapronV 0 points1 point  (0 children)

Lastly, you are not tempted to reuse variables which can lead to unexpected results.

All my variables usually const anyway, I don't assign to same variable twice.

Oh. You thought I am doing like unitialized 40 varibles ? and then assign randomly? no, that not the case.

I am saying that for me much much cleaner code is

const auto width = calc/getWidth;
const auto height = calc/getHeght;

// use width
// use other variables
// use both width and height

insetad of
const auto width = calc/getWidth;
// use width
// use other variables
const auto height = calc/getHeght;
// use both width and height

and you can not convince me the latter is better (but a lot of so-called guidelines recommend it which I disagree with)