Author Topic: Customizable Folder Tree  (Read 6594 times)

Offline Electron

  • Single posting newcomer
  • *
  • Posts: 7
    • Crucible of Stars
Customizable Folder Tree
« on: May 22, 2005, 02:20:58 pm »
I'm new to codeblocks, so perhaps I've missed somethign that's possible, but Codeblocks seems to be missing several one the things I like about Dev-C++'s project file display, though codeblocks is in many ways the superior IDE.
   In Dev-cpp one can add additional folders to organize the project files. These folders need not correspond to the actual directories on the hard drive as the folders in CodeBlocks file display pane do. IMHO it would be very nice if codeblocks had this feature
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Physicus

  • Guest
Re: Customizable Folder Tree
« Reply #1 on: March 02, 2006, 04:39:24 pm »
That's what I am missing in C:B, too. It would be great to even have the possibility to make custom tree folders for the different projects in the workspace. This is only interesting for really huge projects, but I am sure ReactOS (an OpenSource windows NT/2000/XP compatible alternative, still apha, www.reactos.org) developers would really appreciate it, as it consists of hundeds of "projects" and it would be useful to have them sorted in one big workspace. Maybe recursive workspace files would be great, so you could create different workspaces for different parts of the projects and merge them together in a parent workspace.
I am not sure if it would be fast enough to load thousands of files into the tree, but it could be done "on the fly" only if you open a subfolder.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Customizable Folder Tree
« Reply #2 on: March 02, 2006, 05:17:57 pm »
This is a feature which cannot be implemented without a radical change to the way projects are handled. Unluckily, we still have plenty of other problems to handle at the present time (real problems, not gadgets). It is thus unlikely that this will come any time soon.

As a sidenote, I once used this great feature with Dev-CPP back in the old days, and renaming something crashed the application, corrupting a project file with ~250 sources beyond repair.
That's something we may want to avoid... :lol:
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Customizable Folder Tree
« Reply #3 on: March 02, 2006, 09:37:23 pm »
As a sidenote, I once used this great feature with Dev-CPP back in the old days, and renaming something crashed the application, corrupting a project file with ~250 sources beyond repair.
That's something we may want to avoid... :lol:

Yes, but you could do it right, like Xcode and you will have a wonderfully helpfull tool.  It is very easy to make a project which consists of files from all over the place, but is still nice and organized.  Don't knock the feature because someone else did it badly.  After all I bet they didn't unit test it first ;).

ikolev

  • Guest
Re: Customizable Folder Tree
« Reply #4 on: March 03, 2006, 10:49:42 am »
I don't think creating custom folders is such a good idea. Whenever I've used this feature in other IDE's (Visual C++ and Dev-Cpp), I've always used it just to mirror the directory folder structure. I haven't worked on very large scale projects (such as an OS - btw, I really hope ReactOS will achieve its goals one day), but I think that on such projects its even more important to keep project files properly organized into folders (packages). (At such points I like refering to John Lakos' "Large Scale C++ Software Design" - a fundamental book for anyone working on large C++ projects.) So I think C::B's feature to mirror the directory structure in the project tree is just what's needed.

There is however one small improvement that can be done. Source and header files are often pushed a few levels down the hierarchy for some reason. In such cases they appear in the project tree below a few levels of empty folders. Here's an example project structure:

/
/include
/include/MyLib
/include/MyLib/*.h
/src
/src/MyLib
/src/MyLib/*.cpp
/src/Samples
/src/Samples/*.cpp
/proj_cb
/proj_cb/MyLib.cbp
/proj_cb/MyLibTests.cbp
/proj_cb/Samples.cbp

In this case, the MyLibTests project will display this structure:
- src
  - MyLib
    *_t.cpp

If MyLib was larger and had sub-packages, the chain of empty folders at the top would be longer. It would be nice if C::B had an option to skip the top levels in the project tree (in this case src and MyLib) and display the content of first folder which has more than one item (file or sub-folder) in it. Of course, this problem would not exist if .cbp files were kept in the folder of the files they include, instead of a separate common folder. But this approach is prefered on projects which use more than one compiler and have several different sets of project files.

Physicus

  • Guest
Re: Customizable Folder Tree
« Reply #5 on: March 07, 2006, 03:07:21 pm »
I don't think creating custom folders is such a good idea. Whenever I've used this feature in other IDE's (Visual C++ and Dev-Cpp), I've always used it just to mirror the directory folder structure. I haven't worked on very large scale projects (such as an OS - btw, I really hope ReactOS will achieve its goals one day), but I think that on such projects its even more important to keep project files properly organized into folders (packages). (At such points I like refering to John Lakos' "Large Scale C++ Software Design" - a fundamental book for anyone working on large C++ projects.) So I think C::B's feature to mirror the directory structure in the project tree is just what's needed.

I would agree, but the problem, is that the projects / packages cannot be organized in a directory tree structure inside the workspace file. For example let's think of a project with the following tree:
\client
\client\client
\client\updater
\client\config
\client\audio-lib
\server
\server\server
\server\gameeditor
\server\accountmanager
\server\plugins
\server\plugins\AI
\server\plugins\weather
\include

All projects would be stored at base levelinside the workspace, the common include files wouldn't fit in any of the projects, but you could make an additional project, wich does not compile anything. It would be nice, if the projects could also be arranged in the directory tree structure relative to the workspace file. Then you would have all your stuff together in one file.