So I have barely touched Java in the better part of a year. Yes I have written wrappers around a webview to run the coffeescript code I have been creating. Using Java in anger is something I have not been doing.
I originally left Java in part because I felt frustrated at the lack of proper closures and not being able to pass functions around. Basically I felt I was writing way too much boilerplate code.
I am now back into coding Java. I want to be able to write in one language and deploy what I create to lots of places. I am think in terms of little games that I want to create. Both Javascript and C++ both fit the bill for being about to do but not my bill.
C++ selection of platforms it can deploy to does not fit the selection I won't to deploy to. That is the web, plus I do C++ at work and like a change when coding at home.
Javascript (well CoffeeScript) is what I have been using over the past year for some of my web creations. I have enjoyed it and plan on creating more CoffeeScript code over the coming year. I had been planning on creating a few more games with it when I watched the video of PlayN (well forplay at the time) and thought wow that is what I am looking for. So I decided to have a play and that meant coding in Java.
PlayN is a gaming library/compiler? that lets you code in Java to a custom api for the graphics and sound and then compiles it down to either Java, Android,Flash or JavaScript. It use GWT to do this and is still in the early stages of development. Although if you played the web version of Angry Birds you will have seen it in action. I am going of at a tangent here.
So the reason for coding in Java is I want to play with PlayN and see what I can make.
So How have I found Java?
Well for a start return to eclipse is wonderful all that refactoring tools really make coding feel quick. When you look at the end results I am left with the feeling that the code is not as clean as it could be in other languages. I long for lambda expressions and true closures. Creating anonymous classes and making sure things are final feels, err I am reaching for words, well halfway there and a little verbose.
This is exactly the sort of things that annoyed about Java a year or so ago. Now however I get the feeling that is does not harm productivity that much and with a bit of an effort much of it can be hidden. I am sure that if I understood reflection a little more I could hide more.
So I am trading clarity, and perhaps productivity, in the language and hoping the power of the IDE makes up for it. My gut is telling me the trade off is probably fair and productivity is not effected for the games I want to create. If I was going to create a text heavy game I would probably jump back to CoffeeScript but for arcade and more casual games it should all work our even. Of course coding is really only a small part of creating a game. Both art asset creation and game play balancing can easily take up as much time.
So my return to Java is driven by practical desires to create games with a nice gaming api that can deploy to lots of places.
So my return to Java is driven by practical desires to create games with a nice gaming api that can deploy to lots of places.
No comments:
Post a Comment