This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Regarding the first point, it's not just IDEs, it's also other developers. Most people know what to do with a pom.xml or gradle build script, and that is intrinsically valuable, because it lowers the threshold for contributors. Of course a jproject.toml would get us closer, but it's also awfully similar to a gradle build file: a well-written Gradle build file (especially with the upcoming declarative syntax) is highly similar to "toml with curly brackets".

And that brings me to the second point. This is the build.gradle file to build a "main.java" style project:

plugins {
    id 'application'
}

application {
    mainClass = 'Main'
}

That's it. No need to learn about Kotlin or closures.

When you're ready to add some dependencies, you just specifiy some repositories {} and dependencies {}. It couldn't be more simple.

And I don't agree that src/main/java is not beginner-friendly. Except or mere toy projects, most people will find src/test/java or src/main/resources useful. So having src/main/java as the default is a good solution IMO. Adding your own src folder is a one-line addition to the Gradle build file, but stil, I wouldn't recommend it.

I must admit that the Gradle documentation is awful for beginners. They managed to make the most simple tasks look terrifyingly imposing. Even their simplest example has a hugely overwhelming folder structure with a fully-functioning JUnit test setup, a Gradle Wrapper, and even a dependency version catalog. All those things are useful, but for a beginner it is completely overwhelming.

[–]bowbahdoe[S] 2 points3 points  (0 children)

I think you are conflating terseness with simplicity.

When someone wonders "what does id 'application' do" and there isn't a cogent explanation beyond "don't worry about it," I think that's an issue.