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. General Programming
  3. C / C++ / MFC
  4. How do you structure your code/development environment ?

How do you structure your code/development environment ?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionworkspace
5 Posts 3 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.
  • D Offline
    D Offline
    Defenestration
    wrote on last edited by
    #1

    We all have common modules/classes/includes that we use in various projects, but people structure their code differently. For example, you could: 1) Have folders called Include and Modules, which contain the common code and then add search paths to your development environment so they get picked up. 2) Like (1), but for every project you copy over the includes/modules you require to the project folder (eg. Common\Include, Common\Modules, or just Common), and then use these copies. (1) has the advantage that any fixes/changes made to the includes/modules are immediately propogated to the projects that use them, without the need for any other work. The downside is that one of these fixes/changes may break a project (eg. due to it relying on certain behaviour) (2) has the inverse of the pros and cons of (1). Are there any other ways of working that you use ? Which model do you follow, and why ?

    S J 2 Replies Last reply
    0
    • D Defenestration

      We all have common modules/classes/includes that we use in various projects, but people structure their code differently. For example, you could: 1) Have folders called Include and Modules, which contain the common code and then add search paths to your development environment so they get picked up. 2) Like (1), but for every project you copy over the includes/modules you require to the project folder (eg. Common\Include, Common\Modules, or just Common), and then use these copies. (1) has the advantage that any fixes/changes made to the includes/modules are immediately propogated to the projects that use them, without the need for any other work. The downside is that one of these fixes/changes may break a project (eg. due to it relying on certain behaviour) (2) has the inverse of the pros and cons of (1). Are there any other ways of working that you use ? Which model do you follow, and why ?

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      My opinion is: Don't copy header files - that's evil. Reference them.

      D 1 Reply Last reply
      0
      • S Stuart Dootson

        My opinion is: Don't copy header files - that's evil. Reference them.

        D Offline
        D Offline
        Defenestration
        wrote on last edited by
        #3

        What about modules/classes ?

        S 1 Reply Last reply
        0
        • D Defenestration

          We all have common modules/classes/includes that we use in various projects, but people structure their code differently. For example, you could: 1) Have folders called Include and Modules, which contain the common code and then add search paths to your development environment so they get picked up. 2) Like (1), but for every project you copy over the includes/modules you require to the project folder (eg. Common\Include, Common\Modules, or just Common), and then use these copies. (1) has the advantage that any fixes/changes made to the includes/modules are immediately propogated to the projects that use them, without the need for any other work. The downside is that one of these fixes/changes may break a project (eg. due to it relying on certain behaviour) (2) has the inverse of the pros and cons of (1). Are there any other ways of working that you use ? Which model do you follow, and why ?

          J Offline
          J Offline
          Jijo Raj
          wrote on last edited by
          #4

          I'll go for (1) i.e. refer the common header files rather than making a copy of it and use. Because, as you said, if you copy the files, you could avoid crashes or compilation errors during development. But infact you are not avoid it but simply accumulating. All the compilation errors and crash will popup once you start to integrate will the latest common and you'll be in real trouble in sorting out the bugs. So better refer the common modules and incase of any trouble in latest common source, just get the old version from your version control and work with it until the guys fixes the latest common. :rolleyes: Regards, Jijo.

          _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

          1 Reply Last reply
          0
          • D Defenestration

            What about modules/classes ?

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #5

            I design my projects so that lower-level, possibly common, modules go into separate DLL projects. Architecture's the name of the game...

            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