Comments and explanations - how to do it better? |
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! ***/ |
Welcome Guest, Not a member yet? Register Sign In |