Hacker News new | ask | show | jobs
by sjs 5438 days ago
I prefer using and making software for iOS over Android but I think you're right. Cocoa programming requires a lot of up front knowledge about their design patterns and tools. It's no small undertaking for someone to learn about KVO, delegate pattern (so simple but confuses people for some reason, I think it's the name), MVC, and then add actions and outlets, resizing masks, and all the other unique things to Xcode/IB that people have to learn.

Once you know Cocoa and Xcode iOS development is faster and more fun than Android development but it's no small learning curve. It's worth it for the fast turnaround of using the simulator compared to Android where both the emulator and device are slow, you're looking at 5-10x as long to launch your app compared to the iOS simulator. Plus ObjC > Java if you ask me, but I'm a masochist who likes both C and dynamic languages. Individual statements are verbose in Cocoa but I'd have to look at how much boilerplate is caused by the Java straight jacket to speculate on which is ultimately more verbose.

You also have to be willing to put with some crusty stuff. Nothing compared to OS X programming but it still feels old next to Java's APIs. Two good examples are string manipulation and interacting w/ the filesystem, so verbose on iOS but pretty good in Java.

2 comments

I agree whole hardly. I was doing C# and WPF dev right out of Uni and really loved the total power that you were given to create cutting edge apps (I worked primarily with the Microsoft Surface).

I don't really have anything bad to say about WPF but when I first got my hands on UIKit and Objective-C I fell in love.

In WPF you can do anything and customize everything. UIKit is Apple's magical black box but it will get you like 80-90% of the way to your goal so you don't need to engineer everything like I did with WPF. Couple that with Foundation and their other great frameworks like CoreLocation and so much boilerplate code seems to be hidden behind Apple's walls.

I'm also probably in the minority but I like the verboseness of Objective-C and the dynamic nature of it. Honestly it is a small thing but not having to put null pointer checks all over my code is the thing about the language I love the most.

Verbose is putting it mildly. Objective C isn't a bad language, but the syntax is just horrible IMO. So much extra typing to do something simple.

That said, the app I'm writing at work does a lot of stuff with strings, which you did mention specifically as a problem.

Properties also drive me crazy. just a ton of extra annoyance just to declare a variable.

I also prefer eclipse to xcode, and visual studio to both.

oh and good point about the simulator. The iOS simulators are MUCH better than the android simulator. So much faster.

What is the annoyance with declaring properties? How is it worse than other languages?

You have a single line that specifies a property and then a single line to synthesize the accessors if you don't need to do anything unique inside them.