Thursday, October 22, 2009

The Matrix Phone Improved - been Objective C, now go back to C++

The first version of The Matrix Phone is submitted to AppStore and is pending for review; however, this is far from the end. I'm now planning to develop a better game scheme for The Matrix Phone.

(Now the geek part)
As my first application that is written in Objective C, it is far from optimal: I were not familar with Objective C at that time - now I realize that the code is a mess, and is almost impossible to refactory to support new gaming schemes. After a period of struggling, I decide to re-write it in C++ (plus some Objective C code for iphone); I just have to do this anyway, maybe The Matrix Phone can be on Microsoft Zune.

Been Objective C, now go back to C++:
I know the STL containers are not the only way, but without them and use NS containers of Objective C just don't feel right! Basically, the NS containers is generic typeless "store-by-pointer" containers like those in Java - but without garbage collection. And you can't store regular C structure by value; and there is no auto boxing/unboxing so even if it is int you have to pack it/cast it back manually with NSNumber. So I avoid using it and end up with stinky malloc.
And string operation using NSMutableString is so painful. Even putting two strings together is a hard job. No simple "+" like Java; no container-like operations like std::string. So I just use C string but that's no better...

No comments:

Post a Comment