Live data from Hacker News

Java Turns 25 – Whats Next? [pdf]

oracle.com

111–120 of 286 posts

Re: Java Turns 25 – Whats Next? [pdf]

#112

Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Foundation), governments, big tech companies such as amazon, ibm, google, apple for many large scale services. It can do web, ml, GUIs, it's still strong among academics. On top of that it offers a great programming experience with excellent IDE support and it's…

Ironically, while Java was the original "write once, run anywhere" language, it never succeeded in that regard (e.g. browser applets were never popular). Ironically, I believe Javascript has. I was pretty much exclusively a Java programmer for the first decade and a half of my career, before moving to Node and TypeScript. I don't think I could ever go back at the point. Most importantly, this is my first time where t…

I use typescript a lot. It's way better than JS but the type erasure problem is far worse than Java. Essentially all types are erased, so bugs where typings don't match what you expect and everything blows up are common. This isn't possible in Java because it's statically typed at runtime.

JS also uses several times more memory, is slower, and has a terrible (non existing) threading model. Yes you can run multiple instance of node or whatever, but sharing objects between them requires message passing which is orders of magnitude slower.

Until JS has a good threading model I'm never using it for backend. It's too expensive to use a bunch of single core machines to make up for it.

All of our devs use Typescript and Java daily for front and backend, the only overhead is making sure objects were passing around match on both ends. The only advantage to using the same language for everything is hiring inexperienced devs that don't know both IMO

Re: Java Turns 25 – Whats Next? [pdf]

#113

Java might be the most successful programming language. It is a solid choice among many different fields. It is used on huge infrastructure projects (Apache Foundation), governments, big tech companies such as amazon, ibm, google, apple for many large scale services. It can do web, ml, GUIs, it's still strong among academics. On top of that it offers a great programming experience with excellent IDE support and it's…

Ironically, while Java was the original "write once, run anywhere" language, it never succeeded in that regard (e.g. browser applets were never popular). Ironically, I believe Javascript has. I was pretty much exclusively a Java programmer for the first decade and a half of my career, before moving to Node and TypeScript. I don't think I could ever go back at the point. Most importantly, this is my first time where t…

It succeeded. Early 2000's I converted my company's "document server" from _heavily_ ifdef'd C to Java. It ran on Windows, Linux, AIX, Solaris, HP-UX, and Linux on IBM mainframes. Having EBCDIC as the default encoding for strings really made you pay attention to encoding in and out of Unicode.

Re: Java Turns 25 – Whats Next? [pdf]

#114
post #69

One thing that is hurting Java today is memory usage. Conventional JVMs use a lot of memory relative to essentially everything else and this is drives up cloud bills. There are alternative JVMs and other tools, some of which is embryonic at this point, but what the world wants and what Java really needs to continue thriving is efficient memory use by the bog standard JVMs that work with everything.

That's not always true. Most of the time when Java uses a ton of memory it's because people use the default memory settings. If you tell Java to use up to 90% of system RAM, it will. Garbage collection is expensive so it will delay until memory is depleted.

This is a different GC design than V8 and Go, which use older collector designs with high overhead. They need to collect very frequently because their stop the world pauses get longer with more garbage. Javas new collectors are near constant time, even with terabytes of garbage, so it's much more efficient to wait until the heap builds up and collect much less frequently. Ironically, Java appears to use tons of ram because it has better garbage collectors.

When you configure Java GC to collect frequently, it turns out Java uses 2-3X less ram than JS, and far less than Python, Ruby, etc. It does use more than Go, about 2X. But the point is it uses a lot less ram than most other popular languages for web dev.

Unfortunately the "Java uses too much ram" is used in defence of using things like JS and interpreted languages, when in actually it uses much less if you configure it to.

Re: Java Turns 25 – Whats Next? [pdf]

#115
post #107
post #94

Earlier quoted context omitted.

Actually BEAM and Erlang pre-dates Java. ;-) As for compatibility: why is Java 8 market share so high in 2020?

Shitty Android.

Isn't Android mostly based on Java 7 (for instance, the Guava artifact you need for Android is the Java 7 one)? It can't be the reason why Java 8 is popular.

I believe that the reason why Java 8 is so popular is because there were a lot of backward compatibility problems with Java 9, compounded by the fact that Java 11 (the next LTS after Java 8; both Java 9 and Java 10 had very a very short life) removed many APIs deprecated by Java 9.

Re: Java Turns 25 – Whats Next? [pdf]

#116

Earlier quoted context omitted.

> Use Spring for frameworks. Or Dropwizard if you want microservices that are more light weight and performant than Spring. https://glennengstrand.info/software/performance/springboot/... Or Vert.x or Play if you want to code reactive microservices. https://glennengstrand.info/software/architecture/microservi... > No one does inheritance anymore composition's all the rage. Hmmm, that is oversimplification IMHO. When…

Personal anecdote: I am currently on the job hunt and literally every single position that requires Java also requires experience with Spring (Boot). It might not be the trendiest, but it's definitely the most popular (as in "in demand").

Yeah, that’s horrible. It’s like Spring Boot is the holy grail or something. People should really invest time in researching other frameworks.

Re: Java Turns 25 – Whats Next? [pdf]

#117

Earlier quoted context omitted.

Ironically, while Java was the original "write once, run anywhere" language, it never succeeded in that regard (e.g. browser applets were never popular). Ironically, I believe Javascript has. I was pretty much exclusively a Java programmer for the first decade and a half of my career, before moving to Node and TypeScript. I don't think I could ever go back at the point. Most importantly, this is my first time where t…

I use typescript a lot. It's way better than JS but the type erasure problem is far worse than Java. Essentially all types are erased, so bugs where typings don't match what you expect and everything blows up are common. This isn't possible in Java because it's statically typed at runtime. JS also uses several times more memory, is slower, and has a terrible (non existing) threading model. Yes you can run multiple in…

> bugs where typings don't match what you expect and everything blows up are common

> the only overhead is making sure objects were passing around match on both ends

Seem like is it a big deal based on the first sentence.

I've never been convinced of the single language argument. Sharing code between frontend and backend sounds good but as in practice there's little overlap... models have subtle differences, there's extra logic server side... All in all it's not very practical.

To me the most awesome part of a fully TS project is that you can use the same interfaces everywhere. If you take the time to define them for any input / output, everything is pretty much guaranteed to be sound.

> the type erasure problem is far worse than Java

Check out RunTypes [1], amazing to guard any incoming data.

1. https://github.com/pelotom/runtypes

Re: Java Turns 25 – Whats Next? [pdf]

#118
post #69

One thing that is hurting Java today is memory usage. Conventional JVMs use a lot of memory relative to essentially everything else and this is drives up cloud bills. There are alternative JVMs and other tools, some of which is embryonic at this point, but what the world wants and what Java really needs to continue thriving is efficient memory use by the bog standard JVMs that work with everything.

That's not always true. Most of the time when Java uses a ton of memory it's because people use the default memory settings. If you tell Java to use up to 90% of system RAM, it will. Garbage collection is expensive so it will delay until memory is depleted. This is a different GC design than V8 and Go, which use older collector designs with high overhead. They need to collect very frequently because their stop the wo…

I'll shamefully admit that I have been running and writing JVM based services for years and I didn't know this. I thought that the fixed memory overhead for a simple JVM service was simply higher than with CPython as a fact of life.

There are times when I'd happily trade more frequent GC pauses for a smaller per-process memory footprint. How do you find a reasonably small Xmx that doesn't lead to OutOfMemoryError exceptions?

Re: Java Turns 25 – Whats Next? [pdf]

#119
post #38

Earlier quoted context omitted.

Other than Effective Java, I recommend looking at some of the Google libraries, specifically Guava [1] and Guice [2] for dependency injection. Java is fundamentally a slow adopter of new techniques (it just got lambdas in JDK 8), but a lot of the Google libraries fill in the gaps. Note that if you are learning Java for Android development, that's a whole different sub-discipline. In that case I recommend the Android…

I would recommend against guava in any modern form of Java. It doesn't provide much over the standard library. As for guice, my preference for reflective runtime injection is Weld since it's the standard reference implementation.

I would still recommend Guava for immutable collections, and for the caching classes, both of which are much better than trying to piece things together on your own.

There are a lot of features that have been subsumed into the JDK, and you should usually prefer the JDK implementation where available. Guava has deprecated the redundant functionality, so if you pay attention to your IDE you will be fine.

Re: Java Turns 25 – Whats Next? [pdf]

#120
post #115
post #107

Earlier quoted context omitted.

Shitty Android.

Isn't Android mostly based on Java 7 (for instance, the Guava artifact you need for Android is the Java 7 one)? It can't be the reason why Java 8 is popular. I believe that the reason why Java 8 is so popular is because there were a lot of backward compatibility problems with Java 9, compounded by the fact that Java 11 (the next LTS after Java 8; both Java 9 and Java 10 had very a very short life) removed many APIs d…

Nope, Java 8 nowadays.

https://developer.android.com/studio/write/java8-support

All libraries that matter on the Java eco-system are already on Java 11.

Post reply on HN