On Wed, 2002-10-23 at 22:07, Rob Lahaye wrote: > Angus Leeming wrote: > >> > >>2001-09-08 Rob Lahaye <[EMAIL PROTECTED]> > >> > >>* FeedbackController.C: separate width as an "int const"; > > > > > > Seems a little excessive, as it's used only once... > > Fine with me. > Let me make this remark: in the LyX code I have seen so very many > cases of "type const var = ...", used only once, that I thought it > may be a coding policy for better readability. Well, indeed it > increases the readability.
I agree with that. Plenty of things that make no difference to the compiler play a big role in readability. > If I remember well from one of my C++ books, the compiler may remove > the "type const var = " definitions and plug the value into the > place instead of the variable. This certainly will happen for const > variables that are used only once. Sounds plausible. I've seen GCC optimise *inside* inline assembly code. Surely it does that and more =) > So when I see a long expression, that is difficult to comprehend, > I consider ripping it into one or several const defines, to improve > readability. Is that alright, or not? Well, FWIW, I would love to see that done wherever it helps. Even where it doesn't is fine, since it shouldn't hurt and somebody might benefit. > Cheers, > Rob. Have fun, Daren