Objective-C or Swift?

in swift •  6 years ago 

Objective-C vs Swift

These days, Objective-C has fewer updates, most of which are for compatibility with Swift (e.g. easy import to the Swift code). Swift was created as an interoperable language, so it is completely compatible with Objective-C. It means it is possible to combine these languages in a project.

Programming in Objective-C will not become obsolete any time soon because, thanks to its 20 years of existence, it has a large code base, number of apps maintained, and third-party framework with Objective-C at its core. These solutions and libraries are unlikely to be rebuilt from scratch with a new language. This is the only reason why Objective-C is better than Swift to some extent.

Recommendation for When To Use Objective-C

There are two options where it could be still preferable to use Objective-C:

1- If an app has already been written in Objective-C and has a huge code base (100,000+ code lines)

The most logical recommendation for using Objective-С is if the project is highly dependent on this language or the application has already been written in Objective-C and is functioning.

2- If you are developing a framework use Objective-C

So far, Swift is not ABI (Application Binary Interface) stable, which corresponds to the correct communication among all the elements within machinery code. ABI needs to be stable if a binary code has been compiled with different versions of the language.

3- If C or C++ third-party frameworks are used extensively

Usually, it is a rare situation, but if these frameworks are required, it is recommended that you use Objective- C, as it is a subset of C and therefore worth considering.

Swift Use Cases

swift for ios

LinkedIn, a social network for professionals moved from Objective-C to Swift in their native app development. The bottom line was that Swift was the better choice for smaller and start-up projects, as was easier to work with.

Another company, Lyft, an on-demand transportation company, uses Swift for its native iOS app development.

Other well-known apps like Yahoo Weather, Clear, Hipmunk, WordPress and Firefox iOS apps are also using Swift.

Objective-C, when compared to Swift, is a more outdated language and lacks modern tools and properties. Swift has many updates and ongoing growth plans, and the language receives great support from Apple. It is an easy-to-learn, secure, modern, and interactive programming language. Swift has simplified coding patterns as well as coding interface vs Objective-C.

You can get full information with a detailed Swift vs Objective-C comparison here.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!