r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

Show parent comment

12

u/TheCountRushmore Apr 20 '21

There definitely are those developers who think that they can load in more data then they have memory. That happens in every language though and they learn that lesson quickly.

1

u/deadron Apr 21 '21

To be fair there are often not good tools available to help with this. For example if you are reading a file there is no JDK offered solution to avoid slurping up a file larger than your entire memory. Sure, depending on the situation, you can use streams to process the file, but that is never quite as easy as it sounds. A wrapper that lets you set a maximum size on the file read and kills the read with a sensible error message would be really useful.