Agile – Good Practices for development team in large projects

agilecmodulesprojectteamwork

Since I started learning C a few years ago, I have never been a part of a team that worked on a project. I am very interested to know what are the best practices for writing large projects in C.

One of the things I want to know, is when (not how) do I split my project into different source files? My previous experience is with writing a header-source duo (the functions defined in the header are written in the source).

I want to know what are the best practices for splitting a project, and some pointers on important things when writing a project as part of a team?

Best Answer

This is how I code in C(be it solo or in a group):

step 1. Understand the project
step 2. break the project into modules(each module has a separate folder)
step 3. break the modules into sub-modules(each sub-module is a .c/.h file pair)
step 4. write a manually desined "make" script. This step sounds ridiculous but it helps. Trust me.
step 5. learn to use a version control system
step 6. test-modify-debug-release. Release early and release often
step 7. think of improvements to the existing code
step 8. go back to the drawing board. 

For example(very crude, off the top of my head example):

You're designing an elevator simulation program. 
STEP1: Understand. [we got floors, floors can have people, people press buttons.. etc]
MODULES: 
      AI-Module[double-elevator single switch requires AI algos to decide which request is going to be addressed first and which elevator will service the request, depending upon the current position of both elevators]
     Interior-Electronics Module[To handle inter-elevator requests]
     Exterior-Electronics Module[To handle external-elevator requests]
     Human-Simulator Module[To simulate humans inside/outside the elevator(required to check overload)]

SUB_MODULES:
     AI-Module/ai.c, AI-Module/ai.h, AI-Module/decision_engine.c, AI-MODULE/decision_engine.h
     Interior-Electronics/press_button.c,Interior-Electronics/press_button.h, Interior-Electronics/delegates.c, Interior-Electronics/delegates.h
     Exterior-Electronics/press_button.c,Exterior-Electronics/press_button.h, Exterior-Electronics/delegates.c, Exterior-Electronics/delegates.h
     Human-Simulator/human_sim.c, Human-Simulator/human_sim.h
     ./manager.c ./manager.h ./main.c

And the steps follow :-)

Related Topic