[swift-evolution] A concern

Florent Bruneau florent.bruneau at intersec.com
Sun Feb 19 11:20:16 CST 2017


Hi,

Objective-C is a superset of C, the C11 standard is 683-pages long (OK, I'm talking about specification, not "user" guide). Everything that is part of C is part of Objective-C and might hurt the productivity of the developer at the worst moment: a sequence point breakage hidden in a macro, an integer overflow that get "optimized away", a strict aliasing breakage that produces surprising code... all those kinds of issues happen in real code when working with C and Objective-C. So, when you read the few pages of "getting started with" Objective-C you don't really know the language, you know the high-level principles.

Swift is much less surprising because of its focus not to have undefined behaviors: everything is well specified and just this makes the language much simpler to *really* master. There are some hard parts (memory management is still present and far from trivial. You need decades of programming to be a C / Objective-C expert, Swift is only 3 years old (in the wild), and I would suspect there is already a sensible amount of "experts" who understand the language.

I'm on the list since the beginning of the year, and what I see here is a list of proposals that tend to focus on making the language even more consistent and less surprising (access level consistency, better Int API, better String API, better enums, ...). That are rare cases where we are discussing new features of the language (like the ownership manifesto published at the end of the week), but this come to cover shortcomings of the languages (trade-offs that were made to have a language published earlier, but with a reduced feature set): in my point of view the lack of ownership, the lack of concurrency support, ... are shortcomings of the language that make working with Swift more surprising and that cause the need of "expert" developers when a full-featured consistent language may only require a "mid-level" programmer.

That said, whatever the language you chose, there will always be code written by "experts" who think it is important to write complex code to solve simple problems and that will not be accessible to beginners. I think having generics in a language is one of the key enablers of this kind of behavior: it becomes so easy to write meta-code. But at the same time, I will never consider generics bloat the language, because when well use they enable so many elegant use cases.

> Le 19 févr. 2017 à 10:00, Rien via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> Hello All,
> 
> Its Sunday, time for some reflection...
> 
> One of the big plusses of Objective-C was that the entire manual was just a few pages long. I have not looked it up, but IIRC the entire manual describing the language was probably less than 50 pages. Much less if you subtract the filler stuff.
> 
> Now, Objective-C is -arguably- not a very ‘nice’ or aesthetically pleasing language.

> Swift is a huge improvement aesthetically speaking. But at the cost of a much larger user manual. Right of the bat it was clear to me that in Swift some of the learning curve from the framework (Cocoa) was shifted into language (Swift). I.e. Swift seemed specifically targeted to the idioms we used in Objective-C/Cocoa. It was one of the reasons that I took to Swift immediately.
> 
> Now that we have Swift 3, many of the original shortcomings have been filled. A few remain, but imo not very many.
> 
> That brings me to my concern: Swift seems to be on course to become a behemoth of a language. 
> 
> I am absolutely convinced that everybody on this list has the best of intentions. We all want the very best tool available. We want Swift to become a shiny many facetted jewel among the languages.
> 
> But in doing so we might -inadvertently- make Swift into a behemoth that can do everything ... if you know how!
> 
> In my opinion Swift is on course to become a very complex language where one needs guru status to be a mid level programmer. Beginning programmers will stand no chance whatsoever to maintain an app developed by an expert. (A bit like C++, another extremely powerful language - that seems to have been abandoned.)
> 
> I have been on this list now for a few weeks, and I see very little push-back on new suggestions. Most of the reactions are positive-constructive. IMO we need more push-back. Without it behemoth status is all but guaranteed.
> 
> I don’t know about the core team, I don’t know about Apple, I don’t know where they want to go.
> 
> I just want to make a plea here: Please stop Swift from becoming a behemoth.
> 
> I don’t know if the millions (?) of Swift developers not on this list agree with me. I somehow think they do, after all they are not on this list! They are not looking to change Swift...
> 
> Well, I just had to get that off my chest...
> 
> To close this off, I do want to take this opportunity to thank the core team for their work, I truly appreciate it!
> And whatever may come, here is one happy Swift user!
> 
> Best regards,
> Rien
> 
> Site: http://balancingrock.nl
> Blog: http://swiftrien.blogspot.com
> Github: http://github.com/Balancingrock
> Project: http://swiftfire.nl
> 
> 
> 
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list