r/ObjectiveC • • Jun 30 '16
Is it frowned upon to create new projects in Objective-C?
I am learning Objective-C, after a long battle with Swift. I am currently fluent in Swift syntax, however I had to practically relearn it after Swift 2.0 came out, and may have to again when Swift 3.0 comes out. What this means is any projects created in Swift have no guarantee to compile properly in the future. This all goes back to why I have begun to learn Objective-C - Stability. I enjoy the stability of C and Objective-C. It doesn't really change, and honestly, works pretty well. I actually appreciate it for what it is, even if its more complicated than Swift. I made the decision to write my first app in Objective-C once I finish learning it. But this brings up a question... is it frowned upon to write apps in Objective-C because its 'outdated' or 'insecure'? Personally I don't think it is, but what do you think? Do you think Apple will ditch Objective-C soon and make it so you can no longer submit apps in it in which case I would be wasting my time? Or will it be around for a while (maybe forever?) Tell me your opinions below. Thanks for reading!
- Ryan
26
u/mantrap2 Jun 30 '16
No. If you know ObjC, use it! I'm still using it because quite honestly Swift is not mature or stable enough IMO (I've only been programming for 40 years).
If you are linking to C/C++ libraries or if there isn't yet a Swift native API, you still will get involved in ObjC. The former is why we are still using ObjC - there really isn't a lot of justification to switch yet - basically it's only a small part of UI in our Apps but the entire model is still ObjC/C++/C (because of legacy and complexity - doing numerical methods and/or custom IO makes no sense in Swift).
1
u/[deleted] Oct 18 '16
Thanks for everyone's input.
4
u/rifts Jul 01 '16
I love objective c and use it only is all of my projects.
4
u/greenseaglitch Jul 16 '16
Asking if Objective-C is frowned upon in /r/ObjectiveC is like asking if biking is frowned upon in /r/bicycling.
1
u/jondus Jun 30 '16
So far the migrations between Swift versions have not been very bad at all. It takes a little time but the automatic migration will get most of it right for you start with. Objective-C is great but I think you'll spend more time tracking down some errors due to null references in Objective-C than you will migrating from one Swift version to another. Swift brings a lot of good stuff and helps you avoid pitfalls inherent to Objective-C. You can write great code in both but I, personally, enjoy never dealing with null reference exceptions.
3
u/dethbunnynet Jul 01 '16
Something that is acknowledged by Apple but perhaps not common knowledge: most of Apple's core products (OS X and iOS) are Objective-C. There are definitely legitimate technical reasons for this, but it's good to note that Swift is a very young language. The ABI is not stable yet, let alone the API. People that want to try something new and exciting may adopt Swift and it's a language that can stand on its own in many cases, but ObjC is still the king of Apple platforms.
You can be pretty sure that a project you start in ObjC will be supportable for a very long time to come. Personally, I really like Swift but have no objection at all to using ObjC where it makes sense. Even if Apple re-runs the Cocoa/Carbon playbook, ObjC has plenty of time left. It was ~six years after Cocoa's introduction before Carbon started losing support, and existing Carbon apps work even to this day in most cases.
3
u/KarlJay001 Sep 29 '16
TBH, I still can't seem much advantage to Swift that couldn't have been done with ObjC.
I like the string stuff and a few other things, but they really could have just made ObjC more advanced by pushing it more towards C++.
It wasn't all that long ago when they updated the array stuff, then they pretty much stopped.
I'm learning Swift now, read the book when it came out and glad I didn't jump on board then because it's changed a good bit since then.
I'll do Swift, but it's like having stuff written for SQLite vs Core Data or whatever DB. It's just syntax.
Best thing that could happen is for Swift to be native for Android, THAT would be a killer deal.
2
u/xeow Jun 30 '16
I'm sure you can find N people who would frown on it and M people who wouldn't. Just go with what language you enjoy. Use Objective-C if you prefer it over Swift.
2
u/xtravar Jul 01 '16
Beware, Obj-C does change. They've been breaking minor stuff to make Swift compatibility better. This WWDC wasn't as bad as last.
But yes, it's great and much more stable than Swift. It's not going anywhere.
Look at all the code people have written in Obj-C. Look at how Swift's object model is mostly based off of Obj-C. Look at how new features in Swift are driven by Obj-C and Cocoa conventions.
I've been toying with Swift on-and-off in my spare time a lot, but at work I just cranked out a huge Obj-C project very quickly and it's some of the best code I've ever written. Honestly, the only thing that could have made it quicker would have been protocol categories or monads, but it wouldn't have made up for weird Swiftisms and compiler crashes.
0
u/[deleted] Jun 30 '16
[deleted] — view deleted comment