Re: Coding style: const QString foo = foo();

2024-10-29 Thread Ingo Klöcker
On Dienstag, 29. Oktober 2024 09:43:06 Mitteleuropäische Normalzeit Sune Vuorela wrote: > On 2024-10-28, Albert Astals Cid wrote: > > My vote goes for rename the variable, there's 2 reasons i can think why > > you do I second this. I dislike symbol shadowing more than I dislike having to find a

Re: Coding style: const QString foo = foo();

2024-10-29 Thread Sune Vuorela
On 2024-10-28, Albert Astals Cid wrote: > My vote goes for rename the variable, there's 2 reasons i can think why you > do > > const QString foo = foo(); > > (there's probably many more, i spent 5 seconds thinking) > > Reason 1: You're caching it because foo is expensive, rename the variable to

Re: Coding style: const QString foo = foo();

2024-10-28 Thread Albert Astals Cid
El dilluns, 28 d’octubre del 2024, a les 10:59:47 (Hora estàndard del Centre d’Europa), Sune Vuorela va escriure: > Hi peoples > > Quite some repositories have enabled cppcheck with a ruleset that I more > or less have composed so far. I do think it provides valuable feedback, > especially if we

Coding style: const QString foo = foo();

2024-10-28 Thread Sune Vuorela
Hi peoples Quite some repositories have enabled cppcheck with a ruleset that I more or less have composed so far. I do think it provides valuable feedback, especially if we can get the rules groomed sufficiently and fix the remaining points. It at least have helped me with quite some bugs over ti