5 ms·
You never come up with the right interface at first because there is no right interfaces. There are better interfaces, but you usually need to encounter more si
by seeknotfind 3y ago
You never come up with the right interface at first because there is no right interfaces. There are better interfaces, but you usually need to encounter more situations to find it. Balancing up front time designing an interface with velocity to test it is a principle problem of software development.
- samstave 3y ago>You never come up with the right interface at first because there is no right interfaces. There are better interfaces, but you usually need to encounter more situations to find it. Balancing up front time designing an interface with velocity to test it is a principle problem of software development. You never come up with the right medicine at first because there is no right medicine. There are better medicines, but you usually need to encounter more outcomes to find it. Balancing up front time designing a medicine with velocity to test it is a principle problem of medicine development. Thank you for your template
- sanderjd 3y agoI think good software interfaces are essentially always extracted from already-working systems, rather than being designed. The tricky part is figuring out when to do that and how to successfully advocate for it.
- lpapez 3y agoAgree with this. Starting with a "well-designed set of interfaces" usually results in half of them being unused having only one implementation and the other half being rewritten because the requirements changed (worst offenders are interfaces which only have one implementation, not even used for mocks in tests, the runner-up being interfaces accepting multiple boolean parameters). On the other hand, finding an opportunity to introduce a common interface to a familiar codebase feels like leaving behind a mental burden. Sounds crazy I know, but introducing order into a chaotic mess is just relaxing to me, especially when I know I will have to maintain it.
- jinay 3y agoI agree that there is no absolute best interface, and a good interface will be battle-tested and motivated by real problems. As with all design, there are certain intuitions you develop over time that are widely applicable. You can eliminate a lot of errors up front that way.
- krm01 3y agoTotally. Frankly, you will never find the perfect interface. It’s an ever evolving process that changes as the market and user behaviors and expectations change.
- formulathree 3y agoThere's another style of programming that has much of the required interfaces predefined in the language itself. A set of universal interfaces that conceptually work universally for all programming. It's mathematical interfaces. Commutativity, Identity, Associativity, Ordinality and more. For these interfaces, it becomes less about "designing" interfaces with gut intuition, guessing and checking... but more about finding the final design via calculation. Math is known to be universal so it makes sense why mathematical interfaces have such wide application. When you use mathematical interfaces and compose everything along those parameters... it's no longer about "you never come up with the right interface at first"... That concept becomes less relevant. It's hard to agree with me when I'm just saying it here. It has to "click" after you tried it with a language that supports this type of programming first class.
- garethrowlands 3y agoQuite so. I’m currently reading Algebra Driven Design by Smart McGuire. It’s a valuable perspective.
- sanderjd 3y agoI have never come across a codebase written in this style that is any good. I think people inclined in this direction usually seem to fail to reify the domain they're working within, preferring to leave everything in terms of the mathematical primitives. This is much harder to work with than systems that have thought through the concrete interfaces useful in their concrete domain. (And sure, implementing those using "mathematical interfaces" is great.)
- formulathree 3y agoI actually somewhat agree. I think there's a gradient here between modularity and useability. The more modular something is, the less user friendly it becomes. The problem the GP is talking about here is a modularity problem right? He designs (aka guesses) the interface and finds out later that his guess was wrong. Mathematical interfaces deal with this problem better. However mathematical interfaces are less user friendly and less intuitive, especially for someone not familiar with mathematical interfaces. The reconciling solution is that the public interface can be very domain specific and made narrow in usage. The logic underneath this public interface can remain mathematical and therefore more amenable to future changes.