difference between swift & Objective-C?

Discussion in 'iOS Programming' started by shoaibbarki, Jun 3, 2014.

  1. shoaibbarki macrumors newbie

    Mar 20, 2014
    what is main difference between Swift & Objective-C...
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Swift looks like this:

    Objective-C looks like this:

    Each of those articles contains links to other references and tutorials on each language.

    The Swift article links to the free ebook that is the only current reference document for Swift. So if you want to see more of what Swift looks like, get that ebook.

    To see more of what Objective-C looks like, search for any Objective-C tutorial. There's not much point in repeating those here, since it's so easy to find them.
  3. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Swift is type-safe, which means the compiler is able to warn you about mismatching arguments far better than Obj-C was able to.

    Also, Swift has pattern matching which makes it useful for switch-cases. I sense that Racket was a major influence on Swift, and DrRacket on Xcode 6.
  4. thedon1 macrumors 6502

    Jun 26, 2010
    Do you guys think any skills will be lost by becoming a programmer who focuses on Swift over Objective C?

    I'm guessing that the whole approach to problems solving and programming practices will can still be learnt and applied, it's just easier to write the code? Does that sound right?
  5. crossi81 macrumors member

    Aug 13, 2012
    Of course it sounds right, the syntax of a programming language has (almost) nothing to do with programming practices. If you use a language with a higher level of abstraction, it doesn't mean you are less skilled. At the opposite, it lessens the burden of debugging in many cases.

    For instance: I can ignore how to do a division in assembly, but I still know what a division is and when/where to use it and for what purpose, even if I use the / operator with a high level language.

    Another example: ARC didn't make programmers less skilled (as long as they are aware of how memory allocation works behind the scenes).
  6. thedon1 macrumors 6502

    Jun 26, 2010
    OK, I just asked because of some initial reaction pieces which were comparing this to the introduction of C# and claimed that this lead to a great deluge of apps into the app store due to the increased accessibility.

    I always thought that an "easier" programming language doesn't make you a "better" programmer or problem solver, but maybe a more efficient or expressive one.

Share This Page