Cross Platforming: Switching to Java?

Started by
11 comments, last by excito 8 years, 3 months ago

Oh, well, but is not maintaining Java on multiple platforms way easier? Once I am done checking whether my libraries and everything is perfectly working for all the operating systems, it could not be such a hassle as in C++ whenever I want to change just a little thing?


If you are changing just a little thing and it breaks a platform, something is horrifically bad with your code.

That said, set up a CI (Continuous Integration) system. You shouldn't manually compile and test each change for each platform. A CI system will check your changes for you either after every single commit or even before each commit (if you're using a change review process, i.e. pull requests in git).

There are a number of relatively cheap services or free tools for setting up CI that will work for all interesting platforms (Windows, consoles, Android, iOS, OSX, Linux, etc.).

Yes, I think the way I thought about "changing the code" and maintaining every little change was way too extreme.

Are there any free CI you can recommend? I read a bit about Jenkins.


Well so this basically backs up using Java in terms of cross platforming, right? Java is a not an unfamiliar language to me. I am just not a huge fan of it.
You mentioned that using multiplatform libraries would greatly reduce the effort I would have to commit using C++. However is it not a really exhausting progress to keep all my builds working?

For a new project, perhaps. I just don't think the costs of compiling and deploying a project on multiple platforms add up such that they outweigh the cost of switching to a new language midstream. I also don't think it's as exhausting as you make it out to be. Using cross-platform libraries, you should rarely, if ever, touch any platform-specific code.

Ease of cross-platform testing and deployment is certainly a rational factor to consider when selecting a language in the beginning of a project, but it's not a reason to switch languages halfway through.

Thanks for your explanation!

As I said above in this post, I already gathered experience in Java.

Fast development is not really for what I am looking. I just like the idea of having something that is cross platform once done well. Having one final application that supports so many operating systems (including mobiles) sounds like a really wonderful concept.

How would an application in C++ be more stable?

This whole cross platforming support really makes me anxious about programming in the future. On the one hand it feels like something I really want to support for my applications but then again being bound to Java to achieve this feels really restricted.

I meant making a C++ stable application, not that C++ is more stable than java.

C++ can be easier to use as Java if you are experienced enough, I don't think it should be your limitation.

Your considerations should focus on all aspects of the technologies:

- Experience with it (The quickest rode is the one you know),

- Limitations (Is there X/Y/Z in this technology).

- What kind of platforms you want to work with.

- Performance of the technlogoy (And your performance goals).

- Deploy costs.

- Much more...

As I said in my previous post, you should stop thinking about it so much and keep it as a tool in your toolbox to use when you really need to,

and not when Cross-platform seems neat to you.

Thanks, you are right. In the end I also want to learn something and messing with cross-platforming or providing one application in C++ for multiple operating systems should be a part of that I assume.


Oh, well, but is not maintaining Java on multiple platforms way easier?
I might get downvoted but I'm going to say yes. Library linking/loading is standard and behaves the same in all the OSes that (desktop) Java supports.

Now the issue is that desktop Java isn't the same as Android Java. Yes, with desktop Java you get fairly simple multi platform support in all major OSes, with deployment of the application itself as simple as copying exactly the same .jars in all of them. LWJGL is well made, it will automatically load the native lib of the platform you're running the application on (for all the combinations between Linux, Windows, OSX, x86, x86_64).

But Android is different, you will have to code specific parts for it (input, display, sound, etc), moreover, you will need to "downgrade" your language support for whatever Java 6/7 bastard Android supports nowadays. iOS was supported through RoboVM for free, but Xamarin bought the company and moved it to their kind of strategy (ie, gotta pay up monthly). Same scenario if you want to use C#.

Also while you can reasonably expect the runtime of any OS to run your C++ program (or at worst you need to bundle some tiny binary, say a MSVS2015 redistributable), with Java you need to either bundle a 40-60Mb VM (not as complex as it sounds though) or provide a link for the user to download the VM from Oracle's site (and remember, Oracle bundles crapware with their JRE isntallers). Moreover, the "executable" itself might be multi platform, but it wont get you an OSX installer, Windows installer or a .deb package. That part you have to do on your own, probably regardless of the language you're using.

I still think its an scenario better than what you're left with C++, there are plenty of parts of the standard lib that are the same across desktop and Android, deployment is simpler albeit heavier, and ultimately, Java is a much simpler language to manage than C++.

Thanks, this really gave me an insight!

I thought about what have been said in this thread and how I personally feel about this decision. In the end I came to the conclusion to stick with C++.

Advertisement

Are there any free CI you can recommend? I read a bit about Jenkins.


I've used Jenkins for several years and I like it.


Are there any free CI you can recommend? I read a bit about Jenkins.

http://travis-ci.org - CI service, free for opensource projects.

This topic is closed to new replies.

Advertisement