|
|
|
|
|
by kragen
2243 days ago
|
|
The article doesn't seem to be promoting using the Swift protocol approach to composition — at least, that's not what it uses the "Value-Oriented Programming" name to refer to. Instead, it's saying that instead of using the Swift protocol approach to composition, you should return a complicated value of some concrete data type from your function. |
|
Edit: Yeah, you're right. I read to the end and that's pretty much functional programming as you suggested. I'm not convinced it's always better than using interfaces. Like most things, I think it depends. For example, particularly when programming "in-the-large", I think being able to package up different contexts (like a TestRenderer) into different protocol implementations is often an advantage of that approach, not a weakness, as he seems to imply.