4 ms·
Agreed. This mindset has turned parts of the rust ecosystem into a mess. It's frustrating coming across a generic function argument, for example. Like, what goe
by the__alchemist 4y ago
Agreed. This mindset has turned parts of the rust ecosystem into a mess. It's frustrating coming across a generic function argument, for example. Like, what goes there? Instead of a primitive type, or a struct/enum with its own documentation in a provided link, you find a dead end.
Interfaces are nice when used appropriately, but the added complexity by default isn't worth it.
- jchw 4y agoI think it’s pretty much necessary in Rust to allow things to interop with low overhead, which is an explicit goal of most Rust code. That said, this article is not talking about interfaces as in Rust traits or Go interfaces necessarily but more the general concept. You can see that more evidently by the way that they point out that they don’t necessarily mean to imply that people should be writing entire plugin systems. What’s going on with Rust traits is much, much more granular than what they seem to be discussing.
- User23 4y agoHaving everything behind an interface is pretty much essential for strict TDD in pure Java 8 (I don't know if or how things have changed for later releases). Of course there are a plethora of mock frameworks that will hide the details, but I'm fairly certain under the hood it's dynamically creating an interface. My inclination is to prefer making that explicit rather than relying on magic.
- tcfhgj 4y agoWhat goes there? Anything that meets the specified requirements of that type