Re: Language options: Objective-C, Swift, C or C++?
Re: Language options: Objective-C, Swift, C or C++?
- Subject: Re: Language options: Objective-C, Swift, C or C++?
- From: Carl Hoefs <email@hidden>
- Date: Sat, 13 Jun 2015 19:06:28 -0700
Thanks for the informative listing. So Swift offers refinements (not a paradigm shift like object orientation over functional), many of which could be added to ObjC, and many of which I wouldn’t want. I guess I was trying to find the main, overwhelming purpose driving the adoption of Swift. I think I was looking too high.
> On Jun 13, 2015, at 6:48 PM, Quincey Morris <email@hidden> wrote:
>
> On Jun 13, 2015, at 18:20 , Gary L. Wade <email@hidden <mailto:email@hidden>> wrote:
>>
>> To answer your question, Swift adds […]
>
> To get more specific, I just made a quick pass through the Swift documentation, and came up with the following list of things where Swift adds useful functionality and/or features that we’ve been asking for for a long time:
>
>> Massive elimination of source duplication
>> Massive elimination of source boilerplate
>> Value types as a programming paradigm
>> Range operators (...)
>> Grapheme-based Unicode strings
>> Value-type strings
>> Value-type collections
>> Homogenous collection types (Obj-C has it now, more or less, but only because of Swift)
>> Non-integer, non-literal switch case types
>> Patterns in switch cases
>> Explicit fall-through control of switch case types
>> Switch case “protected scopes” eliminated
>> Patterns in conditional cases
>> Where clauses
>> Label-targeted continue/break statements
>> SDK API availability checking
>> Overloadable functions
>> Multiple function return values
>> Parameter keywords in function calls
>> Default parameter values
>> Nested function declarations
>> Closure expression syntax improvements
>> Operator definitions
>> Operator functions
>> Enums are not ints
>> Enum cases can have associated values
>> Structs can have behavior (methods)
>> Deterministic rules for initializer methods (calling and inheritance)
>> Lazy stored properties
>> Property observers
>> Class properties
>> Mutability controls
>> Improved access controls
>> Safe method overridability
>> Override prevention
>> Enhanced initializer behavior and syntax
>> Automatic zombie detection
>> Capture lists for closures
>> Optionals
>> Optional chaining and unwrapping
>> Improved error handling model
>> Scope-exit cleanup actions
>> Safer type casting
>> Nested types
>> Safe class extensions
>> Protocols are types
>> Protocols can have default behavior (methods)
>> Constrained protocols
>> Generics
>
> That list doesn’t include benefits discussed elsewhere.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Roland King <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Quincey Morris <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Graham Cox <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Michael David Crawford <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Carl Hoefs <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: "Gary L. Wade" <email@hidden>) |
| >Re: Language options: Objective-C, Swift, C or C++? (From: Quincey Morris <email@hidden>) |