[Qt-creator] Whacky thought of the day

Miller Henry MillerHenry at JohnDeere.com
Tue Mar 4 17:19:03 CET 2014


My workflow may be helpful:

Create header, right-click on function in header,  select  Refactor, then Add Definition in …”

I think that it is better at this point to live with a less than idea workflow for a short time until we see what C++ modules comes up with.  Hopefully it simplifies things and allows a workflow that is better.  Only time will tell.

From: qt-creator-bounces+millerhenry=johndeere.com at qt-project.org [mailto:qt-creator-bounces+millerhenry=johndeere.com at qt-project.org] On Behalf Of Jason H
Sent: Tuesday, March 04, 2014 10:15 AM
To: Ziller Eike; Vojtěch Král
Cc: qt-creator at qt-project.org
Subject: Re: [Qt-creator] Whacky thought of the day

While a collapse all is nice, I think I've become much more dependent on auto complete. Gone are the days of looking at .h files, I just start typing and let creator's (or VS) auto-complete clue me in.

Ultimately, I don't really care about /how/ it is implemented. I care about my /workflow/. Which is currently generate a header, copy, the function declaration between { } from the header into cpp file then do a lot of pasting "ClassName::" in front of the functions, clearing out default parameters, setting up the {} for each function, then I can actually start coding. It's a lot of time that adds up. "Code less, create more." And it's all stuff, I shouldn't have to do because I'm repeating myself.



________________________________
From: Ziller Eike <Eike.Ziller at digia.com<mailto:Eike.Ziller at digia.com>>
To: Vojtěch Král <vojtech at kral.hk<mailto:vojtech at kral.hk>>
Cc: "qt-creator at qt-project.org<mailto:qt-creator at qt-project.org>" <qt-creator at qt-project.org<mailto:qt-creator at qt-project.org>>
Sent: Tuesday, March 4, 2014 6:03 AM
Subject: Re: [Qt-creator] Whacky thought of the day


On Mar 4, 2014, at 10:20 AM, Vojtěch Král <vojtech at kral.hk<mailto:vojtech at kral.hk>> wrote:

> 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”?

That is actually, or could at least be seen as, a problem of “presentation”. An intelligent “collapse all implementation” in your editor would give you the API overview.

But, headers in C++ are not just an overview of the API, for example a class declaration also defines the actual layout of the class and its members in memory. So, while we are able to arbitrarily reorder function definitions in source files, that’s not advisable in the header/declaration. That’s a problem (and a feature!) that’s inherent in C++, and does not exist in Java/C#/Python/…, and IMO would make it very ugly to auto-generate headers or have pure “definition is in declaration” style code.

> 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<mailto:scorp1us at yahoo.com>>
>> To: "qt-creator at qt-project.org<mailto:qt-creator at qt-project.org>" <qt-creator at qt-project.org<mailto: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<mailto:vojtech at kral.hk>>
>> To: qt-creator at qt-project.org<mailto: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<mailto:Qt-creator at qt-project.orghttp>://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org<mailto:Qt-creator at qt-project.org>
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>>
>>
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org<mailto:Qt-creator at qt-project.org>
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>
>>
>>
>> _______________________________________________
>> Qt-creator mailing list
>>
>> Qt-creator at qt-project.orghttp<mailto:Qt-creator at qt-project.orghttp>://lists.qt-project.org/mailman/listinfo/qt-creator
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org<mailto:Qt-creator at qt-project.org>
> http://lists.qt-project.org/mailman/listinfo/qt-creator

--
Eike Ziller, Senior Software Engineer - Digia, Qt
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin. Registergericht: Amtsgericht Charlottenburg, HRB 144331 B


_______________________________________________
Qt-creator mailing list
Qt-creator at qt-project.org<mailto:Qt-creator at qt-project.org>
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/0a16dbbc/attachment.html>


More information about the Qt-creator mailing list