Divecomputer nickname handling..

Tomaz Canabrava tcanabrava at kde.org
Thu Sep 17 15:34:14 PDT 2015


On Thu, Sep 17, 2015 at 7:30 PM, Linus Torvalds <
torvalds at linux-foundation.org> wrote:

> On Thu, Sep 17, 2015 at 3:18 PM, Tomaz Canabrava <tcanabrava at kde.org>
> wrote:
> >
> > move all members on the class to public access, then create static
> functions
> > on the .cpp file like this:
> >
> > static void helper_function1(MyClass *self, var1, var2... ) {
> > ...
> > }
>
> Yes, yes, I know this very well. And then you have that mixture of
> explicit object pointers and implicit method member uses, and it just
> confuses everybody because the "same" code ends up looking very
> different indeed. It's detestable, and it makes it impossible to move
> the *same* code out to a helper function: you basically have to edit
> the end result so that it doesn't look at all the same as what it
> would do inside the function.
>
> .. and there's no reason for it. C++ should just have allowed private
> static (or inlined) member functions that have to be resolved at
> compile-time within that function and don't need declaration because
> they don't have any external visibility and no possible virtual
> entries.
>
> You'd almost be better off just using "this->" everywhere, just to
> have that consistent syntax.
>
> And I really _detest_ changing header files for local re-organization.
> It is just another reason C++ projects take forever to build - because
> even local cleanups end up forcing a full rebuild just because you
> ended up changing the member functions.
>
> The last time this came up I think Thiago said that there's support
> for it in the upcoming C++ standard. So _eventually_ you can just make
> inlined helpers, I hope.
>

Well, there's hope.
My code today is a fine mix between C and C++ code thanks to Subsurface and
Soletta.
One thing that I'm actually spending a bit of time here in my local repo is
to figure out all the
headers that can be moved out of another headers so the compile time would
be affected.

Already managed to get quite a few out, I hope to decrease compile times
sensibly.


>
>              Linus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150917/9f6dfe8b/attachment.html>


More information about the subsurface mailing list