Hacker News new | ask | show | jobs
by mumblemumble 623 days ago
It's important to accept that you will screw it up. Repeatedly. Interfaces have to be designed before you can start using them, which means that you will never have less information about how a module will be used than you do when you design its interface.

The best defense against this that I've found is to ensure, as much as possible, that interfaces can be replaced. The single responsibility and interface segregation principles can help here. Using small, focused interfaces and letting modules implement more than one of them makes it easier to use the strangler pattern to replace interfaces that no longer work well with new and improved ones.

Also avoid temporal coupling as much as is feasible. Unnecessary statefulness is the easiest way to make this sort of thing harder than it needs to be.

1 comments

Mr Akin's gotchu, fam:

> 2. . To design a spacecraft right takes an infinite amount of effort. This is why it's a good idea to design them to operate when some things are wrong .

> 3. Design is an iterative process. The necessary number of iterations is one more than the number you have currently done. This is true at any point in time.

> 4. Your best design efforts will inevitably wind up being useless in the final design. Learn to live with the disappointment.

Also 9 10, 11, 12, 13, 14 and a bunch of the others apply too.