Live data from Hacker News

A few days of programming on iOS and Android illustrates a vast difference.

plus.google.com

91–97 of 97 posts

Re: A few days of programming on iOS and Android illustrates a vast difference.

#91

Earlier quoted context omitted.

>Thanks, but I guess I didn't get across how much I still hate Java. ;) Can't solve that.. ;) ;) >I feel it has 95% of the problems of C++, without the advantages (predictable speed, mostly). I suppose you'd have to get a little more particular in the 95% of problems angle. I have been working with Java for quite some time and TyphonRT contains necessary workarounds or API extensions enabling predictable speed. For i…

>>I feel it has 95% of the problems of C++, without the advantages (predictable speed, mostly). >I suppose you'd have to get a little more particular in the 95% of problems angle. Hmm...getting very much off topic here, so I want to keep this brief, but roughly speaking I'm talking about the problems of the language being very verbose and missing a lot of useful features: no duck typing (C++ at least has templates, w…

>Hmm...getting very much off topic here, so I want to keep this brief ... the problems of the language being very verbose and missing a lot of useful features

Yes, let's not belabor things, but I do want to point out that Scala essentially covers all of the points you raised. It supports duck typing (type safe too!), coroutines, first-class functions, and is more syntactically elegant. Scala even supports a particular mechanism to "sort of" support primitives w/ generics with the @Specialized annotation. So yes, I'm turning to Scala to provide additional language features and it's especially cool keeping type-safe aspects and being able to do joint compilation, so this works well for desktop / J2SE & Android integration. Of course Scala on top of the finely tuned TyphonRT / Java COP API and such is nice; more concise code for sure; this in addition to having access to all of the Java and/or Android SDK and 3rd party libraries. On the Java tip too regarding generics / Object situation TyphonRT has primitive collections available as well which is the main use case.

> Lua can act object-oriented if you want it to, but you can also use it in other ways that simply make more sense to the problem at hand.

I'd argue it's not a silver bullet as a primary language to write an entire game / engine in w/ more discussion continuing along those lines; there seems to be flexibility gained and lost. As a scripting engine that's one thing, but not a catch all for everything.

The important part here though and hopefully this ties back in a little with the OP and your concerns is that there are options available to take the edge off of mobile dev Android or otherwise and things should radically change in that regard in the next couple of years.

@seclorum is certainly correct that cross-platform mobile dev with OpenGL/ES is not out reach at all and once the C/C++ or Java decision is made depending on dev flexibility one can be creating rich content games not limited by a particular mobile OS concern.

Ultimately you want to pick the tool you are most comfortable and proficient with as in regard to indie game dev there are many other fish to fry let alone the hit based nature of the current app stores.

>For what it's worth, Moai does come with things like physics; not sure how they bind things together, but I would have guessed that they have a very basic engine with game objects. Could be wrong.

From what I read Moai supports Box2D. You know who else supports Box2D; everyone... BatteryTech, libgdx, TyphonRT, the list goes on, etc. etc. ;) It does sound like there is a basic game object API in Moai, but it only is geared towards 2D presently.

I know Robert of BatteryTech is doing a whole lot of Lua integration and work with BatteryTech, so do take a 2nd look and drop him an email perhaps.

>JavaCPP looks interesting

Indeed.. It's the 1st JNI / native marshaling assistance API that I like that takes the pain away of hand rolling JNI code. :)

>Yes, but it's the API for getting events

This is abstracted with most middleware mentioned. In fact input control is the largest category of core architecture components in TyphonRT (almost 10%).

>putting up native dialogs, etc. that will be non-native everywhere.

Why would you do this if you are creating an OpenGL/ES cross-platform game? Use a GL based GUI that will be cross-platform!

>It's just not my thing, since I'm not a Java person.

Fair enough hence why I'll stop posting on the thread! :) Though I did want mention some responses on the off the top general criticisms at the front of this reply. JVM languages will breathe some life into the Java sphere of things. This in concert with well developed middleware will make a lot of things that are hard now much easier soon enough.

It gets better.. ;P

Re: A few days of programming on iOS and Android illustrates a vast difference.

#92
post #78

Counterpoint: I just began developing my first Android app a few days ago, a turn-based strategy game. I've only had an Android device for a month or so so the platform is relatively new to me, and I didn't even know Java (although, to be fair, I knew C# fairly well a couple years ago, which is arguably the same thing plus type inference.) In a few days, with relatively few problems, I was able to build an app and I'…

You're high on the post-development rush. It's addicting. But it doesn't mean the platform will scale with you. I've done extensive iOS and Android development (more extensive on the Android side due to business necessity). Here's some gotchas that I've encountered, from memory, because these are only the recent ones (plus one or two memorable ones from way back). EDIT: Disclosure - I am one of the rare types who is…

You've really nailed it here. The way I look at it, though, is that it is easier to become competent at iOS development because of the ability of the framework to support robust code and the sheer number of worked out examples. Being an Android programmer means that you've gone through your apprenticeship where you've spent hours if not days with ContentProvider, RelativeLayout, AsyncTasks, Handlers and maybe even ConcurrentLinkedQueue(s).

Most of my iOS developer friends have no desire to learn Android. That is what makes Android development hot - as you have very little overlap of iOS and Android. Believe me, I've paid for attempting to switch back between iOS and Android with splitting headaches (if not done on separate days). I don't believe people who specialize in both.

You left something off your list, the sheer insanity of async loading images into a ListView. iOS developers have EGOImageView, we have a few competing implementations, including writing your own.

> I am of the opinion that in order to build a stable, robust app, Content Providers, at the very least, are required (for many reasons,

One way to see if someone knows what they are talking about is to ask them about multi-table content providers.

Also, what phone does the candidate have in his or her possession...

Re: A few days of programming on iOS and Android illustrates a vast difference.

#93
post #2

Android is not a toy, you can easily see it's an improvement over traditional mobile, and it highly influenced by the web. I fought Android until I decided to throw my entire weight behind Java and settled on it as a platform. Don't fight it: learn Java proper, do a few SWT & Swing apps, feel the burn .. then do Android. You can ignore the abstractions and just "draw up" your application with Eclipse, inside one gian…

Just a point that needs clarification: how is any of this comment relevant to the points raised in the OP? That is, how does this help against the fact that Android has: * A much more complex set of (good!) abstractions that are poorly documented; * and, if I might add alongside the OP, requires a much higher workload in terms of code length and complexity, debugging, device configuration management and tools for wha…

> On Android, I would have to plan for it from the beginning and set up very poorly documented IBinder stuff to have my Activities talk to a background Service.

An Android developer grows up once they have to deal with Activities going poof.

To be fair, services and content providers enable widgets. Widgets are a differentiator.

Re: A few days of programming on iOS and Android illustrates a vast difference.

#94
post #78

Earlier quoted context omitted.

You're high on the post-development rush. It's addicting. But it doesn't mean the platform will scale with you. I've done extensive iOS and Android development (more extensive on the Android side due to business necessity). Here's some gotchas that I've encountered, from memory, because these are only the recent ones (plus one or two memorable ones from way back). EDIT: Disclosure - I am one of the rare types who is…

You've really nailed it here. The way I look at it, though, is that it is easier to become competent at iOS development because of the ability of the framework to support robust code and the sheer number of worked out examples. Being an Android programmer means that you've gone through your apprenticeship where you've spent hours if not days with ContentProvider, RelativeLayout, AsyncTasks, Handlers and maybe even Co…

Google provides an ImageLoader library. It kinda sucks, and occasionally causes Application Not Responding errors or out-f-memory exceptions in my company's apps, but there's nothing better that's open-source. I wrote something pretty cool at my previous job that unfortunately probably will never be open-sourced that pipelined and cached image fetching, and supported a responder-chain like pattern for handling the images, as well as decoding it to a limited size rather than fully decoding into a full-sized bitmap and then resizing, as that would occasionally fail due to the bitmap decoder deciding to return null sometimes - probably in low-memory cases.

Re: A few days of programming on iOS and Android illustrates a vast difference.

#95
post #94

Earlier quoted context omitted.

You've really nailed it here. The way I look at it, though, is that it is easier to become competent at iOS development because of the ability of the framework to support robust code and the sheer number of worked out examples. Being an Android programmer means that you've gone through your apprenticeship where you've spent hours if not days with ContentProvider, RelativeLayout, AsyncTasks, Handlers and maybe even Co…

Google provides an ImageLoader library. It kinda sucks, and occasionally causes Application Not Responding errors or out-f-memory exceptions in my company's apps, but there's nothing better that's open-source. I wrote something pretty cool at my previous job that unfortunately probably will never be open-sourced that pipelined and cached image fetching, and supported a responder-chain like pattern for handling the im…

For our most recent project, we took GreenDroid and extracted its AsyncImageView stuff, removed or changed GD dependencies, and changed to a SD file based cache. The GreenDroid open source code supports many of the concepts you mentioned, including the responder chain.

The SKImageDecoder returning null is a pain.

Thanks for your reply. Check out http://droidux.com (just saw a tweet about it)

Re: A few days of programming on iOS and Android illustrates a vast difference.

#96

Earlier quoted context omitted.

>>I feel it has 95% of the problems of C++, without the advantages (predictable speed, mostly). >I suppose you'd have to get a little more particular in the 95% of problems angle. Hmm...getting very much off topic here, so I want to keep this brief, but roughly speaking I'm talking about the problems of the language being very verbose and missing a lot of useful features: no duck typing (C++ at least has templates, w…

>Hmm...getting very much off topic here, so I want to keep this brief ... the problems of the language being very verbose and missing a lot of useful features Yes, let's not belabor things, but I do want to point out that Scala essentially covers all of the points you raised. It supports duck typing (type safe too!), coroutines, first-class functions, and is more syntactically elegant. Scala even supports a particula…

OK, just going to answer a few points, to try to wrap this up. :)

>I'd argue it's not a silver bullet as a primary language to write an entire game / engine in w/ more discussion continuing along those lines; there seems to be flexibility gained and lost. As a scripting engine that's one thing, but not a catch all for everything.

I write a lot of the core "engine" in C++ for speed and lack of garbage creation. The game I've got on the Android market right now has about 3149 lines of C++ code specific to the game (not counting 7400 lines of auto-generated Lua bindings), but 10k lines of Lua code. Most of the game code is in Lua; is that scripting?

The engine itself has about 10k lines of C++ code, and very little Lua. I want the engine to be as fast as possible, so it's hard for me to imagine doing it in a language that isn't C or C++.

>>>putting up native dialogs, etc. that will be non-native everywhere. >Why would you do this if you are creating an OpenGL/ES cross-platform game? Use a GL based GUI that will be cross-platform!

Geting UI right is really, really hard. For the primary game UI, and dialogs with buttons, sure, all of it happens in GL.

But if I want a list dialog, or a grid view, or a WebKit view, I'm not going to want to do my own halfway implementation -- I'm going to want a dialog with a native feel. There's no game anywhere that I've used that really gets anything as simple as a keyboard entry field completely right, if it doesn't use the native UI; there are some things better left to the UI experts.

A good friend of mine is a big Scala fan, but I haven't really explored it as an option.

The thing that kills Scala for me (without knowing anything else about it) is that most platforms I write for don't already have a guaranteed JVM -- iPhone and Windows being big ones. I mean, sure you almost always have SOME JVM on Windows, but I'd likely want to be shipping a specific JVM.

And that means adding multiple megabytes onto my package size. You've got 20Mb on iPhone if you want to be able to download over the air. Adding 5Mb to support a language...isn't an option.

LuaJIT takes up about 50k. With all its libraries. And performs on par with Scala. Which is a huge win for me. How much overhead does Scala add to an app on Android? I bet it's more than that, even with the guaranteed JVM (well, DVM) preinstalled.

Re: A few days of programming on iOS and Android illustrates a vast difference.

#97

Earlier quoted context omitted.

>Hmm...getting very much off topic here, so I want to keep this brief ... the problems of the language being very verbose and missing a lot of useful features Yes, let's not belabor things, but I do want to point out that Scala essentially covers all of the points you raised. It supports duck typing (type safe too!), coroutines, first-class functions, and is more syntactically elegant. Scala even supports a particula…

OK, just going to answer a few points, to try to wrap this up. :) >I'd argue it's not a silver bullet as a primary language to write an entire game / engine in w/ more discussion continuing along those lines; there seems to be flexibility gained and lost. As a scripting engine that's one thing, but not a catch all for everything. I write a lot of the core "engine" in C++ for speed and lack of garbage creation. The ga…

> OK, just going to answer a few points, to try to wrap this up. :)

And for the wrap up wrap up ;P

> I write a lot of the core "engine" in C++ for speed and lack of garbage creation.

Most definitely. That was all I was getting at is that the core engine should be as fast as possible.

What game on Android Market BTW? Would be glad to check it out and support yah! :)

> Geting UI right is really, really hard... But if I want a list dialog, or a grid view...

Indeed.. UI is hard though I'd say list dialogs and grid view is still GL possible without too much difficulty given various tool kits. Yes a WebKit view is difficult to pull off cross-platform presently. There are options like Awesomium though I've yet to see it used on a mobile platform, however I'm sure something will come up soon.

Yes.. a keyboard entry field depending w/ a GL UI in conjunction with say popping up the default native UI keyboard for touch only devices is something that would need to be fine tuned.

I plan to tackle general GL UI matters at a future point to offer a nicely integrated set of optional components. You are right though it's generally difficult.

For aspects in TyphonRT that require local / native peers the main application container is loaded declaratively with a cross-platform interface component backed by the proper native implementation, so from the devs perspective they can just request the common interface and the platform specific aspects are active behind the scene.

>... most platforms I write for don't already have a guaranteed JVM

Yes, for a desktop release it might be pertinent to distribute a private stripped down JVM. For mobile.. Well.. It's not easily feasible or likely allowed if I recall in the TOS to have a JVM on the iPhone. Cross-compilation is the likely way to go if / when TyphonRT supports iOS.

>How much overhead does Scala add to an app on Android?

Yeah you got me there.. ;) If one uses the Scala standard library that jar file is ~8MB. Whether that can be split up and paired down I'm not sure yet. I'm close to starting on Scala integration (mind you this is optional w/ TyphonRT).

There are also platform aspects of TyphonRT that will reduce overhead for multiple apps installed, but this gets into a bit more conversation here than necessary; essentially though side-loading shared components installed by other apps thus minimizing each app requiring a large download.

So yeah, some work and experimentation ahead. I'll definitely be working on a minimum profile (if possible) for Scala integration.

Post reply on HN