Kent Beck’s Rules of Simple Design, #4

The code must minimize the number of classes and methods.

YAGNI: You Aren’t Going to Need It. Don’t add features that weren’t explicitly requested. Write the code that satisfies the tests, and then stop.

Don’t overengineer solutions. Avoid having a complex network of a dozen microservices when one service can get the job done.

If you can remove code without violating the other rules, you should. While keeping the number of methods to a minimum, do not break the prior rules. You must still keep things dry, express intent, and pass all of the tests.

Deleted code has fewer bugs. If it doesn’t belong, get rid of it. Otherwise, someone will try to use it later.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: