Version catalogs are a fairly recent feature in Gradle Build Tool. They help manage dependencies by providing a standardized way of defining and accessing the catalog of dependencies used in a project—ensuring that all developers in a team are aligned on dependency names and definitions saves time and cognitive load for everyone. Like most Gradle features they are quite flexible, so users have to come up with their own conventions for how to use them.
It’s possible to use either dashes or underscores to separate segments in the entry. The recommendation according to the Gradle documentation is to use a hyphen.
“hyphen” sounds like a third option here, although it’s just used synonymous to “dash”. I’d recommend to just stick with “dash” consistently.
IMO making users name these entries was a mistake. Dependencies’ names are already effectively constants, it’s versions which change. Constants/accessors that are generated by Gradle should be automatically derived from dependencies themselves.
You are free to name your entries 1:1 from the original names.
But this often then causes very long names and provides less convenient options to group things.
Also, naming is one of the hardest things in software development imho.
And regardless of what way Gradle would have chosen, there would always be people not liking it.
And they followed the same principle Gradle is built on, providing great flexibility if you need it.
Also, naming is one of the hardest things in software development imho.
Yes, and developers of dependencies have already done that for you by naming them.
But this often then causes very long names and provides less convenient options to group things.
You can still have grouping feature (requiring a name for the group) while providing autogenerated names for separate dependencies. And long names are IMO not an issue since you trade that for not having additional names.
My point is that it’s the most common case which should be easy and effortless requires a completely unnecessary boilerplate.
Yes, and developers of dependencies have already done that for you by naming them.
Not really imho.
They did not invent names that are suitable for usage as variables / accessors.
They are partly ugly, redundant, and way too long for that.
And also they are very different when coming from different people.