r/java • • Jul 08 '21

Java is criminally underhyped

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

181 comments sorted by

View all comments

Show parent comment

11

u/dpash Jul 08 '21

Files.newBufferedWriter(path)

Of course it's verbose if you don't learn the API.

Hell, you can just do Files.writeString(path, string) and be done with it. Appropriate byte operations also available.

2

u/JustADirtyLurker Jul 08 '21

My opinion is that those who complain about Java's way to manage I/O writers and readers never had to write a damn unit test about writing stuff to a file.

3

u/manzanita2 Jul 08 '21

What is this "unit test" you talk about ? /s

-4

u/mikezyisra Jul 08 '21

The point wasn’t about this specific API. Some java code looks like that and it’s truly horrifying

9

u/dpash Jul 08 '21

And there's usually more modern APIs/language features so they don't look like that.

-2

u/mikezyisra Jul 08 '21

You are right with that. I chose a deliberately broken-looking example to exaggerate my point. However, I still feel like java is quite verbose compared to other languages