r/iOSProgramming • u/whackylabs [super init]; • Feb 26 '20
Discussion February Headline: Objective-C on its way out
“Objective-C lost this month another 7 positions in the TIOBE index, thus being on the brink of slipping out of the top 20. Actually this drop took much longer than expected.
In 2014 Apple announced the new programming language Swift to be the successor of Objective-C. At that moment Objective-C was at position #3 in the TIOBE index and development of mobile apps for iPhones and iPads was booming.
After the announcement Objective-C dropped from 12% market share in 2014 to 1% market share in 2016. Suprisingly Swift grew from 1% to only 2% at that same time. The other 10% was consumed by other programming languages that appeared to be compilable for multiple mobile platforms.
One might conclude that Apple made a mistake to insult iOS programmers by bluntly replacing Objective-C by Swift, but actually they hadn't got a choice. Objective-C was outdated as a programming language and definitely needed a redesign.
In my view it would have been better to extend Objective-C with modern features step by step. Just like languages such as Java, C++ and C# survived by making small changes every new release.
Now Apple lost 10% of its programming language market share by making this move. Having said this, Swift is now at position #10 of the TIOBE index.”
I’m curious, if you were programming with Objective-C, after Swift was announced how many of you jumped to another language?
Also who’s still programming with Objective-C?
View all comments
Show parent comment
3
u/whackylabs [super init]; Feb 27 '20
For it's not only just about the evolution of Swift. But more like how with Objective-C you can deal with things at runtime. So if you change a type somewhere, you don't need to change the code in 20 places.
For example, I have a
NSArrayfor myUITableViewDataSource. So mycellForRowAtIndexPathlooks like:And then if I plan to change the element of the array, I just need to update my cell class and class that is filling up the array. The data source code remains the same.
I've so far updated the element from being a string to dictionary to a proper model class.
This is the kind of flexibility I miss in statically type checked Swift.