A start from Arno, by e-mail 2013-12-03:

As promised here is the first update about the existence of any software writing guidelines: None from xDAQ, TriggerSupervisor, uHal.

This means we should further check Alessandro's code layout and discuss details in the next meeting.

In addition I checked the web and I found some useful discussions about using getters/setters in C++ objects, e.g.:

http://www.kirit.com/C%2B%2B%20killed%20the%20get%20%26%20set%20accessors

We've already discussed yesterday that we should use more explicit and reasonable names for classes and variables incl. changing the Wu language. A second point is that we should agree on a convention about how to access internal variables (protected or private) of an object through accessors. I would vote for the following, which is open for discussion:

  • internal variable names should start always with a "_", e.g. int _Internal.
  • The next letter i.e. first letter of the variable should be capitalized in case the variable is protected. For internal variables this letter is always lower case, e.g.
protected:
int _Internal1;
 
private:
double _internal2;
  • getter functions for the protected variables should be named by the variable name without the "_", e.g. object1.Internal() ... Remark: the rest of the capitalization should match the (internal) variable name
  • setter functions should have a "Set" in front, e.g. object2.SetInternal(...)

What do you think?

-Arno

-- EricHazen - 04 Dec 2013

Topic revision: r1 - 04 Dec 2013 - EricHazen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback