Sponsored By

Writing portable code: A process full of gain

In this reprinted <a href="http://altdevblogaday.com/">#altdevblogaday</a> opinion piece, Nlogn Information's Charilaos Kalogirou warns devs about getting comfortable with their target environment, and explains the benefits of making your code portable.

June 21, 2012

2 Min Read
Game Developer logo in a gray background | Game Developer

[In this reprinted #altdevblogaday opinion piece, Nlogn Information's Charilaos Kalogirou warns developers about getting comfortable with their target environment, and explains the benefits of making your code portable.] Lately, I am spending some of my time porting my game engine to the Android platform. It is a rather refreshing, interesting, rewarding and also frustrating experience. All at the same time. The process helped me learn new lessons and remember some old ones I had forgot.

Getting comfortable

First of all, I realized once again that we people get comfortable. And oh boy we get comfortable! I remember myself a few weeks back being frustrated with XCode 4 and how it was slow and sluggish compared to XCode 3, how I don't like the new environment, etc. Well, no more! All it took was a few days in Eclipse. Dialog windows popping up behind the main window, >500ms on most clicks on files, kitchen & sink user interface; I can go on forever, and all you really basically get at the end of the day is just a smart editor and debugger that only works for the Java part. Compare that to XCode with its memory profilers, time profiles, filesystem profilers, network profilers, battery optimizers, the very helpful OpenGL state inspector and logger; there is really no relation. I had forgotten how it was to develop on other platforms, and how amazed I was initially with the special treatment that Apple gives to developers with its tools. What amazed me more is that I don't come from such a "comfy" background. The initial version of Sylphis3D was developed in parallel on Linux and Windows, mostly using no IDE at all, and I never found the tools a problem. As it turns out, hardship builds character, while comfort breaks it.

Portable software is good for you

Building portable software is highly valued in my mind, because it helps you be a better software engineer while making better quality software at the same time. You get to learn many different development environments, understand their design decisions, work around platform differences, think further ahead, etc. All these require you to get a deeper understanding of your code and your dependencies. They always push towards a more organized code structure and reveal bugs that would otherwise go unnoticed until Murphy's law decides it is the worst time to trigger them. So if you are a software engineer, don't get too comfortable with your development and target environment. No matter how attractive that environment makes it! Make your code portable, to keep yourself and the code in better shape. After all wouldn't it be cool to run your code on a future toaster?! [This piece was reprinted from #AltDevBlogADay, a shared blog initiative started by @mike_acton devoted to giving game developers of all disciplines a place to motivate each other to write regularly about their personal game development passions.]

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like