3 ms·
I think the point of these “Falsehoods Programmers Believe” lists is not that we should all write massively complicated code to accommodate each and every edge
by ryandrake 8y ago
I think the point of these “Falsehoods Programmers Believe” lists is not that we should all write massively complicated code to accommodate each and every edge case. The point is we should question the practice of codifying our incorrect assumptions into requirements in the form of needless restrictions and validations.
Is to really necessary for your software to go through the trouble of rejecting names that contain percent signs or emoji? Why is a name over 20 characters invalid? What causes your business to stop working if your customer’s name is 21 characters? Do you really need to distinguish between a persons first and last name? What is the exact business requirement driving this? So much code out there (not to mention end user’s time) is wasted needlessly and artificially dividing user input into “good” and “bad” piles and rejecting the bad.
The wisdom from these “Falsehoods” lists should result in less code, not more code.
- koliber 8y agoIn my experience, the answer to each of those questions is "sometimes yes, sometimes no." Our software does not exist in isolation. If I don't ask you to separate your first name and your last name, and a need comes up to interact with another software (or manual) system that requires the first and last name to be separate, you shift the problem. It will either not be possible to interact with such a system or I will need to make the decision in my system, which is worse than asking you to do it). In a perfect world I would snap my finger and all legacy systems, government forms, and legal requirements would be updated to eliminate some of the more arbitrary (by today's standards) limitations, and would use UTF-8 encoding to boot. In a less perfect world I will choose my battles and sometimes force people whose names don't conform to the more prevalent norms of western society (which is where my clients mostly do business) to compromise. But I will be mindful and hope of a better future.