Live data from Hacker News

Build iOS Apps In Ruby - Available Summer '12

mobiruby.org

41–50 of 54 posts

Re: Build iOS Apps In Ruby - Available Summer '12

#41
post #18

Earlier quoted context omitted.

Why do you think it's hell? I've been using it for about 2-3 years now and it's really grown on me over that time. I think the most common complaint is that it is too verbose, but that has its advantages too.

what's an advantage of being too verbose? extra exercise for your fingers? ;-)

With autocomplete you don't get much extra exercise anyway. It helps to strain your brain less however when reading the code.

Re: Build iOS Apps In Ruby - Available Summer '12

#42

People of Earth: This is nonsense. Objective C is a fantastic language. Appcelerator Titanium, PhoneGap - it's all crap. Customers can feel the difference. To make a native app, learn a native language.

Really wish the Flash devs I worked with thought this way.

"Oh I've been looking into PhoneGap, it's pretty cool"

"Oh I've been learning Android development"

WHY???? When has a client even asked us to make an Android app.

Re: Build iOS Apps In Ruby - Available Summer '12

#43

Earlier quoted context omitted.

Well any way you slice it you're still going to have to interface with the Cocoa frameworks that make up the OS. Anything that masks the interface too much just causes friction. e.g. you can't look stuff up in the docs anymore. MacRuby does a bit better job at first glance than this does, but you can't get past the way the framework you're using works. In Objective-C: Person *person = [Person new]; [person name]; [pe…

The trouble is, this causes almost as much friction as just using Objective C in the first place. I use Ruby and ObjC extensively (have even mixed them in a desktop app), so I'm familiar with both. While I find ObjC immensely frustrating for dealing with strings and text, and love to use Ruby for that, the syntax above just makes me cringe - it's not idiomatic Ruby, which would be something more like: person = Person…

Assuming that "name", "firstName", and "lastName" are KVC compliant properties, you could do this in MacRuby:

    person = Person.new
    person.name = "Joe"
    person.lastName = "Blogs"

Re: Build iOS Apps In Ruby - Available Summer '12

#45
post #39

How about you learn the native language. You will never get the most out of a platform without going native. Apps like instagram, any games, and the most exciting apps in mobile will always be native. Great programmers have the tools to build what needs to build.

Totally. That is why I code my web apps in assembly. Frameworks and higher level languages have nothing to offer.

Re: Build iOS Apps In Ruby - Available Summer '12

#46

How is this : alert = UIAlertView._alloc \ ._initWithTitle _S("Hello"), :message, _S("I'm MobiRuby"), :delegate, nil, :cancelButtonTitle, _S("I know!"), :otherButtonTitles, nil alert._show supposed to be better than this ? alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"I'm ObjC" delegate:nil cancelButtonTitle:@"I know!" otherButtonTitles:nil]; [alert show];

Because its actually:

file.rb:

  require 'stuff'

  class foo
    def something
      alert = UIAlertView._alloc \
        ._initWithTitle _S("Hello"),
        :message, _S("I'm MobiRuby"),
        :delegate, nil,
        :cancelButtonTitle, _S("I know!"),
        :otherButtonTitles, nil
      alert._show
    end
  end
Instead of

file.h

  #import 
  @interface foo
    -(void)something:(BOOL)what andthen:(CGRect)thisthing
  @end
and then file.m

  #import 
  #import 
  #import "file.h"
  #import 
  #import 
  #define SOME_HACK
  #import 

  @implementation foo

  -(void)something:(BOOL)what butthen:(CGRect)thisthing
  {
   alert = [[UIAlertView alloc] 
                initWithTitle:@"Hello"
                message:@"I'm ObjC"
                delegate:nil
                cancelButtonTitle:@"I know!"
                otherButtonTitles:nil];
     [alert show];
  }
Fuck that.

1. Don't Repeat Yourself. Computer have more memory than 1986.

2. Don't forget to turn on warnings-as-errors, otherwise that code above will compile and then break because (of course you noticed) the method declaration doesn't actually match the declaration but the compiler doesn't care because its a brutal hack.

Re: Build iOS Apps In Ruby - Available Summer '12

#47

How is this : alert = UIAlertView._alloc \ ._initWithTitle _S("Hello"), :message, _S("I'm MobiRuby"), :delegate, nil, :cancelButtonTitle, _S("I know!"), :otherButtonTitles, nil alert._show supposed to be better than this ? alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"I'm ObjC" delegate:nil cancelButtonTitle:@"I know!" otherButtonTitles:nil]; [alert show];

Definitely agree. The place where ruby syntax might shine a bit is in code that does not interact with the Cocoa/IOs specific libraries (e.g. doing calculation, parsing/manipulating strings).

Re: Build iOS Apps In Ruby - Available Summer '12

#48
post #45
post #39

How about you learn the native language. You will never get the most out of a platform without going native. Apps like instagram, any games, and the most exciting apps in mobile will always be native. Great programmers have the tools to build what needs to build.

Totally. That is why I code my web apps in assembly. Frameworks and higher level languages have nothing to offer.

Thats not the same because iOS and android are both frameworks. Adding framework onto framework especially on mobile which moves so fast cause more problem than it solves because people start complain that google or apple broke there framework which shouldn't have been there in the first place.

Re: Build iOS Apps In Ruby - Available Summer '12

#49
post #42

People of Earth: This is nonsense. Objective C is a fantastic language. Appcelerator Titanium, PhoneGap - it's all crap. Customers can feel the difference. To make a native app, learn a native language.

Really wish the Flash devs I worked with thought this way. "Oh I've been looking into PhoneGap, it's pretty cool" "Oh I've been learning Android development" WHY???? When has a client even asked us to make an Android app.

While iOS devices are pretty up to date, phonegap/flash/titanium/corona are actually pretty nice on android when you have 15 different operating system versions all seemeingly evenly deployed on the market

Re: Build iOS Apps In Ruby - Available Summer '12

#50

Earlier quoted context omitted.

what's an advantage of being too verbose? extra exercise for your fingers? ;-)

With autocomplete you don't get much extra exercise anyway. It helps to strain your brain less however when reading the code.

I don't think "arrayByAddingObjectsFromArray:" is particularly clearer than "concat" or "+" unless you're just totally unfamiliar with the language. In fact, for many selectors I find the shorter names easier to read because my brain sees them as a single token while I have to mentally parse Cocoa's behemoths every time I run across them. There is some benefit to clarity, but very often Objective-C's glut of information makes it harder to pick out the details you were looking for. Smalltalk was considered quite readable and in fact was the inspiration for Objective-C and Cocoa, but its selectors were more minimal (for example, the equivalent to the above methods is #addAll:).

(Just to establish that I'm not completely talking out my rear end: I've been programming Objective-C for ten years, Ruby for five.)

Post reply on HN