Thread: creating big projects

  1. #1
    Registered User devil@work's Avatar
    Join Date
    Mar 2003
    Posts
    33

    creating big projects

    i never wrote a big project but i am starting now but the problem is how do you wrote your projects i want to have a main menu and sub menus all do diffrent jobs but if i make a one big file and a case statement it is going to be a makaroni code how do you manage a project like that?

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    "if i make a one big file and a case statement it is going to be a makaroni code"

    Only if you poorly code it.

    "how do you manage a project like that?"

    I don't have any experiece doing it for a large project, but I would imagine you would divide things up into functions, all with their own .cpp files and .h files.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    project management is essential. if you need classes, then .h/.cpp will be best. or if you want fxns to be written outside of your main .cpp file, then you can declare them in a .h file and define them in a .cpp file.

    it's up to you and however you see best. design decisions coming into play.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Definitely split the program into separate files. What you split depends on your code. I usually place one class per file, and if there are many functions they are split into separate files depending on their purpose.

    I'm working on a game which itself is nicely structured. I'm also having a level editor for it, but I placed all the code for it in one single file. I never thought it would grow so big. It is currently almost 4000 lines making it very hard to maintain. Don't make my mistake .
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    The menus should be easy to keep "clean".

    Each menu selection can call one function, which may be a sub-menu. Then, that one function can call the other functions as required for the particular choice.

    Here at work, we have programs with a screen-full of choices (maybe 20 options). The menu function is short and separated in it's own file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dynamically creating an array of pointers
    By cs32 in forum C Programming
    Replies: 4
    Last Post: 02-06-2008, 09:42 AM
  2. Handling big numbers in C
    By lala123 in forum C Programming
    Replies: 29
    Last Post: 07-06-2007, 07:49 PM
  3. hints about managing multi-programmers projects
    By BrownB in forum Tech Board
    Replies: 1
    Last Post: 11-09-2006, 09:57 AM
  4. Big O Notation
    By Drew in forum C++ Programming
    Replies: 1
    Last Post: 09-30-2001, 01:22 AM