462 Blog Post 1

Based on the articles I read about clean code from Codacy and Pluralsight, one thing I’d like to start doing more often is writing short functions that only do one thing. This idea is based on the single responsibility principle (SRP), which says that a function should have one purpose and perform it effectively. If a function only has one job, it’s “more understandable, readable, and maintainable.” I’ve been guilty of adding to many responsibilities to a single function so this is something I would like to do a better job of following.

Something I would like to avoid doing is commenting unclearly. Another thing I’ve been guilty of is overcommitting so this is something I’d like to avoid. I would like to be more succinct in my comments and not have paragraph long things that would only take a couple of sentences to describe. I notice some of my comments can sometimes be repetitive or confusing and this is something I would like to avoid in the future.

Print Friendly, PDF & Email

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *