The colorful wolf

October 20, 2009

Catapults and machine guns

Filed under: Tech — randy @ 23:48

Ok, let’s talk tech.

I am by ‘nature’ a Java developer. I’ve been spoiled with this language ever since university, when I first started to take  programming seriously. As such, I have a natural aversion to languages that require more code to do something than Java. Especially the whole memory allocation management stuff and pointers/references were never quite compatible with me, and I tended to avoid this altogether in favor of the easy syntax, garbage collection and pleasant framework that Java offered me.

But I no longer have that luxury. If you want to improve as a programmer, sometimes you have to expose yourself to new languages so that you can learn new tricks and smarter ways of doing it. For example, you can write incredibly compact and effective code in Perl or Python that would look bulky and ugly in Java. Each programming language has their purpose, and recently the most important reason for programmers to learn a new language is the rise of the smart-phone. Most notably Apple’s iPhone, of course, but Google’s Android is also growing. Smaller platforms have different rules. Less memory means being more careful with object creation. A smaller screen means a different way of designing user interfaces. A fingertouch interface means a different way of interacting with the user.

Designing program architecture is something I really like to do. Working in Java with client-server applications, database back-ends and JSP front-ends is great for me. I can manage a large code library, use smart design patterns and create code that is both elegant and fast. There’s a lot of room to play in order to get the result out. Mobile platforms are quite different. I’ve had some experience last year in creating an application for the Android platform, but (surprisingly) it did not affect my way of thinking very much. A large part of the application revolved around the interface with a C library, but I wasn’t the one who created the JNI bridge, so I was never in contact with the low-level stuff, like allocating memory or managing pointers. And since Android syntax is by definition Java syntax everything felt just right, and I felt right at home.

This time it’s different, though. I’m working with the iPhone now, and I’m learning Objective-C. There’s a saying in Dutch that goes “Even if a monkey wears a golden ring, it’s still a goddamn ugly monkey” (slightly glorified by yours truly). Even if you can program in an object-oriented way in Objective-C, the layer pulled over your eyes is so thin that you can still clearly see the ugly behind-the-scenes activities. It’s truly surprising to me that a company like Apple, which focuses so much on a great, no comprise,  user-experience, completely insults the entire programming community by forcing them to work with a language like objective c. The obvious argument here is that a low level language is faster, and forcing the user to do their own memory management means that the program can run quicker because there is no garbage collector. But how is that an argument if Apple’s competitor Google is doing just fine with their garbage-collected, high-level, Java-based mobile phone platform? Apple’s platform sure seems a lot more fragile.

My friends (who have iPhones) keep on telling me that it’s the “Apple way”, and that I’ll get used to it soon enough, and then I’ll appreciate it more. Having worked with the iPhone for a couple of days now, that still seems unlikely to me, but if there’s a change in my opinion I will be sure to write it down here. Until then though, I am learning all the stuff that I loved to not do in university: native c code, pointers, references, memory management, etc. etc. It’s a great learning experience, especially in the beginning. I have to admit that I had never even touched a Mac before last week, so the OS, the development environment and also the iPhone are completely new to me. I’m proceeding very slowly, step-by-step, looking at the absolute beginners tutorials to whatever topic I have to learn during my work.

It’s amazing how high the cost of doing things is when you’re learning a new language. In Java I am so used to my development environment and the Java way of thinking that I can create a new class definition in an instant, and I don’t have to doubt myself whether or not it was a good idea, or if it was implemented in the right way. But in Objective-C I am still a newbie, doubting myself, and making a lot mistakes along the way, so the cost of creating a new class is incredibly high compared to a language that I already know. My newbie solutions won’t be perfect, or elegant, and sometimes they might clash with the iPhone ‘way of thinking’. It will take some iterations to get this up-to-speed. Knowing myself, I think I will continue to harbor a slight feeling of frustration with the whole system until I can at least develop at the same speed as I can in Java. That reminds me of another Dutch saying: “That will only happen when Easter and Pentecost will occur on the same day”… 😀

Advertisements

1 Comment »

  1. I agree that it’s much more enjoyable to program in Python or something of the like than C, or Visual Basic (sucks!).
    About the iPhone, I’m not aware about how much computing power the Android phone has, but there are still computations limits (RAM and processor speed) that are obsolete in modern computers. Can you remember the last time you used a computer with 64 MB of ram? Could you run Java on it? Effectively? I’m sure that the fact the last iPhone (3GS) got an update to 250 MB is gonna change a couple of things. But it won’t still run Java, for sure! 🙂

    Comment by Alex — October 21, 2009 @ 5:38 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: