Live data from Hacker News

Java for Everything

teamten.com

41–50 of 344 posts

Re: Java for Everything

#41

Java is perfect also for client side. We have a client app (a complex VoIP softphone) with different codebase for all platforms (C++ for windows, java for android, ObjectC for iOS). Right now we are in the way to reduce all this in one single codebase written in Java and the user interface in html/css/javascript, so the user interface is always running in a webview. -Java for windows desktop (there are pretty install…

> Java is perfect also for client side. Unless you want it to look totally native client-side. The extra effort required to make a Java app look platform native is something that (near as I can tell) no one has ever attempted.

For the UI we are using html in webview. So the app "engine" is all in java, only the UI is html (so this is also cross platform)

Re: Java for Everything

#42
post #29

Earlier quoted context omitted.

On mobile devices the issue is Oracle dropping the ball and leaving to third parties (RoboVM, CodenameOne,...) the work of providing JVM implementations. This on iOS, still no story on Windows Phone, which actually happens to be over iOS on some European countries.

On Android you already have java :) The big question is iOS for which there is no mature tool yet. hopefully j2objc will be enough. Windows phone ...i think that we will wait to see a higher market share before to dig into it

> On Android you already have java :)

Java 6! Java 7 is only fully available for 4.4 upwards, and only the language, with cherry updates for the library.

Meanwhile one needs to resort to Xtend and Scala, if I want to enjoy a bit of Java 8 on Android, across versions. Or use hacks like retrolambda.

On Windows Phone vs iOS, it depends on your target market. On countries like mine (Portugal) you will surely see more WP on the street.

Of course, US and others are a different matter.

Re: Java for Everything

#43

It's not so much that Java is great at everything. It's more like it doesn't suck at anything. Every other language has, somewhere, a deal-breaker for some particular use. I've not found one for Java. And Java's biggest downside, frankly, is that it hasn't attracted fresh young talent in a while, so it doesn't have really hot frameworks and libraries.

While I do think Java is great I think that's an exaggeration, I'm sure there are quite a few deal-breakers for particular uses. Personally I've opted not to use Java before because it cannot compile to a self contained native binary.

Re: Java for Everything

#44
post #32

Earlier quoted context omitted.

I think the difference is that stuff is less hastily cobbled together. People use additional libraries because they add value, not because they paper over ugliness and holes of existing libraries. Scala feels "designed", while Java feels "evolved".

Yet I have 99% probabilities that my next JVM gig will be Java than Scala, as very few customers ask for Scala skills on their Request For Proposals.

How is this related to the topic?

Re: Java for Everything

#45

Java is perfect also for client side. We have a client app (a complex VoIP softphone) with different codebase for all platforms (C++ for windows, java for android, ObjectC for iOS). Right now we are in the way to reduce all this in one single codebase written in Java and the user interface in html/css/javascript, so the user interface is always running in a webview. -Java for windows desktop (there are pretty install…

For development speed and code maintenance, this is ideal. Your team only needs to master one language and its set of tools and libraries. You are pinioned by this choice on some practical levels. Mainly, some users and use cases demand the speed and lightweight user-experience of native apps. The native-vs-[java] experience is typically quite noticeable on all the platforms you've mentioned -- desktop, web, and mobi…

Right now I am working on the windows desktop app. I can tell you, that you don't notice any difference at all in speed (I also wrote a simple "container" app in native c++, so it is also loading instantly ..there is a ~2 sec delay to load the JVM, but meantime the user already sees the UI)

Re: Java for Everything

#46

You have to admit that for coders, the joy of writing helps a lot for job satisfaction. I write both Java and Python (for very different applications) and I just always feel like Java makes it hard to write anything elegant almost on purpose. The proliferation of huge frameworks and FactoryFactories clearly doesn't help. I think you can underestimate the value in actually enjoying writing - I'm just more motivated ev…

The problem is that one guys "Joy Of Writing" rapidly becomes the next guy's "Torture Of Reading", and with enough of a time-interval those two can be the same person.

Re: Java for Everything

#47

The problem with verbosity and repetition is not that it takes longer to type the code, at all. The problem is that it creates dependencies which you have to manage by hand. Changing `Foo a = new Foo()` to `Bar a = new Bar()` doesn't seem that bad... except when you have to propagate that change through the code base. Half of Java's tooling is dedicated to solving a problem that doesn't exist in good duck-typed langu…

DISCLAIMER: I write mostly java, at home and at work. Refactoring goes a lot further than just renaming types. A refactor script _WILL_ rename both sides of 'Foo x = new Foo();' to 'Bar x = new Bar();', so given the right utilities (and if you use java for everything, it's _MUCH_ easier to become an expert at the tools!) this is not any more effort at all. However, there are refactors for things that are much more di…

Refactoring goes a lot further than just renaming types. A refactor script _WILL_ rename both sides of 'Foo x = new Foo();' to 'Bar x = new Bar();', so given the right utilities (and if you use java for everything, it's _MUCH_ easier to become an expert at the tools!) this is not any more effort at all.

Ctrl-Shift-R B A R

No, not much effort at all. Just twice as many keystrokes.

I wouldn't even mind the verbosity if it actually gave me some speed improvements, but it doesn't. There are plenty of statically typed languages where you just write x = new Foo() and the compiler will figure out the types for you.

Re: Java for Everything

#48
post #9
post #8

I would just add one more thing - I doubt there is another language where you write native apps for Android, iOS and Web sharing 70% of the code: http://arstechnica.com/information-technology/2014/11/how-go...

C++ (Using something like emscripten for the web) Although, i'd pick java over C++ unless i'm doing some very performance critical

While true, it is a pain on Android, given how the Android team treats the C and C++ developers.

The official set of APIs is quite limited and JNI is required for any app that isn't a game.

Even C++ libraries that are wrapped in Java classes, like SKIA, are only accessible via JNI.

Re: Java for Everything

#49
post #15

> I’m even taking this to an extreme and using Java shell scripts. Having a strong Java background, it is a pleasure to write Groovy for shell scripts. I like the blog post. Whenever I looked into other languages/platforms, I found the "tradeoffs" of Java (as pointed out by the other languages/platforms) to be less important for me. Java/the JVM may be evolving slowly. But it evolves and does it in a reasonable way (…

Why not just use Groovy for everything instead of java ?

Because type safety is actually really valuable?

/uses Scala for everything, from scripts to backend. Groovy usually translates 1:1 into Scala, but without sacrificing type safety.

Re: Java for Everything

#50
post #8

I would just add one more thing - I doubt there is another language where you write native apps for Android, iOS and Web sharing 70% of the code: http://arstechnica.com/information-technology/2014/11/how-go...

AS3 - with AIR for publishing on mobile - with SWF to publish on the web (for desktop browsers)

and I would argue with the added bonus that you can share the UI without an horrible result

Post reply on HN