I've started coding for about a year now and although I knew the importance of commenting, I hadn't taken it as seriously as I should have. I've recently started a big solo project that is slowly turning into a start-up business.
About three weeks deep in code, files everywhere, solving some-what complex problems (with maybe more code than I should be using- but all the perks of being a noob right?) I started to realize something. Every day when I sat down to work adding functionality to the code, more time than needed was spent sifting through previously written code and it was here that I realized, I was not commenting enough.
I could have avoided those headaches caused by having to go back and forth between files to try to recount the train of thought I had at that point in time. Can you imagine how much time I would have saved? How much further in the code I would have been if I had just commented?
It feels good to say that that's old news now. Commenting on my code has helped to increase my efficiency exponentially. I am now able to look through 400+ lines of code and easily know what each block of code does.
You know sometimes when you get that burning solution to a problem and you just want to implement it and move on but, trust me. It is worth taking the time to properly comment on your code especially for bigger projects and in the long run.
Happy Commenting folks!
Top comments (1)
One thing devs tend to overlook is that commenting doesn't just help others out, it helps yourself out - particularly when you're deconstructing something you wrote years ago.
I sometimes find myself commenting too much and having to pull back a bit.