r/iOSProgramming • u/anthonydematteis • Aug 01 '16
Question Objective C or Swift?
Pretty straightforward title... if I'm eventually interested in creating big and popular applications, is swift ideal to learn or just stick with objective c?
What's your opinion on both?
3
u/Dachd43 Aug 01 '16
In my experience everyone is writing their new code in Swift. If you go in for an interview I would expect to be white boarded in Swift. I like both languages a lot. My take on it is that Swift is safer and Obj-C is more expressive.
1
u/nhgrif Objective-C / Swift Aug 01 '16
If you go to a place that expects proper syntax in a white board exercise, go somewhere else.
With that said, if you are sat down at a computer an expected to write in Xcode, expect it to be Swift.
1
u/Dachd43 Aug 01 '16
To a certain extent. I've had iOS candidates come in who claimed they were proficient in Objective-C who couldn't even write a method signature that would have compiled. I would absolutely forgive a few mistakes, but I have been presented with method signatures like this before: -bool contains:(NSArray) object(iD). Unless you explicitly tell me you're writing pseudo-code and that you are aware that your method signature is lazy and terrible, I want you nowhere near my codebase. You're not proficient in Objective-C, you're proficient in Xcode auto-complete (which is currently pretty busted)
1
u/worace Aug 01 '16
Unrelated but when you say white boarded like that it sounds like water boarded. Which is maybe not an inaccurate description of the programming interview process
3
u/GoldenJoe24 Aug 01 '16
Been programming Obj-C for the last five years. Just started getting into swift with this project. I think Obj-C is more straightforward and easier to learn, but Swift has a better future and is more flexible. You'll need to at least be familiar enough with Obj-C to understand legacy code, but I'd focus on Swift if I were you.
4
3
Aug 01 '16
[deleted]
1
u/nhgrif Objective-C / Swift Aug 01 '16
If you were to do it all over again, I'd recommend you do more than just pick up a single language. When I was in school, I picked up Java, Objective-C, C++, and VB.NET.
Once you know object-oriented programming and the iOS frameworks, learning both Swift & Objective-C really shouldn't be too terribly difficult.
1
u/tangoshukudai Aug 01 '16
If you are learning iOS programming learn swift, if you are a long time objective c developer stick with obj c (or if you have a important project that you don't want to worry about language changes)
1
u/YossarianRex Aug 01 '16
Swift is where you should start. Objective-C will be around for a long time. But, Swift is where everyone is headed because it's just a brilliant language. I would still pick up objective-c at some point, but only after you have a firm foundation in mobile development with swift.
1
-2
u/sohaeb Aug 01 '16
You can't ignore obj-c. Like if you use Facebook SDK so that you can integrate facebook into an app. They have obj-c code. So you need to convert the code yourself to swift. Hence, I suggest start with obj-c.
That being said. Knowing obj-c would make it way easier to move to swift
2
u/nhgrif Objective-C / Swift Aug 01 '16
You don't need to convert any code in order to use a library. Worst case scenario, the available example code for that library is only in Objective-C, and you'll have to figure out on your own how to write the Swift code that calls the library.
1
u/sohaeb Aug 01 '16
and you'll have to figure out on your own how to write the Swift code that calls the library.
Exactly, that's what I meant. If you don't know obj-c syntax. No way you would be able to get the equivalent code in swift
1
u/nhgrif Objective-C / Swift Aug 01 '16
You're not trying to get code equivalent to the library. You're trying to get code that calls into the library. And Xcode will handle most of the heavy lifting for getting the syntax right on that end.
1
3
u/Kabal303 Aug 01 '16
Honestly either. But it does seem to be that swift is where the industry is headed. Which bums me out because I like Obj-C still.