News for hackers. Stuff that matters.
Re:Why RubyMotion Is Better Than Objective-C by GuiA on Friday May 04, 2012 @12:16PM (#3929064)
Seen in the article:

"Why do I have to have huge statements like this?

static UIColor firstColor = nil;

static UIColor secondColor = nil;

static UIColor thirdColor = nil;

static UIColor fourthColor = nil;

static UIColor fifthColor = nil;

static UIColor sixthColor = nil; "

Great, so someone who doesn't know how to use arrays is criticizing Objective-C as a language.

To everyone claiming that Objective-C's syntax is unintuitive/unwieldly/etc: remember that familiar != intuitive.

My two darling languages are Python and Haskell and I learned programming in C/assembly, and I find Objective C + Cocoa Touch quite nice, especially since ARC was introduced. Yes, there are things that can be slightly bothering, but once you pass the initial "wow this syntax is weird" hurdle, you're good to go.

It's great to have Ruby as an alternative, but all that Objective-C hating is silly and quite unproductive. Yes, there are limitations in the iOS dev stack (mostly with XCode— but hey, it's not that bad, people have gotten good things done with Eclipse and it doesn't exactly have a perfect track record either). But if the only thing that's getting in your way of developing a great application is the fact that Objective C's syntax makes you uneasy, then you should probably reconsider your abilities as an engineer.

As usual, the ones doing great things done probably won't be the ones tweeting & blogging about how Objective-C is lame and that if only $(arbitrary language) could be used for iPhone dev, then they would change the world.

Re:Why RubyMotion Is Better Than Objective-C by mcdillon on Friday May 04, 2012 @12:21PM (#3929087)
In addition to your points; I'm not a fan of sensationalist blog posts that start off with whining about how something is hard even though the 'about me' section states how awesome they are at writing code. This seriously just screams hey come read my blog!
Re:Why RubyMotion Is Better Than Objective-C by mistercow on Friday May 04, 2012 @05:22PM (#3930413)
>Great, so someone who doesn't know how to use arrays is criticizing Objective-C as a language.

I think the author has a valid point though, even though that example doesn't illustrate it well. He should have used variable names that didn't immediately cry out for arrayification, but there is a boilerplate problem in Objective C.

The thing is, a lot of the verbosity of Objective C is actually a win. Take the messaging syntax: beautiful and readable. And the lack of first-class syntax for almost anything? Usually pretty nice and elegant. Nothing feels magic.

But you don't get a choice about these ideals. Need optional arguments? Too bad. Use a config dictionary. And there's no literal syntax for dictionaries, so every time somebody calls your method, it's going to be a big pile of boilerplate.

I don't even think Objective-C should compromise on all of these ideals, but it should compromise on some, and I think that kind of basic functionality would have been a better point of focus than foreach loops and dot-notation.

Since they don't, people are tempted to use CPP macros to work around these shortcomings. You may remember CPP macros from every GDB nightmare you've ever had.

Re:Why RubyMotion Is Better Than Objective-C by jacaranda on Friday May 04, 2012 @01:18PM (#3929376)
I am a fairly proficient ruby coder and I tried learning obj-c multiple times but just did not find my way around it. I wasn't thrown off by the syntax but more about the way the MVC model is built in obj-c. I was really confused by delegates and did not for some reason find obj-c intuitive. I was baffled in a few areas even with tutorials since I did not grasp some of the fundamentals. I think most people are not referring to the obj-c syntax as hard but to the overall framework. Again, I did not spend as much time/effort learning ruby/rails and felt comfortable the first week. My background is primarily Java/J2EE stuff before rails.