Hacker News new | past | comments | ask | show | jobs | submit login

I'm consistently shocked by the number of people who have never heard of this principle. Introducing arbitrary numerical limits (emphasis on _arbitrary_, as performance limitations or other actual requirements obviously trump this rule) is a design decision that I find myself having to clean up after frequently.

I see a lot of people here questioning the wisdom of the rule, however, like every other principle used in SWE, it shouldn't be applied blindly. Ask yourself "why am I specifying that a maximum of five wangervanes can be specified in the turboencabulator settings?" _IF_ you have a good reason, fine. Most of the time you will not.




Limits are good. Limits mean that you can test your software under both min and max conditions.

If there’s no hard limit, then the limit exists merely in the developer’s mind as what they consider sensible or not.

Inevitably there will be some user who takes your software past what the developer considered sensible. And unknowingly and silently, this user becomes a tester in production.

The real problem is not DRYing your limits. There should always be one central point of truth, one constant that determines what the limit is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: