Live data from Hacker News

Ask HN: If learning to develop for iOS- start with Obj C or Swift?

news.ycombinator.com

31–40 of 53 posts

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#31
I, having been burned many times, have developed an allergy to the latest new shiny thing, especially if heavily promoted. The number of such things that have been successful are lost in the mass of those that have not. For every C#, there's a hundred Microsoft Bobs.

Investing scant resources (and your time and mind-share are among the most precious you have) in a technology before it has developed a following, third-party support (tools and libraries), a viable user base, and the resources to educate yourself and others is a significant gamble. Sure, you might win. But you probably won't.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#32
post #7

Anecdotal evidence in favor of Objective-C (Swift wasn't around back then): at an early WWDC, a dev. who was completely unfamiliar with Objective-C finished his first Cocoa application during the "Intro to Cocoa" session, and spoke about his amazement during the feedback. Swift is way more complicated than Objective-C, even if the syntax may seem a lot more familiar if you're used to certain other languages. The reas…

Swift is strictly less complicated than objective-c for implementing Cocoa apps.

It can be used to do more complex things if you want to do functional programming, but to do the same things in the same way, it is less complicated.

The weakest point is the lack of examples and documentation.

The lack of Linux and windows versions is irrelevant. Although there are open-source implementations of Objective-C, there is no open-source equivalent of Cocoa, so the experience is barely transferable.

You certainly will end up learning a lot about objective-c in order to work with Cocoa, but learning Objective-C first will be a waste of time, since once you know Swift, you will barely ever touch Objective-C.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#33

I am not an iOS dev, so I apologize if the answer is too obvious, but why did Apple introduce Swift? What's wrong with Objective-C?

There is this nature of software tools to grow in backwards-compatible ways inevitably becoming evolutionary dead-ends. Apple tried hard with features such as Automated Reference Counting (ARC) but inevitably it is still C glued with a hard-to-optimize object system.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#34

A +10 times WWDC veteran said to me that it usually makes sense to really start using new dev tools and APIs 1 year after their announcement in WWDC. Dev tools have matured enough and the latest OS version has had enough installs to make it worthwhile.

This is only true if you are already an expert and are highly productive in the old tools.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#35

I am not an iOS dev, so I apologize if the answer is too obvious, but why did Apple introduce Swift? What's wrong with Objective-C?

Swift is designed to:

* be safer and reduce bugs * be more concise to increase productivity * be easier for the compiler to optimize * introduce functional programming constructs to make algorithm development easier

Objective-C is weak in all of these areas.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#36
I've been writing Objective-C for a long time now, and have shipped a fair number of iOS apps. It's a beautiful language in my opinion, if you can get passed the syntax (harder for those who lack a "beginners mind" and are used to a certain way of doing things.)

To answer your question, it really depends on your goals. If you're looking to write your own apps, and you're not under any time pressure, I'd say start with swift. Apple will push the adoption curve _hard_, they always do.

If you're looking to get a job as an iOS developer in the next year or so, Objective-C isn't going anywhere. Big organizations in particular will not be rewriting their apps from the ground up, and there will be legacy code to maintain for years to come. I know of some big projects that were still avoiding ARC for quite a long time...

No matter what, I'd learn Swift _now_, but if you can spare the time I'd say do yourself a favor and learn both. Objective-C has a lot of great concepts, and they're totally worth learning. And it will make understanding the Cocoa and UIKit frameworks a bit easier as well.

Good luck!

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#38
post #7

Anecdotal evidence in favor of Objective-C (Swift wasn't around back then): at an early WWDC, a dev. who was completely unfamiliar with Objective-C finished his first Cocoa application during the "Intro to Cocoa" session, and spoke about his amazement during the feedback. Swift is way more complicated than Objective-C, even if the syntax may seem a lot more familiar if you're used to certain other languages. The reas…

Idk if I agree that objective-c is simpler to learn. I have been working as a full-time ios developer for almost 2 years now and I still have to consult fuckingblocksyntax.com on a weekly basis. And fully understanding objective-c's "message passing" idea is hard because it's so radically different from other languages.

And sure you can whip together a simple app using all the documentation and tutorials out there for objective-c. But objective-c has a lot of gotchas that make it easy to do bad things as you start to build a larger app. Like retaining self implicitly because of an ivar in a block... Can't tell you how many times that is bitten us.

That being said, have you tried to use Swift with the core foundation framework? Yikes. I spent hours yesterday trying to understand how to simply pass a pointer to a function. The type was something like CMutablePointer?>. Hopefully it'll get easier as the documentation improves though :)

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#39
I'd agree with some of the other commentors' sentiments voicing that you should start out with Objective-C, but less so because of immature tooling.

For me personally, I'd be more concerned about someone in your position trying to learn Swift now because it's an incredibly immature language. Core language-level changes IMO are the hardest to cope with, as they can have a severe impact on code written in a previous version of the language, not to forget how much of a mental cluster-f!#@ it can cause.

Re: Ask HN: If learning to develop for iOS- start with Obj C or Swift?

#40
post #13

Objective C. When you need to figure something out, and Google returns 1,000 tutorials on how to do it on Objective C and nothing for Swift, you'll know why. Sure, Swift might be better. One day you'll probably learn it. But 99% of the effort in learning Objective C is learning all the frameworks and libraries, and the support to do that is much better in Objective C (at present). If you already know Objective C, and…

Yes, I've just started down the iOS road and of course I'm sticking with ObjC for now; all the Stack Overflow questions and tutorials are for ObjC at present and I can't just adopt a brand new language. Eventually, I will, though; Swift looks pretty cool!
Post reply on HN