"Someone" getting back in the game (with MonoTouch)

Discussion in 'iOS Programming' started by dbrothers, Sep 15, 2010.

  1. dbrothers macrumors newbie

    Apr 17, 2010
    I've been using iPhones for a few years (started with an "original", currently have a 4), and a couple of years ago signed up for the paid dev program - I'm near the end of my first renewal. Mostly curiosity, interested in the "sociology" of the developer program, with the idea that, if a "killer" app ever occurred to me, I'd be ready to go.

    This is _not_ an "I'm a total noooob - what's a variable?" post. I'm amazed at how many of those posts I see in this forum, and admire the people who have the patience to respond gently to them. I've been programming for about fifty years, been through all the "methodologies du jour". OOP with a good app framework, starting with MacApp and Object Pascal in the mid-eighties, and with many worthy successors like Think Class Library and Code Warrior, even Microsoft's MFC and .NET, seem to me to be the ideas with the most staying power.

    Anyway, I've got an idea I want to implement on the iWidgets, so I poked around and found this forum - seems to be one of the better areas for wide-open discussions between developers. I decided to do a "total immersion in the iThing developer culture" thing, and read all the posts back to the beginning of the year. Really informative.

    An interesting surprise was this thread: http://forums.macrumors.com/showthread.php?t=844099 , from last January. I was reading along along, going "uh huh, uh huh" to the posts about how Apple needed to lock things down to avoid an uncontrollable secondary app market, when I ran across post #20. I'm the "someone" referred to. What a blast from the past! I don't think I'm responsible for the Mac application "marketplace" - Apple eventually published the "Inside Mac" books, provided Mac-native tools for app development, and supported the MacDev forum on CompuServe, which I ran. Around this time, I also developed a commercial Mac telecomm app (remember when we used modems to dial into bulletin boards?) which won a MacUser Eddy award (I've got the statue in a box in my attic somewhere).

    More related to Xcode/Cocoa/Objective-C, Scully booted Steve, and he founded Next. In '87, he made me an offer I couldn't refuse and I took on the developer support job - teaching potential Next developers Objective-C, NextStep (notice all those NS prefixes on Cocoa classes?) and Interface Builder.

    After I left Next, I jumped back into Mac development, worked for Apple in Cupertino for a while. The Mac development environments and frameworks continued to evolve, and made it very easy to create very rich Mac apps.

    After leaving Apple, I got into Windows development, helping my wife with the products published by a company she had founded. Originally C++ and MFC, I migrated into .NET. Say what you will about Microsoft, they've got a lot of smart people working for them, and the .NET framework(s), the C# language, and Visual Studio are a delight to work with.

    When I started contemplating doing an iOS app, I read everything on the Apple site, and bought and read a bunch of books (if you haven't figured this out yet, I'm a bit of a polymath when it comes to technical subjects). The surprising thing, to me, was how little "ease of use" progress seems to have been made since I was at Next 23 years ago. Reading through this forum, I saw a reference to MonoTouch (I had used Mono to do some hacking on a Nokia Internet Tablet a few years back). Wow! All of the power of the Cocoa UI framework, with all the coding elegance of c# and the .NET classes, and managed memory management to boot. I'm in love! How come there's so little discussion of MonoTouch in this forum?

    And, it turns out, this is a perfect time to have discovered this, given Apple's recent turnaround on non-Xcode apps (though it appears that Apple has been accepting CocoTouch-built apps all along). Life is good, and I'm working full-tilt on my app.


    - Dennis Brothers
  2. adrian.oconnor macrumors 6502

    Jan 16, 2008
    Nottingham, England
    Interesting post, and interesting question. I'm not sure why MonoTouch doesn't get much of a mention, but I think it might come down to the kind of programmer that is attracted to iPhone development -- those that are will learn Objective C because it appeals to them.

    I'm the perfect candidate for MonoTouch -- C# and .NET on Microsoft platforms has been the core of my professional livelihood for at least 6 years. Before that it was VB, ASP etc. My strongest skills are, by far, .NET.

    You know, when I first started to learn Objective C and CocoaTouch I found it incredibly hard. It just didn't make sense -- the way Obj-C delegates work and things getting initialized by the xib were not familiar at all. Now I'm used to it I really love it. Even so, I just couldn't get interested in MonoTouch -- it was obvious that it would take me as much effort to learn the namespaces and how things hook together in MonoTouch as it would to learn Objective C and Cocoa Touch.

    I also like Xcode. It's quirky, but it's faster than VS. I don't use refactoring tools like Resharper and I don't really use the code completion helpers that lots of MS developers get hooked on -- I'm just as fast without them. XCode 4 looks like it's going to be a great upgrade too -- especially on widescreens. That intelligent split mode editing is going to be very powerful.

    I'm also a bit of a jack of all trades. I don't like doing the same thing for too long so along the way I've also picked up Ruby, Python, Java, SQL of various flavors and more. .NET is what the market wants from me right now, which is the main reason it's still my primary language, but I really enjoy doing things a little differently from time to time, just for the sake of it. Maybe that's why I like XCode and Objective C so much? Maybe that's why .NET developers who write for iPhone learn Objective C?

    I don't know. Do you have any thoughts on why MonoTouch doesn't get much of a mention? Would you also care to share what your experience of MonoTouch has been like, from a .NET developer's perspective?
  3. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    The price tag of MonoTouch might be another factor.
  4. dbrothers thread starter macrumors newbie

    Apr 17, 2010
    True, but if you value your time, and it makes you more productive (which I think it does, if you have C# and .NET skills), the payback period isn't too long. I consider myself a competent programmer, I'm comfortable with both Objective-C/Cocoa and C#/.NET, and I suspect I'll be something like twice as productive with the latter.

    BTW, in honor of Apple's turnaround on the "You gotta use Xcode" issue, Novell is having a two-week sale - 15% off.

    Also possibly relevant, I see in today's business news that Novell is putting itself on the market, in two chunks. I hope MonoTouch doesn't somehow slip through the cracks.

    - Dennis
  5. Don Kosak macrumors 6502a

    Don Kosak

    Mar 12, 2010
    Hilo, Hawaii
    As a fellow coder from back in the day when NS stood for NeXT Step, you'd really get a kick out of XCode 4. It's pretty amazing compared to what we had on the little black cubes and pizza boxes.

    Since you're in the developer program you can download beta 3 and take a look.

    I don't have much of an opinion on MonoTouch. I've dabbled a bit here and there in C# and other .NET tech - but since I knew Obj C I just picked up the iOS SDK and dove right in.

    I think it's worthwhile learning an SDK in the native platform language.
  6. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Granted. From what I can tell though, a large percentage of people coming to these forums to learn about iOS development have no C# or .NET skills. In fact, a lot have very little programming experience at all.

    And then there's the added stigma in some circles that favor Microsoft technology that would consider it blasphemous to even want to develop for iOS. It doesn't make any sense to me, but I think it's out there.

    Care to elaborate some more on this point. I've never used MonoTouch or even Visual Studio but I have a good friend / developer, whose opinion I value greatly, and he says very good things about both. He is about as far from a specific-technology-biggot as I've seen.
  7. dbrothers thread starter macrumors newbie

    Apr 17, 2010
    I'm not a technology bigot, either. In almost half a century of system design (both hardware and software) and programming, I've used more design environments and languages than I could possibly remember.

    Regarding productivity advantages of C#/.NET over Objective-C/Cocoa, there are many. Off the top of my head, just listing a few, probably the biggest is automatic memory management and garbage collection. It makes you more productive, _and_ it reduces your support overhead - I'd guess a significant fraction of the apps in the store occasionally crash because of undiscovered memory leaks or double releases.

    Next, and I know this can be a religious argument, I _like_ static/early-bound typing - it allows the compiler to catch many, many really dumb errors. If you really, really need late-bound "messaging", it's available, but you have to be conscious of doing it.

    "Cleaner" syntax - this is really minor, but in the long run it adds up. C# syntax is just simpler and less cluttered - easier to read at a glance. Related to this is the absence of header files - everything you need to know is in the implementation file.

    A very rich class library (I won't call it a framework, since MonoTouch still wraps the Cocoa framework). Most of the workhorse classes (strings, collections [including type-safe generics], whatever) are simply richer and more comprehensive than the comparable Cocoa classes. There are incredibly powerful and useful language features/classes like Linq for XML that have no correspondence in Objective-C/Cocoa. You have no idea how pleased I was when I saw that MonoTouch included Linq for XML - seems like half my code lately uses that.

    I could go on, with more and more petty stuff, and I'll freely admit that there are areas where Objective-C is superior to C#, but overall I think C# has the advantage.

    - Dennis
  8. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    I remember MacTEP. I even contributed a bit of code to one version. Poking hex 68000 machine code into arrays, and jumping into it from MSBasic. Uploaded to compu$erve with my 300 baud modem.

    And one of the reasons I like Objective C is that I can still read the ARM disassembly code displayed by Xcode and see what's going on... make trade-offs between Objective C, straight C, maybe even a smidge of NEON ASM. Managed code... who knows what's going on? Exactly what's sucking down the battery? Why can't the frame rate maintain 60 fps? On thin devices with small batteries, instead of big power cords and heatsinks with fans, that still matters for some types of apps (often the types of apps I like to develop).

Share This Page