[swift-evolution] continuations - "extensions on steroids" idea

Jon Gilbert swiftevolution at jongilbert.com
Tue Nov 7 20:25:49 CST 2017


On Nov 3, 2017, at 14:36, Adam Kemp via swift-evolution <swift-evolution at swift.org> wrote:
> 
> If you work with people who can’t follow conventions and would try to extend partial classes from random places then I’m sorry. :)

This seems naive. 

Swift is based on the idea of making it impossible to do things the wrong way, because of Murphy’s Law.

You might get hired to clean up some total crap code that was created in a sweatshop overseas by people who never touched Swift before and only ever wrote in PHP 1.0 before that. I have seen this kind of thing all too often.

Then you have the fact that Swift is used increasingly in school environments, and I sure as heck don’t want some bully kid being able to inject pronz to display on my kid’s viewcontroller just because she wanted to use “parts” or “partials” (or whatever we end up calling it).

Then there are open source projects where all kinds of malicious things could be done with unbounded partiality, and people will hesitate to use this feature without being able to trust its safety.

My point is it’s not always a team of highly trained professional developers working on a project. It could be strangers you will never meet. Someone vindictive or stupid could also do something to deliberately or accidentally break code you worked. And when they blame you, then “those were private methods you used” would no longer be a valid excuse. 

I feel much better declaring the parts as a list, and that way you can command-click on them in XCode to jump to those other parts, and the initializer can make sure that all those parts can be found or else block compilation. 

Just my 0.02.

J


More information about the swift-evolution mailing list