Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


On 18/09/2018 17:21, Tor Lillqvist wrote:
On the other hand, do we really consider what sd/source/ui/inc/unokywds.hxx exhibits to be good style?

My personal impression has been that we want to eventually get rid of stuff like this and just use literal strings as such in the code, and I have occasionally committed changes like that.

I guess there's no golden rule here.  Things like

  OUString const empty;
  constexpr int one = 1;

are apparently bad, but something like

  constexpr sal_uInt16 magic = 0xCAFE;

can be good.

(While we're not completely there yet, the /type/ of the literal should not drive the decision whether to name it with a variable or spell it out as a literal each time it is used.)

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.