DEV Community

Discussion on: 10 Best Practices for Ruby Programmers: Tips for Efficient, Maintainable, and Bug-Free Code

Collapse
 
nwarwick profile image
Nicholas Warwick

Great post @daviducolo!

  1. Use meaningful comments: Comments can help others (and yourself) understand your code better. Make sure your comments are descriptive and to the point.

I remember hearing a good point about comments. It is that comments should never explain what code is doing they should only explain why it's there. Your code should be self-descriptive enough for someone to be able to read it and understand what it's doing, the only thing they may need help understanding is why it's there, the domain purpose etc.