Large projects are cunfusing

Started by
25 comments, last by Dwiel 19 years, 6 months ago
Thanks guys, but unfortunately, I cannot create folders in vc++6(unless I can, but don't know how).

Quote:
Quote:
Am I crazy?!

Do you want to be?


I don't know.. at least I don't think I know, or do I?
Advertisement
Quote:Original post by squicklid
Thanks guys, but unfortunately, I cannot create folders in vc++6(unless I can, but don't know how).

You can. Consult the documentation.
Under the belt jab....dunno what your naming convention is but this is a compelling reason not to use CClassname. ;)

Seriously, split your project into multiple projects if you have to and link them statically or dynamically. Fifteen classes isn't that much, either. I have around sixty classes or so in fourteen projects, I'm not terribly crazy...yet.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis

I have to agree with the other people. Good organization is the Key. 15 classes is nothing. The last professional game project I worked on had between 1200 and 1500 classes.
On the left hand side of VC6 when you open it up you should see the workspace. If you don't you can open it by going to the "View" then "Workspace" menu's. You'll notice at the bottom of that pannel there are two tabs - one should be "Class View" and the other "File View". If you click on the file view you get the list of all the files currently in your project. By default its slip into source and header files. If you right click on the project (ie. the 2nd item from the top, just below "Workspace") then the context menu will show up with a "New Folder" item and you should be away. Right click on a directory to add new items or simply drage them from other directories if they're already in the project. You can create directories inside other directories as well so I have my current project with:

Engine Directory
- main source
- main headers
- helper
Game Directory
- game source
- game headers

This makes it much easier to find things as you've got your own little directory tree right there. Note this has nothing todo with whats stored on your HD - your only arranging your files within the project so on your hard disk they'll still be where ever they were!

You'll get used to working with lots of files/code though, just takes a little practise. Thats also why people recommend commenting because once you hit a certain size its impossible to remember everything you've done.
One thing which also helps: learn to write short code:)
I am personally very much against having a source and header dir. Usually you want to work with both the header and source at the same time having the in one dir will save you a lot of scrolling.

Main
|-Engine
|-Objects
|- etc etc

At least that is my oppinion :)
Quote:Original post by squicklid
Thats part of the problem. Theres too many files. If I have one header and one source file for every major class, then thats 30 files.


You think 30 files is a lot? Our code here is 764,533 lines long and consists of 993 source files

[Edited by - badmoon on October 19, 2004 8:04:42 AM]
Quote:Original post by WonderWorld
I am personally very much against having a source and header dir. Usually you want to work with both the header and source at the same time having the in one dir will save you a lot of scrolling.

Main
|-Engine
|-Objects
|- etc etc

At least that is my oppinion :)

That isn't a good idea in C++ since in larger projects the compiler and link time becomes a factor in how quickly you an actually develop. It is such an important issue that idioms like pImpls have been created to work around this concern. You should design a class interface that will be illiquid and specify it in the header file and then implement it in the cpp file.

If you don't like only having one file open at once, you might like to try this in vim:
:edit blah.h
:edit blah.cpp
:vsplit

Everyone uses vim for editing C++, right? :)
Find a way to search in all your code files at once (grep / MSVC "find in files"). Also learn about regexps and get used to search using them.

This topic is closed to new replies.

Advertisement