Comments on Coding with Clarity

6 Reader Comments

Back to the Article
  1. Excellent read! All the analogies and real-world code examples are super helpful.

    Copy & paste the code below to embed this comment.
  2. Hi Brandon

    Very good article. I am going to disagree with your example in loose coupling though. With your example, while it is loosely coupled it has made the function harder to document, harder to use and harder to test.

    As there are no longer any clearly defined parameters, the documentation has to cover all options which are possible and no longer covered in the method signature.

    If those signatures exist, your IDE is going to help you know what it is you need to pass to it. And you can set the default values there as well.

    Additionally, the possible paths through the code increases, making unit testing harder. 

    A better example would have been dependency injection, which is almost the same as yours but without the disadvantages I’ve outlined above.

    Does that make sense?

    Copy & paste the code below to embed this comment.
  3. I enjoyed the article and, although I’m fairly new to javascript, I use those guidelines in other programming languages.

    What compelled me to comment is that I made the mistake of following the link to 27B/6 and have now spent quite a while there just cracking up.

    So, thanks for the js code and thanks for adding some humor to my day.

    Copy & paste the code below to embed this comment.
  4. Excellent article!
    It is always good to learn good practices to program. Thank you!!

    Copy & paste the code below to embed this comment.