3 ms·
Programming virtue of the day - explicit is better than implicit.
by whalesalad 6y ago
Programming virtue of the day - explicit is better than implicit.
- jfengel 6y agoThis principle can conflict with Don't Repeat Yourself. If you can infer something from existing values, you're often better off than making it explicit and redundant. In this case we seem to be talking about a heuristic for estimating weight, and heuristics are kind of a weird middle ground on that score. If all you need is an approximate value and can compensate for errors, it's reasonable to use a properly-designed heuristic rather than an explicit value. That said, a lot about this story smells weird. They already had an explicit value in the age field, and this particular heuristic is completely useless for male passengers. So it's less about proper programming practice than the fact that somebody is just plain doing something stupid. So stupid that I'm not sure we're actually getting the story correct.