Ask HN: Swift or Objective-C? - thecoffeebean
======
sparky_
I'll take the counter-point here and vote for Objective-C. Swift has not
reached a level of maturity that we're comfortable with it for mission-
critical code. Each Xcode revision brings breaking changes which require you
to address manually, as the migrator is lacking. Interop with Obj-C works OK -
not great - but with pure C, it's a hassle. And the libraries and tools around
Swift are just nowhere near as mature as they are for Obj-C... even first
party; case in point, Xcode cannot even rename methods or extract constants
from Swift code. No refactoring capability at all.

Having built several large apps which are live in the Store in both languages,
I'm sticking with Obj-C for 2016. Give Swift another year before going all in.

------
jefflinwood
Learn Swift now, and then Objective-C later.

I think one of the biggest misconceptions with the migration to Swift is that
it will be a lot easier to be an iOS developer with no experience. After
teaching new to programming students iOS development with both Objective-C and
Swift, the actual syntax mattered very little - the underlying iOS APIs were
difficult to understand.

You'll still find that many API tutorials are written with Objective-C, so
even if you don't code in that language, you'll need to translate in your head
as you read how to hook up X or Y to Z. In addition, a lot of stack overflow
questions for common iOS programming questions are in Objective-C, so you'll
at least need to know how to read it.

------
npalli
Your choice is quite clear as of Jan 2016. Almost all of the latest
tutorials/books/online courses and other learning material have moved to
Swift. So, if you are looking to develop for iOS 9 and Xcode 7 and above it is
Swift.

Even if you wanted to learn Objective-C all the good versions of learning
materials are at iOS 7 and below. Not a good choice since it is very likely
none of that stuff works cleanly anymore. So, go with Swift. Yes, you will
need to be familiar with Objective-C on an as needed basis, but if you learn
Swift and iOS programming it will be a translation and not that bad.

------
hackerboos
I think when Big Nerd Ranch decide it's time to move to Swift, then it's time
to move to Swift.

[https://www.bignerdranch.com/we-write/ios-
programming/](https://www.bignerdranch.com/we-write/ios-programming/)

~~~
coryl
But their motive is to sell books and lessons, not necessarily code that works
in a production environment.

------
adomanico
The majority of companies still have code bases with a ton of Objective-c
code. The company I am currently working at has an approximately 30% Swift
code and we have been writing Swift since 2.0 went live.

The reality is if you can't be proficient with Objective-c no one will hire
you at this point. The more time passes, the more Objective-c code will become
legacy, and the less important this will be.

That being said definitely start with Swift. It is an excellent language and
is the future of the iOS platform.

------
NSHippie
Q: What made most developers fear iOS Development? A: Objective-C. Then there
were programmers who spent countless hours learning Objc, these objc
programmers will always tell you to use objc and not Swift. Apple, introduced
swift because it is the future. Learn swift, once you know swift and you are
comfortable with iOS Frameworks you can easily transition to objc.

------
autoreleasepool
Both. You have to know both languages to develop iOS apps in 2016.

~~~
GoldenMonkey
No you don't. You can make all your apps in Objective-C.

~~~
autoreleasepool
If you want to be technically correct, you can make all your apps exclusively
in Swift too. The fact is most large projects are already using both. The
trend for new code is to be written in Swift.

At the very least, your need to be able to reason about both languages.
Refusing to learn one of them is a disservice to yourself as an iOS dev IMO.
Denying that would be silly. If you haven't taken a look at Swift, there is no
better time than now to start.

------
abatjarg
I think it really depend on your level of knowledge. If you are just starting
out then I would start with Swift as it is easier to learn and most new
learning materials are in Swift. Once you get the hang of the API and Swift,
you will eventually have to learn Obj-C.

------
bribri
Swift is a better language in almost every way but you should still know
Objective-C if you want to work professionally.

~~~
seivan
Not when working with C++ libs as of today. Even working with C is a bit of a
pain. Apart from that, yeah go full Swift.

~~~
autoreleasepool
To clarify, in this case you can (should?) use Objective-C++ wrappers to
create an interface for Swift.

------
andymoe
Swift for new stuff.

~~~
davismwfl
What do you feel is the primary or greatest benefits of using swift? I get it
is the new way but is it that much more productive, easier, flexible or?

~~~
seivan
Safety and builtin encapsulation. No more included properties in
inplementation files. :-).

~~~
robgibbons
Not to mention verbosity, and ease of reading and writing. Its syntax is so
much less dated. As far as programming languages go, Obj-C definitely "feels"
as old as it is.

~~~
seivan
I prefer Objective-C syntax ;-) that's why I chose to learn it after Ruby's
"odd" syntax and quirkiness.

------
thomasmeagher
Swift is the future, Objective-C is the past.

~~~
wingerlang
But Objective-C is also the current, as most big codebases are still in it.

~~~
purplerabbit
rekt

------
ksherlock
Objective C++

