2 ms·
All programmers make mistakes. I think the mark of good software design is using practices that make it impossible or much more difficult to make the mistakes t
by danpalmer 9y ago
All programmers make mistakes. I think the mark of good software design is using practices that make it impossible or much more difficult to make the mistakes that we know are going to be made at some point.
Much of our code review is not about "is this code correct" - that's obviously important, but rather "will this be easy to review changes to in the future" or "if I came back here in a year, would I get it wrong". I think that's just as valuable.
There's always a trade-off with complexity, and I'm not sure whether this one pays off, but designing _for_ programming errors is important for any team/company/product that is growing, and will introduce new developers who weren't around when the decisions were made.
- Chyzwar 9y agoI would reject PR that introduce code like this. I disagree with the article. You should not introduce "safeguards" as described in the article. In few years time, someone will make bug assuming that users id starts from 1. Instead, you can write this as (js): banSendersOfMessages(messages) { messages .forEach(({senders}) => senders.forEach(banAccount)); } In the ruby community, there is the principle of least surprise. Your design you should not introduce astonishing things.