Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Fueled by Decaff's Great Idea

Fueled by Decaff's Great Idea

Scheduled Pinned Locked Moved The Lounge
csscomlinuxhelp
12 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BernardIE5317
    wrote on last edited by
    #1

    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.

    M Greg UtasG P 3 Replies Last reply
    0
    • B BernardIE5317

      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.

      M Offline
      M Offline
      MarkTJohnson
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • B BernardIE5317

        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.

        Greg UtasG Offline
        Greg UtasG Offline
        Greg Utas
        wrote on last edited by
        #3

        1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves, #includes 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.

        <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
        <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

        Richard Andrew x64R B 2 Replies Last reply
        0
        • Greg UtasG Greg Utas

          1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves, #includes 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.

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • B BernardIE5317

            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.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            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.

            B 1 Reply Last reply
            0
            • P PIEBALDconsult

              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.

              B Offline
              B Offline
              BernardIE5317
              wrote on last edited by
              #6

              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.

              P 1 Reply Last reply
              0
              • B BernardIE5317

                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.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #7

                Well, right, definitely not AWK.

                B 1 Reply Last reply
                0
                • P PIEBALDconsult

                  Well, right, definitely not AWK.

                  B Offline
                  B Offline
                  BernardIE5317
                  wrote on last edited by
                  #8

                  May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.

                  H P 2 Replies Last reply
                  0
                  • B BernardIE5317

                    May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • B BernardIE5317

                      May I please inquire why not awk. It is the only text processing language I know. Would you recommend another.

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      C# of course. I don't use UNIX.

                      B 1 Reply Last reply
                      0
                      • P PIEBALDconsult

                        C# of course. I don't use UNIX.

                        B Offline
                        B Offline
                        BernardIE5317
                        wrote on last edited by
                        #11

                        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 Reply Last reply
                        0
                        • Greg UtasG Greg Utas

                          1. I have about 400 headers, and there are much larger projects than that. Want to start? 2. As software evolves, #includes 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.

                          B Offline
                          B Offline
                          BernardIE5317
                          wrote on last edited by
                          #12

                          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.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups