Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 628521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:38:45+00:00 2026-05-13T19:38:45+00:00

Currently, I program in Java and use Maven quite a bit. As so I’ve

  • 0

Currently, I program in Java and use Maven quite a bit. As so I’ve become accustom to the naming schemes and folder structures that I’ve used over the past 4 or 5 years.

As I have recently started to learn C++, I’m realizing that I have no idea where to put all my files. Should I keep everything broken down by namespace, or by what tier it is in? Where, for example, would I keep a series of files devoted to UI, as apposed to files meant to help store data?

Are there any standards for this sort of thing?

Clearly, there is no definitive answer to this question. I’m simply looking for a good guide. I do not want to start learning C++ by spending too much time worrying about how my files are laid out. I’d rather have some good models, and just get to the coding.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:38:46+00:00Added an answer on May 13, 2026 at 7:38 pm

    The following is fairly typical…

    third-party library
      release
        obj
      debug
        obj
      include
      src
        sublib 1
        sublib 2
    
    mylibrary
      release
        obj
      debug
        obj
      include
      src
        sublib 1
        sublib 2
    
    myapp
      release
        obj
      debug
        obj
      subapp 1
      subapp 2
    
    mylittleapp
      release
        obj
      debug
        obj
    

    Basically, subfolders for subprojects is common for larger projects, but mostly a particular project has folders for src, include etc. A folder for each build configuration is common, and keeping the obj files and other intermediates in a subfolder of that is a good idea. It may be tempting to put subproject folders in obj folders, but usually that’s unnecessary – the obj folders don’t need to be well organised, so the only concern is a filename conflict, and the best fix for that is to have unique source filenames within (at least) each project.

    The “include” folders should IMO only contain headers that will be #included by other projects – internal headers belong in the “src” folder.

    Putting UI stuff in a separate folder isn’t a bad idea, if it’s big enough. I’ve seen UI stuff done as a separate static-linked top-level project, and I do mean app-specific here, not (e.g.) wxWidgets. Usually, though, that level of division is sub-project if it’s worth separating at all. How you divide subprojects is more a matter of application-specific blocks in general, so it depends on whether UI stuff is best handled as a separate block or as separate chunks mixed in with task-specific logic.

    Namespaces aren’t the most used language feature, possibly because a lot of people use “using” so much they don’t make much difference. A namespace for a main library project makes sense, but associating subfolders to namespaces 1:1 isn’t something I’ve seen. I personally have a namespace that encompasses most of my library code, with a couple of sub-namespaces for things rarely used in general, but used a lot in a few places (e.g. a “bitwise” namespaces). The sub-namespaces are limited to single source/header pairs, so no need for subfolders. Most of the library-specific selection is done by including the right header – except that I usually include the lot through a main-project top-level header anyway.

    Basically, namespaces are a way of avoiding naming conflicts. They don’t necessarily associate with abstractions or functional blocks or anything. Within a particular project, you’re probably better off just making sure the names don’t conflict. As with the “std” namespace, it’s fine to put a lot of stuff in one namespace.

    As you say, though, this isn’t a definitive answer – there are of course minor variations and quite different approaches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing a program in Java that I would like to use to
I'm currently writing a java program that requires some Data to run. The data
I'm currently writing a Java program that can open .exe programs on my PC,
I currently face the following problem: I have written a Java program that parses
I'm currently working with Java to write a program that does an EAI between
I currently make Java (eclipse) applications for PC use. Everything from basic standalone programs,
I'm am currently working on a program in java which requires adding a small
I'm currently working on a client/server based Java-program for a customer. I googled a
I'm currently parallelizing program using openmp on a 4-core phenom2. However I noticed that
I am currently writing a program using Weka that builds a model (using one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.