The Swift language, as expected by its creators, is intended not only to replace Objective-C as a base for developing iOS applications, but also to replace C in all other areas, including IoT. But if Swift were as good as they say, then it would already catch the top of the ratings. But so far this is not so. Therefore, we will not run ahead and for now just try to answer the main question: is Swift really better than Objective-C? To do this, let’s check their main pluses and minuses.

Objective-c

Short description: a language created in the early 80s of the last century, by crossing C with the then popular Smalltalk. Initially, it was perceived as a simple add-in modifying some syntactic constructions, but after NeXT started to take care of the licensing, and then also Apple, Objective-C became one of the most popular languages ​​for developing applications.

Pluses:

  • Dynamic type-checking. In some cases, this can indeed be a key advantage. For example, simplifies the creation of simple programs;
  • Documentation and communities. Over 20 years of successful use of the language have contributed to the emergence of a large number of quality resources and books. Today, anyone who wants to learn Objective-C will easily find the answer to a question on the Internet;
  • Compared to C ++, and many other languages, Objective-C provides the developer with much more flexibility. For example, the relative simplicity of the syntax. Simplicity depends primarily on understanding the algorithms and how the executable machine works.

Minuses:

  • Low readability of the code, which makes it difficult for beginners to learn the language;
  • Dynamic typing assumes the possibility of (skipping) errors even during compilation. In particular, commonplace typos can seriously delay the process.
  • Limited functionality. It is logical for the language created in the last century and received the first changes in the 21st.
  • Not the highest performance, again caused by dynamic typing.

Swift

Short description: in 2014, Apple specialists introduced the world the replacement of the familiar Objective-C. Among main the goals, were increased readability of the code and declared resistance to developer errors. What happened in fact, let’s see.

Pluses:

  • Writing an application requires less code, at least because here is implemented a simplified principle of working with repeated lines and statements;
  • Easy to read. The standard benefit of any modern language;
  • More features than in Objective-C, in particular the ability to manage memory;
  • Full interaction with code written in Objective-C;

Increased security. This we can see in the processing of pointers, in the compiler’s functionality, and in the fact of building optional nil variable for the compilation itself to provide feedback.

Minuses:

 

  • Due to the youth of the language and not translated to Swift OS X and iOS codes, is required at least a minimum knowledge of Objective-C;
  • The compiler generates unnecessary and simply confusing errors that a developer who comes from other languages ​​will find at least unusual

Looking at all the pluses and minuses, the superiority of Swift is beyond doubt. But what does statistics say?

Opinions and statistics

GitHub, which periodically publishes statistics on generated code sources, claims that Swift is already at the very top for today.

On the Quora portal, the supporters of Objective-C will be able to cheer themselves up by reading how much Swift is inferior in performance to other languages.

Most professional developers, answering the question “what language to learn: Swift or Objective-C?”, Confidently answers – both.

Summary

Despite some of the advantages of Objective-C and the tendency of experienced developers to idealize it, Swift at least is separated from the total Apple dominance by the time and painstaking work of the creators on its shortcomings. Indeed, it is quite logical that the language that appeared to the world just a couple of years ago must go through a difficult stage of popular criticism and refinement before catching the triumph. And Objective-C will gradually go down in history, leaving only good memory about itself.