Hacker News new | ask | show | jobs
by jnbiche 2231 days ago
Oh, my apologies. I read a few paragraphs and it looked like a basic tutorial about Swift protocols and inheritance vs composite, so I stopped. I'll read the whole thing.

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.

1 comments

Yeah, I'm not sure he's right that one technique is clearly better than the other. They're only separated by a transformation to explicit CPS and a doesNotUnderstand: override, but that isn't in itself an argument that the distinction is unimportant.