Software Engineering
c++ programming-practices debugging time-management technical-debt
Updated Tue, 05 Jul 2022 08:37:44 GMT

Writing Large Portions Of Code Then Debugging?


Lately I have been writing a game engine, and I have been writing a lot of "foundation stuff" (standard interfaces, modules, a message system ect.), but I have noticed a pattern, a lot of the stuff is interdependent and I can not debug until everything is done, hence I do not debug for about 3 to 5 hours at a time. I am wondering if this is an acceptable practice for this part of the project, and if not, if anyone can give me some advice?

-----Update-----:

I downloaded some code metrics tools, and my programs cyclomatic complexity is 1.52 which as I understand it is good, and should correlate to high cohesion, if I am wrong please correct me/




Solution

This is called coupling. You can reduce coupling by breaking everything into smaller pieces, which should increase the cohesion of each piece. It will make it easier and faster to develop and test each piece.

If you are developing something with dependencies on other pieces, try designing with Dependency Injection in mind. This should let you develop each piece individually, without needing to create all of its dependencies first.





Comments (2)

  • +0 – Thanks! I was a tad worried about the cohesion of my engine, but I did not know how to deal with it. — Jun 25, 2013 at 17:24  
  • +2 – Unit testing, especially with TDD, can help with the coupling and allow you to test much more rapidly. — Jun 25, 2013 at 20:05