[swift-evolution] [Review] SE-0169: Improve Interaction Between private Declarations and Extensions
2th at gmx.de
Mon Apr 17 02:39:21 CDT 2017
>> And it's a style that is so widely used by the Swift community that even if you think it's a bad practice does not change the fact that many people use that style and that the current access level rules don't play well with them.
> Just because it’s widely used doesn’t mean it’s a good idea. Remember, Swift is still very young. SOLID and other “old school" OOP principles are way older and proven to work at this point. For example, as an iOS contractor, I very, very often see extensions used for “code organization” of massive view controllers. It’s easy to do and looks pretty. But that’s just putting lipstick on a pig. Of course, this is just anecdotal evidence and a personal opinion. By no means I’m saying I’m right. Just sharing my view and voting. I may be wrong of course, especially among very smart people that are here.
I share your concerns: There is no proof that using extensions to group protocol-methods has any benefit, and there is no proof for the contrary.
Looking at the status quo, we see encouragement for this practice from the creators of Swift, which is merely copied by authors of styleguides and finally consumed by the "average coder".
So, is it that surprising that many people adopt that concept?
SE-0169 is based on little more that than a gut feeling how code should be organised — and even the smartest minds can't always trust their intuition (I hope they won't disagree with this claim ;-).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution