[Interest] Is moc obsolete?

Jason H jhihn at gmx.com
Wed Jul 8 20:50:22 CEST 2015


Those of us not able to be on the L&G compilers would value the presence of moc in the not-bleeding-edge compilers.
Source compatibility cannot be overstated. In fact, the original post on http://woboq.com/ is asking the question, if it is possible, not that moc has outlived it's usefulness or there is something better.

While I believe C++ will eventually get introspection, we have it today, and I estimate moc to be around for another 20 years.  But I expect the landscape of programming languages to have shifted to something more 4th-gen or scripty. (Javascript if it becomes templated will be a contender (sweet.js), as well as any brain child of a consolidation between Java, C#, Python (the strong-typed oop languages)) 

I think talk of killing moc is premature, as it works very well and everywhere. 

> Sent: Wednesday, July 08, 2015 at 2:26 PM
> From: "Till Oliver Knoll" <till.oliver.knoll at gmail.com>
> To: "Qt Project" <interest at qt-project.org>
> Subject: Re: [Interest] Is moc obsolete?
>
> 
> 
> > Am 08.07.2015 um 08:57 schrieb Igor Mironchik <igor.mironchik at gmail.com>:
> > 
> > Hi,
> > 
> > Does anybody know if Qt plans to remove moc in the future releases, let's say in Qt 6?
> 
> What's wrong with moc? :)
> 
> Seriously, while in the very beginning I was doubtful about an "additional build step that messes around with my source" moc never got into my way. Even with Visual Studio 6 and the corresponding Qt VS Addon back in the days one hardly noticed the presence of moc.
> 
> And all moc does is spit out some more C++ code, which - most importantly for me - I never get to see! So why would I care about moc?
> 
> Granted, initially moc did not take #defines and #ifdefs (mostly evil anyway) into account (IIRC moc now does some pre-processing on its own, or runs after the preprocess phase...), linker errors due to stale moc_* files occured (mostly due to different time stamps on network shares - "Try to compile in a minute! It'll work!") or "DLL export" issues then and when ("you need to DLL export the whole class that is going to be moc'ed - not just selected public/protected methods/symbols").
> 
> But from a practical standpoint - especially in combination with qmake/Qt Creator - IMHO moc does its job well: create a "meta system, signal/slot connections etc."
> 
> Or did I miss something?
> 
> Cheers,
>   Oliver
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
> 



More information about the Interest mailing list