Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
| > Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| > | | Do you mean this one:
| > | | >           - Long variables are named like thisLongVariableName.
| > | | So without the trailing underscore then?
| > No.  Private class member variables get a _ at the end.
| | Where is that written? And what about protected member?

No _.

Too bad... How do you handle the case where you need an access method then? This won't work:

public:
        OneType oneType() { return oneType; }

protected:
        OneType oneType;

I think we need the trailing underscore for protected members. Another solution is to ban protected members.


| In any case I
| never use public member variables.

Very good.

I even think that protected member variables should be avoided.

It depends on the cases but I use them sometime in base virtual classes.


| | This is really not the case in current frontends/* source code.

Right. That code as not been following the rest of the source.

OK I'll try to correct all that after the merge.


| For frontend/[qt3,qt4] I am quite sure I am right. But most code in
| the kernel is C-ish... So it is difficult to extract a rule there. But
| for your pleasure, let's look at some:
| | BufferView: | | Pimpl * pimpl_; // should be Pimpl_

No. Variables, just as functions has a lowercase first letter, so
pimpl_ is correct.

Yes, I wrote that too fast.

|       mutable bool refresh_inside_; // should be RefreshInside_

refreshInside_

again...


| So you see it's difficult to extract a clear figure from this code and
| I would say that the "one_type_" style is used quite often...

Yes, we have gotten confused by boost and stl/std.

So I reckon you want to stick with:
- "oneMethod()" style for member methods.
- "oneType_" for private member variable
- "oneType" style for protected member variable. This one need more discussion.

Abdel.

Reply via email to