Fueled by Decaff's Great Idea
-
I Thank Fueled by Decaff for his/her idea The Lounge[^] of
#include
'ing every header and one by one eliminating those not needed. It can easily be automated i.e. to wit once compiled as in my case the order matters though finding the correct order is only 1h of labor more or less on my pig of a machine then starting at the bottom of the list doing as suggested which can easily be automated for all the files in the project via awk. Voila Bingo Presto Problem Solved! Once and for All. I can not see any reason this will not work. Why is FbyD's idea not common widespread or taught in school though I would not know if not common widespread or taught in school as I am a meagre programmer but a happy one now that I can minimize my build times on my pig of a machine with just a press of a button. -
I Thank Fueled by Decaff for his/her idea The Lounge[^] of
#include
'ing every header and one by one eliminating those not needed. It can easily be automated i.e. to wit once compiled as in my case the order matters though finding the correct order is only 1h of labor more or less on my pig of a machine then starting at the bottom of the list doing as suggested which can easily be automated for all the files in the project via awk. Voila Bingo Presto Problem Solved! Once and for All. I can not see any reason this will not work. Why is FbyD's idea not common widespread or taught in school though I would not know if not common widespread or taught in school as I am a meagre programmer but a happy one now that I can minimize my build times on my pig of a machine with just a press of a button.meagreProgrammer wrote:
Why is FbyD's idea not common widespread or taught in school though I would not know if not common widespread or taught in school
Because the answer you came up with is
meagreProgrammer wrote:
automated for all the files in the project via awk
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
-
I Thank Fueled by Decaff for his/her idea The Lounge[^] of
#include
'ing every header and one by one eliminating those not needed. It can easily be automated i.e. to wit once compiled as in my case the order matters though finding the correct order is only 1h of labor more or less on my pig of a machine then starting at the bottom of the list doing as suggested which can easily be automated for all the files in the project via awk. Voila Bingo Presto Problem Solved! Once and for All. I can not see any reason this will not work. Why is FbyD's idea not common widespread or taught in school though I would not know if not common widespread or taught in school as I am a meagre programmer but a happy one now that I can minimize my build times on my pig of a machine with just a press of a button.1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves,
#include
s get added. Want to maintain that? 3. As I mentioned yesterday, you can remove an#include
for a header that is included transitively. But doing so can break the compile if a file that you#include
removes an#include
that gave you this transitive embedding. The only way to make this painless is with a tool that analyzes dependencies so that it can update#include
directives automatically.Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves,
#include
s get added. Want to maintain that? 3. As I mentioned yesterday, you can remove an#include
for a header that is included transitively. But doing so can break the compile if a file that you#include
removes an#include
that gave you this transitive embedding. The only way to make this painless is with a tool that analyzes dependencies so that it can update#include
directives automatically.Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.Greg Utas wrote:
The only way to make this painless is with a tool that analyzes dependencies so that it can update #include directives automatically.
I didn't know that such a tool exists. Thanks for the tip.
The difficult we do right away... ...the impossible takes slightly longer.
-
I Thank Fueled by Decaff for his/her idea The Lounge[^] of
#include
'ing every header and one by one eliminating those not needed. It can easily be automated i.e. to wit once compiled as in my case the order matters though finding the correct order is only 1h of labor more or less on my pig of a machine then starting at the bottom of the list doing as suggested which can easily be automated for all the files in the project via awk. Voila Bingo Presto Problem Solved! Once and for All. I can not see any reason this will not work. Why is FbyD's idea not common widespread or taught in school though I would not know if not common widespread or taught in school as I am a meagre programmer but a happy one now that I can minimize my build times on my pig of a machine with just a press of a button.A similar issue I have with C# is that I use CSC (the command-line C# compiler) with response files -- some response files include other response files, etc. As my code has evolved, I may have some code files included in a response file when they are no longer needed. Every once in a while I think about writing a tool which will eliminate references to code files which are no longer needed in a particular build.
-
A similar issue I have with C# is that I use CSC (the command-line C# compiler) with response files -- some response files include other response files, etc. As my code has evolved, I may have some code files included in a response file when they are no longer needed. Every once in a while I think about writing a tool which will eliminate references to code files which are no longer needed in a particular build.
I do not know C# or what a "response file" is. If they are anything like C++
#include
's I do not see why a simple awk program which would execute the suggested procedure would not solve the problem at the press of a button. -
I do not know C# or what a "response file" is. If they are anything like C++
#include
's I do not see why a simple awk program which would execute the suggested procedure would not solve the problem at the press of a button.Well, right, definitely not AWK.
-
Well, right, definitely not AWK.
May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.
-
May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.
I think it depends on your target audience. If you're targeting folks that primarily develop on unix, awk may be the way to go, as most distributions have it installed, or it's easily addable. With WSL under windows, you *can* add it, but if you're not already set up for it it's more of a pain. If my target was Windows, I'd consider another programming environment, like C#. It I truly wanted it to work easily on any platform, I'd write it in C++, and compile it for common platforms + distribute the source . That being said, sometimes I do use C# on linux because Mono is often shipped with linux distributions. It can be the quick and dirty route to make something easily usable on common platforms.
To err is human. Fortune favors the monsters.
-
May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.
C# of course. I don't use UNIX.
-
C# of course. I don't use UNIX.
I do not use unix either. I work on Windows. I recall not having too much trouble installing awk for Windows. I suppose if I were to use a general purpose language I would rely on a regular expression library which C++ provides. I wrote a nifty little awk program which indents my source after Visual Studio mangles the indentations the result of my insisting macros embed the statement terminator ';' as it looks ugly otherwise which unfortunately causes VS IntelliSense to mangle the indentations. As I recall I wrote a little tip here re/ same.
-
1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves,
#include
s get added. Want to maintain that? 3. As I mentioned yesterday, you can remove an#include
for a header that is included transitively. But doing so can break the compile if a file that you#include
removes an#include
that gave you this transitive embedding. The only way to make this painless is with a tool that analyzes dependencies so that it can update#include
directives automatically.Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.It seems to me no matter how headers are
#include
'd there is an order w/ a top and a bottom. Perhaps it is tree-like. In which case each branch may have different needs at a common root. This would complicate things but can still be automated per FbD's idea as near as I can discern. Specifically if a root of one branch does not require a particular file but another branch w/ the same root does, the automation keeps track of this and#include
's it for both branches.