If exploring code of the lovely legacy long-developing Rails monolith you faced some dummy comments like this:
You are very welcome to share your feelings below 💔.
There are many discussions of formatting and documenting the code-base. But do we need comments writing with Ruby - such a beautiful and expressive language?
Imaging myself as an author, and being honest with myself, I consider some pessimistic reasons for writing such kind of unclear comments 😊:
I understand the high complexity my code, looking forward to my "readers" I try to send them a hint. But am I sure my readers clearly understand my current "context"? 💭
I understand the ugliness of my code. Do I try to fence off myself for this coding style?💩
I understand the presence of technical debt here and have no time to fix it right now. I say myself that I probably will fix it in the future. Do I believe in my fading hope? 😥
And what do I have to do, for now having a lot of places where I understand I have an issue?
- Refactor: give me a year of my life? I will dive back to my codebase and do my best to fix everything! But why am I sure I would end up with the same 💩?
- Cut those comments off: as I understand I am unable to fix, I drop off all the comments and keep calm next time browsing the code. But does hiding all the problems mean the same as having no issues? 😄
But here is another option I finally came to is to take care of your codebase every day by small steps and improvements. Doing something healthy for the project meanwhile you develop some features, such as small refactoring or getting deep into how it works and implement minor improvement and purify the code.
It is a hard job, and it won't return fast. It's the way to share my love with my project 💕. The only one way. The sane way 🧓.
Share your comments. Thanks for reading!