Qt models uniquely for mobile or desktop

Berthold Stoeger bstoeger at mail.tuwien.ac.at
Sun Jan 21 15:21:24 PST 2018


On Sonntag, 21. Jänner 2018 14:59:06 CET Jan Mulder wrote:
> On 21-01-18 14:09, Tomaz Canabrava wrote:
> > On Sun, Jan 21, 2018 at 1:30 PM, Jan Mulder <jlmulder at xs4all.nl
> > 
> > <mailto:jlmulder at xs4all.nl>> wrote:
> >     On 21-01-18 12:50, Tomaz Canabrava wrote:
> >         This is something that I didn't wanted to do since the beginning.
> >         our models *should* be both desktop and mobile compatible (with
> >         the exception of the dive list because of the way QT handles
> >         Tree Views)
> >     
> >     I agree with that (models *should* be both desktop and mobile
> >     compatible). However, when checking the current code base, we see
> >     that we only have 2 models that are used both in mobile and desktop,
> >     and the rest is used exclusively only on mobile (3 models) or only
> >     in desktop (18! models). And as there is no reason to link in any
> >     unused code, just do not link those 18 desktop only models to the
> >     mobile app.
> > 
> > there's also no reason to duplicate code, I prefer to have a bit of
> > unused code in both platforms than to duplicate stuff - also this means
> > less code to maintain, and usually less bugs.
> 
> And also agree on this, But in this action, not 1 line code is
> duplicated. And I do not promote any new duplications. The only thing is
> that the unused code is not compiled (and linked). And as unused code is
> not exercised (in mobile), we cannot even see that it *is* compatible or
> not.

I like Jan's idea because in his approach code-organization reflects reality. 
If anything, it will make duplication of code more visible, because unshared 
models are clearly flagged. Matter of fact, I was completely unaware of the 
numbers above (2 vs. 3 vs. 18) and the new directory structure will make this 
very obvious.

OT: That's also the reason I dislike 'int* ptr;'-style declarations. It's 
simply not how C and C++ parse, sorry. Let's not pretend that they do.

Berthold


More information about the subsurface mailing list