[Qt-creator] Whacky thought of the day

Vojtěch Král vojtech at kral.hk
Tue Mar 4 10:20:39 CET 2014


 

Hi 

On 2014-03-04 05:56, Jason H wrote: 

> I just got done going over the module slides. I hadn't heard of them, but they seem like a really good idea. 
> 
> If you think headers are a good thing, read them: 
> http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
> 
> Why do you need over 1 meg of headers for an 80 byte file? People turn to PCH, but that's just doubling down on a mistake.

Obviously headers have some problems, especially performance. But they
also have benefits, which are also, as you may notice, mentioned in this

presentation. The most prominent one is programmer being able to see the
general structure of API in a heaeder file. When working in Python or
Java, I have sometimes missed headers, because it's quite hard to
observe general structure of a 5000 lines Java class, for example.
Notice the slide named "Embrace Headers"? 

The module system sure sounds like a nice idea. I'd love not to be
forced to implement PIMPL by hand any more, for example. But there are
points to keep in mind: 1) it's not going to make headers go away, not
any time soon anyway, to me it looks rather like a way to make headers
more efficient, and 2) module system introduces quite a lot of
additional complexity. Modules formerly should've been a C++11 feature,
but were 'headed for a TR', which is nowhere in sight as far as I know. 

Regards, VK 

> -------------------------
> FROM: Jason H <scorp1us at yahoo.com>
> TO: "qt-creator at qt-project.org" <qt-creator at qt-project.org> 
> SENT: Monday, March 3, 2014 11:49 PM
> SUBJECT: Re: [Qt-creator] Whacky thought of the day
> 
> Headers are not a feature. They violate DRY, and create additional maintenance. They are a hack to deal with C++ compiler limitations to provide quick type checking and parameter matching. If it could be done over (and it has with Java, Python, and C#) they would not continue to separate prototypes from implementation. Your tools should do the work, not you. There is nothing the separation adds, other than additional work an chance for errors. 
> 
> -------------------------
> FROM: Vojtěch Král <vojtech at kral.hk>
> TO: qt-creator at qt-project.org 
> SENT: Monday, March 3, 2014 8:37 PM
> SUBJECT: Re: [Qt-creator] Whacky thought of the day
> 
> Hi, 
> I don't really see why you would want to do something like that. Headers are a feature, not a bug. I don't think many people would regard that as an "elevation". 
> Regards, VK 
> 
> On 2014-03-04 01:17, Jason H wrote: 
> 
>> So Qt comes along and helps kick C++ into the modern era. I was wondering if we could use Qt Creator to address one of my remaining complaints of C++. 
>> 
>> I really like languages like Python, C#, and Java where there is only an implementation file. While we can't get rid of headers, it would be cool if we could define a class file that gets split by QtCreator or qmake that would prepare the .h and .cpp files from a unified file. 
>> 
>> Creator helps with the maintaining the header and the C with the light bulb, but this isn't as elegant as having one file that controls both. I'm wondering if its possible and f clang would be any help in reaching this new level of elevating C++? 
>> 
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/qt-creator [1]
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator [1] 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator [1] 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/qt-creator [1]
 

Links:
------
[1] http://lists.qt-project.org/mailman/listinfo/qt-creator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140304/70e1fc6c/attachment.html>


More information about the Qt-creator mailing list