• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Language options: Objective-C, Swift, C or C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Language options: Objective-C, Swift, C or C++?


  • Subject: Re: Language options: Objective-C, Swift, C or C++?
  • From: "Gary L. Wade" <email@hidden>
  • Date: Sat, 13 Jun 2015 18:20:10 -0700

To answer your question, Swift adds an expressiveness for nullability to APIs, more type expressiveness on collection constituents, a better pattern for if/else if/else if/.../else for object-equality testing that mirrors C switch/case, less conversion needed between analogous C types and Cocoa-related types, and with Swift 2, a compiler-supported, single-runtime-coded method to deal with unsupported APIs on older OSes. There are others, by the way.

All of these things can be done with Objective-C and lots of C-based code, but those require comments, extra code, and an understanding on the part of the developer to remember certain patterns whereas with Swift, the compiler enforces these.

One can write object-oriented code that mirrors the functionality of C++ by using structures, function pointers, and multiple synchronized arrays, but when you have a means to do all that for you, you're free to move on to developing what you really want rather than working on the plumbing all the time. Of course, compiler developers must think of these things, but the vast majority of us aren't them.

Disclaimer: I've not jumped onto the Swift bandwagon yet due to a variety of reasons, but I will soon.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Jun 13, 2015, at 4:42 PM, Carl Hoefs <email@hidden> wrote:
>
> Bingo. Even after reading all the posts in this thread, I still don’t know what problem Swift addresses, and no one seems to be able to answer that question — not even Apple in its marketing hype.

_______________________________________________

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


  • Follow-Ups:
    • Re: Language options: Objective-C, Swift, C or C++?
      • From: Quincey Morris <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>)

  • Prev by Date: Re: Language options: Objective-C, Swift, C or C++?
  • Next by Date: Re: Language options: Objective-C, Swift, C or C++?
  • Previous by thread: Re: Language options: Objective-C, Swift, C or C++?
  • Next by thread: Re: Language options: Objective-C, Swift, C or C++?
  • Index(es):
    • Date
    • Thread