June 2025
Intermediate to advanced
1093 pages
33h 24m
English
If you don't let your program slide into chaos, it will be easier to maintain and service in the long term. Think about where useful “interfaces” between the program parts are at the beginning or when making extensions, and don't burden your readers with this later.
Limit the number of lines per function. If a function grows beyond this, split it up at that moment and turn it into calls to subfunctions. A common convention is to set a limit of between 20 and 100 lines. My personal rule of thumb is that a function should still fit on the screen.
The same applies to program files (mainly *.cpp files). If a file grows too much, divide it into sensible subparts. However, do not split it up arbitrarily. If you are ...
Read now
Unlock full access