"value":"\n <p>One piece of criteria for whether some software is good is whether it's easy to write automated tests for.<\/p>\n\n<p>I recently worked on a method that was more than 150 lines.<\/p>\n\n<p>It was difficult to understand, had too many responsibilities and didn't use dependency injection.<\/p>\n\n<p>This made it difficult to test.<\/p>\n\n<p>If it was split into several smaller methods or classes, each could be responsible for different aspects and have clear responsibilities.<\/p>\n\n<p>Each new method or class could have its own tests to verify its own functionality works.<\/p>\n\n<p>It would be easy to understand and identify and fix any issues.<\/p>\n\n<p>If dependency injection was used, things can be mocked or changed as needed to make the logic testable.<\/p>\n\n<p>If everything is in one large function, the code isn't testable.<\/p>\n\n<p>Even if it works now, it will be difficult to change in the future.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>One piece of criteria for whether some software is good is whether it's easy to write automated tests for.<\/p>\n\n<p>I recently worked on a method that was more than 150 lines.<\/p>\n\n<p>It was difficult to understand, had too many responsibilities and didn't use dependency injection.<\/p>\n\n<p>This made it difficult to test.<\/p>\n\n<p>If it was split into several smaller methods or classes, each could be responsible for different aspects and have clear responsibilities.<\/p>\n\n<p>Each new method or class could have its own tests to verify its own functionality works.<\/p>\n\n<p>It would be easy to understand and identify and fix any issues.<\/p>\n\n<p>If dependency injection was used, things can be mocked or changed as needed to make the logic testable.<\/p>\n\n<p>If everything is in one large function, the code isn't testable.<\/p>\n\n<p>Even if it works now, it will be difficult to change in the future.<\/p>\n\n ",