3 ms·
“because they made more abstractions than they need” If you replace protocol by trait, class, function, macro (basically anything that was invented to allow ab
by Someone 5y ago
“because they made more abstractions than they need”
If you replace protocol by trait, class, function, macro (basically anything that was invented to allow abstraction), the statement remains true, So I don’t think that’s a good argument against protocol-oriented programming.
- 3grdlurker 5y agoIf you’re not using protocols almost everywhere though, is your code really protocol-oriented? I don’t even want to bother with answering that question, though. Even Apple didn’t have a clear definition for it, so debating this point seems moot to me, I’m afraid.
- jolux 5y agoRust pretty much only has protocols, and people seem to do fine programming with it. Type classes (protocols, traits) and regular classes are both different ways of achieving polymorphism, which every abstraction needs. It’s just a question of whether you think about your application as oriented around types or oriented around objects.