I had just completed a curteous detailed response and this f'ing stoopid pos bbs demanded re-login before submitting and the reply was discarded.
I note this does not appear to be a public discussion.
several cases where with the auto type setting it is not clear what type the variable has just by looking at the code.
Here an example:
Prior to my and wmayer commits was:
Code: Select all
332: const std::map<std::string,std::string>& config = App::Application::Config();
333: std::map<std::string, std::string>::const_iterator ht = config.find("HiddenDockWindow");
The definition is in the immediately prior line. It can't get any closer than that.
I worked with @berniev to make sure this PR focused on cases where the type was literally repeated on the same line
That's not entirely correct. We certainly agreed on only auto. I had previously added drive-by fixes. It was only later you asked auto loops and single line auto be kept separate -- due to time taken to review prev PR, which is fine.
In response to this I sought clarification on a number of things you had been requiring. The response was unhelpful, and unfortunate.
I looked at the code in actual use in FreeCAD, particularly re
@wmayer,
@realthunder and
@chennes. I found all use auto liberally and in a much more relaxed manner than being suggested here. They all regularly auto on a var which is a class var. They all auto loop on a method return value, even sometimes where the method is outside the current class.
So the rhetoric and reality are different.
Anyhow, much to do. I propose:
- Permit auto on class var (from within the class) [existing practise]
- Permit auto loop on method return value (from within the same class) [existing practise]
- Require * in auto on pointer [clang-tidy default]
- Do not require const on auto when making iterator on var. [Compiler will choose const-iterator or iterator]
- Do not require const on auto where referenced var is already const. [Compiler will make it const]
- Do not require const auto & var everywhere possible. [Sometimes with simple types auto var makes for less copying. IDE with clang-tidy helps]
- In a large PR review do not quibble about very minor formatting issues. [WOFTAM There's already zillions of them in the codebase and all will one day be wiped out by a global reformat (I hope!)]
- In a PR review don't request incidental fixes [Conflicts demand on coder to stay on-topic]
- Have discussion, but don't sweat every minor detail. Let's have proper big picture discussion. Currently there is no plan, no leadership, for the most of us to follow. IMHO there is a huge amount to do. This is the lowest hanging fruit, the simplest part of modernisation.