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 comments

1

u/deadron Apr 21 '21

If you annotate a file with JBang specific comments is it still really a Java file? At that point it seems more like a JBang script instead.

Having to install JBang instead of a JDK isn't really a benefit because it is not actually simplifying the fact that you need to install something to run your code.

It sounds like it operates as an alternate build system focused on execution instead of packaging that annotates within existing files instead of within an external file. So it actually reduces your portability and ties you to jBang being the only way to execute your project?

2

u/maxandersen Apr 21 '21

it is 100% pure java. thats why it works.

just because you add a pom.xml or a build.gradle file does that make the .java files non-java?

you can install and run jbang in a single curl command - the rest will be dealt with automatically on any java capable OS. Its just easier. but sure, if you do it all manually you can do that. just tedious.

if maven and gradle does not reduce your portability neither does jbang. And you can mix jbang into your gradle/maven projects so I'm arguing its even more portable.

also jbang can export to a .jar like maven/gradle does at that point its no different.

its just much much simpler to get started with and you can easily move from jbang to gradle/maven once the complexity they require becomes relevant for you.

1

u/deadron Apr 21 '21

So its a build system that is making decisions, like declaring dependencies inside project java files, that gradle, maven(even ant) wisely decided were better in external files...

It sounds like the argument is jbang is a build tool that is easier to get started with than maven/gradle. You should focus on that. It seems like a stretch though considering how easy templates make things these days. Build tools are complicated because builds are complicated. A simple maven build file with no custom build options is mostly just a dependency section inside a template.

1

u/maxandersen Apr 21 '21

I thought the same as you 3 years ago - then a took a year off and came back and saw how complex java is in comparison to node, go, python etc. but its ecosystem is much stronger.

java has a ton of unnecessary upfront complexity.

I don't say jbang is a build tool that replaces maven/gradle - i say you should use those when the complexity justifies it. My argument is that the usecase for much simpler approach is much larger than most people think (because we all been made dependent on complexity first).

→ More replies (4)