Welcome Guest, Not a member yet? Register   Sign In
Comments and explanations - how to do it better?
#9

For large or complex projects it's a good idea to write a specification document detailing the business logic and the database structure. In the code, I try to write comments in a way that any other developer could understand what the code is doing and work on the project. If a function do something special I will explain why it's doing it. Because in 6 months I won't remember. For example, if a function read a CSV file, I will explain the format expected.

Maintaining your comments may be a nightmare if you make a lot of changes in your code but I think it's worth it. If you say you will do it at the end of the project, you will not! You won't have the time or the motivation to do it!
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: Comments and explanations - how to do it better? - by includebeer - 01-13-2016, 07:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB