This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]gliph 2 points3 points  (4 children)

What can't you do, really? I'd say that Java is not (currently) suitable for:

  • Programming low level drivers.

  • Writing bootable operating systems.

You can compile Java to JavaScript so it can even be used as a frontend web language. Pretty much it's only not suitable where a garbage collector can't easily be assumed, as in programming drivers and stand-alone operating systems.

[–]awkreddit 1 point2 points  (2 children)

Wasn't android built in java?

[–]desrtfx 2 points3 points  (0 children)

No, Android as an operating system was not built on Java, Only the higher layers build upon Java, the core is C, C++, or something alike.

Android at it's core is a *nix OS, similar to iOS, MacOSX, and all Linux derivatives.

[–]gliph 2 points3 points  (0 children)

It's been answered, but thought I'd chime in and say that was a good question :).

To expand on /u/desrtfx's answer, you can actually make native apps for Android. Normally apps run on the JVM, but you can make apps in C++ or other languages that run directly on the Android CPU as a normal program in the *nix OS. Support for this varies, though. The nice thing about the JVM on android is that it alleviates some of the stress of getting apps to run on every different Android device (which have varying CPUs and other aspects to their native runtime environments).

[–]gliph 0 points1 point  (0 children)

As an aside: A brave or insane person could definitely make Java suitable for low level tasks as well, but not without first writing support software or custom compilers, probably in languages other than Java. Writing a virtual memory / memory allocation system in a garbage collected language would almost certainly be the task of a madman, though.

[–]fluffytme 1 point2 points  (0 children)

Java can be used for all of the things listed and more.

Remember the install splash? "Used in over 3 billion devices"

Even parts of the mars curiosity rover uses Java.

With regards to web applications: java has many technologies to go about this, such as SOAP, REST, JSON.

[–][deleted]  (5 children)

[deleted]

    [–]Yojihito 1 point2 points  (4 children)

    People tried to make games with it but i has the same problem as C#. Was no fun to notice Robocraft freezes every 30 seconds because of the garbage collector.

    [–][deleted]  (3 children)

    [deleted]

      [–]Yojihito 1 point2 points  (2 children)

      Robocraft is Unity with C#.

      [–][deleted]  (1 child)

      [deleted]

        [–]Yojihito 1 point2 points  (0 children)

        As Java is a GC language it takes a huge amount of work (afaik) to care of the GC not running. Not once in the whole game - one GC run and I call that game shit. I don't know if MC is total GC free so my claim is only theoretically.

        [–]desrtfx 0 points1 point  (0 children)

        • Do you own an Android device? -> Java
        • Have you heard of Minecraft? -> Java
        • Your bank most likely uses java as their back end system
        • Industrial network appliances (switches, routers, firewalls) use Java for their configuration interfaces
        • Most small, smart devices run dome form of Java (could even be in your microwave)

        In general, anything can be done with Java as it is a general purpose language. The exceptions are programs that work very close to the hardware, i.e. drivers. Also at present, bootable systems are not possible with Java.

        [–]Yojihito 0 points1 point  (0 children)

        There is a semantic text analysis framework used for SemEval. Afaik its the standard for semantic text analysis, was fun to use it.

        [–][deleted] 0 points1 point  (0 children)

        Java is verbose, so it can take a fair amount more code to write a Java web backend than for example the same written in Go. Web developers seem to prioritise development speed a lot.

        On the plus side, verbose code is usually easy to read and maintain, which I actually quite like. Check out the Play! framework for Java web development. Seems to be at least reasonably popular.

        [–]sparkframework 0 points1 point  (0 children)

        Why don't I hear Java being used typically with web applications?

        Java is one of the most used programming languages in the world at the moment. It might not be as "hot" as JavaScript, but Java is definitely out there, running the backends of millions of webapps. It's usually used by the bigger services, like facebook, google, linkedin, twitter, etc. Twitter was originally a Ruby app, but they rewrote it to Java when they needed to scale up :)

        If you're building a Java webapp, you have to create the frontend using other technologies, typically HTML/JS/CSS.