DEV Community

Discussion on: Is Commenting Code that necessary?

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

As always, there is an exception: regular expressions.

Of course, we could write 20+ lines of code to replace a 1-line regex and make it more readable, but sometimes a regex really is the best fit for a problem. The downside is that they tend to be as legible as ancient Egyptian hieroglyphics. So those I comment what they do.