Op 6 aug. 2016 11:26 schreef "Abdelrazak Younes" <you...@lyx.org>: > > Hi Scott, > > Too late already but my 2 cents below :-) > > > On 27/07/2016 02:54, Scott Kostyshak wrote: >> >> The attached patch constifies a function parameter. My question is >> whether this patch causes more pain to other developers than it does >> good to the code. >> >> The patch modifies a header that is included in many of our .cpp files, >> so will cause a significant amount of recompilation. >> >> I think I will come across this scenario in the future so I am curious: >> what are your preferences? >> >> (1) Do not commit any part of the patch because it is so minor. > > > This is my preference because it doesn't bring anything and it can create confusion for the beginner when compared with const reference. The C++ beginner could be tempted to add a "&" here... > > I think it was in the coding style document somewhere that POD parameter (except big structure of course) should be passed by copy. > > Conclusion: I'd prefer the coding style to actually forbids this actually :-) > The coding style should also say that function parameter shall not be changed in the function. Create your own local copy if you need it. > > Thanks, > Abdel. >
Hi Abdel, I remember the same coding rule and was therefore tempted to reply in the same line. However, when I looked into the code, I saw that this function was very very long, and therefore it is not easy to always see that this variable is actually a function parameter. But, I guess the coding standard says that functions shouldn't be longer than something like half a screen. Vincent