What is Objective-C?
Objective-C is a general purpose programming language used in iOS and OS X operating systems and APIs. It’s a superset of the C programming language and can call C++ code. Programmers describe the language as a cross between C and Smalltalk, from which it derives its object-oriented capabilities. Though Objective-C is one of the earliest programming languages, it can still be useful. It’s still needed when working before iOS 7+, Mac OS 10.9+, and in all versions of tvOS and watchOS. In Objective-C categories offer the ability to add functionality to an object without changing the actual object. Programmers can define new methods and add them to classes for which the source code isn’t available. Rather than calling methods, Objective-C uses message passing. It interacts with objects by sending messages. The object then has options for how to interpret the message. For example, it can invoke a method that matches the message, broadcast the message to a group of objects, forward it to a single object, or introspect it & apply custom logic. Messages are implemented at runtime and don’t throw runtime errors when they go unexecuted. Memory management is reasonably simple, with limited options for how to accomplish it. Objective-C is entirely geared towards simplicity, in fact. There are no templates, multiple inheritance, or other features which lead to complexity.Benefits of Objective-C
Simplicity
Objective-C is small, direct, and easy to learn.Dynamic typing
There’s also support for static typing when desired.Intuitive message syntax
Message patterns read much like spoken sentences interspersed with colons.Automatic garbage collection
This is optional; programmers can use a reference counting system if they prefer.Limitations of Objective-C
Steep learning curve
Developers need to have a grounding in C, so they effectively must learn two languages.Mainly for iOS applications
Other platform implementations exist but aren’t really usedOlder language
Objective-C is vulnerable to being phased out as Swift gains more attention and usage.React Native: A Better Path to Cross-platform?
React Native is a mobile app development framework that allows cross-platform apps to be written entirely in JavaScript. It’s an open source project started by Facebook. React Native works a lot like React, which excels at single page web apps. Apps built with React Native don’t run in a web view like hybrid apps. They’re cross-platform mobile apps from the ground up and when finished are similar to those built using Objective-C or Java. Developers can reuse the codebase (or at least part of it) between Android and iOS. Actually, about 90% of the codebase can be reused across platforms. Another benefit of React Native is interoperability. Developers may write components in Objective-C, Java, or Swift. It features hot reloading, too, so apps can simply be reloaded instead of needing to be recompiled. Components are simple to build if developer can’t find one for a particular use. They can be edited without affecting child components thanks to React Native’s downward data flow.Benefits of React Native
Faster development
Smaller teams are needed, and development timelines are shorter.Mobile-focused
React Native apps perform better than many hybrid apps.Active and engaged community
The huge community of enthusiastic React Native developers is constantly adding to their catalogs of freely-available components.Limitations of React Native
Newer framework
React doesn’t have a component for everything yet, and there aren’t as many skilled developers available.Not suited for heavy graphics and calculations
Objective-C outperforms it here.Slow
Performance can be lower than with native apps. Developers can get around this by incorporating native modules.Technically in beta
Some developers fear React will be abandoned, like Parse was.How They Stack Up
Comparing Objective-C and React Native is a bit of a mis-step. They’re different tools for different jobs. Objective-C is mainly for iOS and OS X while React Native is meant for cross-platform mobile development. Objective-C has its loyalists and is still a decent choice for iOS apps. However, there are very few reasons not to move to Swift when working solely for Apple devices. When going cross-platform, React Native is a solid alternative to hybrid. The concern now is longevity. All signs indicate Facebook will continue to maintain React Native but longevity is always something to consider when using a new tool.No tool is always the best for every project. If your company is working on a mobile app, set up a complimentary appointment with Concepta’s developers to discuss the best tools for your specific purposes.