[PATCH] Add dive list view to main window

Dirk Hohndel dirk at hohndel.org
Thu Apr 11 10:53:37 PDT 2013


Henrik Brautaset Aronsen <henrik at synth.no> writes:

> Den 11. apr. 2013 18:50 skrev "Lubomir I. Ivanov" <neolit123 at gmail.com>
> følgende:
>>
>> On 11 April 2013 19:43, Henrik Brautaset Aronsen <henrik at synth.no> wrote:
>> >
>> > Den 11. apr. 2013 18:27 skrev "Lubomir I. Ivanov" <neolit123 at gmail.com>
>> > følgende:
>> >
>> >
>> >> > +DiveItem::DiveItem(int num, QString dt, float dur, float dep,
> QString
>> >> > loc, DiveItem *p):
>> >> > +    m_number(num), m_dateTime(dt), m_duration(dur), m_depth(dep),
>> >> > m_location(loc), m_parent(p)
>> >> in another thread i pointed out that m_name or m_Name for members is
>> >> not preferable over mName. perhaps others could comment here as well.
>> >
>> > Just out of curiosity: what's that m prefix for?
>> >
>>
>> some C++ programmers prefix their class members with 'm' or '_'.
>> this thread gives some more examples:
>>
> http://stackoverflow.com/questions/1228161/why-use-prefixes-on-member-variables-in-c-classes
>
> It seems unnecessary.  This comment sums it up for me:
>
> "I used to use a m prefix, until someone pointed out that "C++ already has
> a standard prefix for member access: this->.
>
> So that's what I use now. That is, when there is ambiguity, I add the
> this-> prefix, but usually, no ambiguity exists, and I can just refer
> directly to the variable name.
>
> To me, that's the best of both worlds. I have a prefix I can use when I
> need it, and I'm free to leave it out whenever possible."

I missed the part that this was about the m_ prefix. Yes, I find that
prefix puzzling, too. We don't have local variables in functions called
l_i and l_dive...

/D


More information about the subsurface mailing list