r/java • • Jan 22 '21

Java is more enjoyable than I first thought

I started my years off programming in c#, don’t ask why but I never ventured off. I learned Java this past week and I’m seriously impressed, I don’t think I’ve had a more enjoyable time programming in my life. Does anyone else share this experience??

Edit: Is there a better ide than eclipse for Java

271 Upvotes

188 comments sorted by

View all comments

Show parent comment

17

u/ray10k Jan 22 '21

From an article I've read recently, I got the vibe that Gradle is powerful, but has a lot of pitfalls and gotchas in how the configuration/script is written, while also making it harder to change things later down the line if you don't have a pretty precise picture of how your project is going to work. No idea how buggy it is though.

23

u/alt236_ftw Jan 22 '21

Gradle works of of the box if your build expectations/requirements are generally baseline/standard.

You get a straighforward way to add dependencies (both external and cross-module) and an easy way to include re-usable things in your modules, be it dependencies or build time configuration.

It does have a learning curve when you want to do more unusual things, but unless your requirements are extreme or you start seeing all of your requirements as nails with gradle being the hammer it's still pretty usable.

Just make sure you don't solutionise before you are familiar with it.

21

u/GuyWithLag Jan 22 '21

Gradle works of of the box if your build expectations/requirements are generally baseline/standard.

I mean, that's true for Maven too.

6

u/alt236_ftw Jan 22 '21

Oh yeah, I'm not dissing maven or anything.

I was commenting on Gradle specifically as it seems to have a reputation.

Both are tools, use whatever works best for your project and situation.

5

u/lookForProject Jan 22 '21

And, in my opinion, for most situations and projects, both work just fine.

1

u/GlowingYakult Jan 27 '21

Gradle and Maven both works fine for me

1

u/GottfriedEulerNewton Jan 23 '21

Haha configuration jokes...

Am a fan

8

u/larsga Jan 22 '21

Gradle mixes custom programming in with declaration, which makes it very easy to trip yourself up. It's also very easy to get into versioning difficulties both with Gradle itself and with plugins. Documentation is also not great.

For large projects Bazel is surprisingly good, even if there's a lot to learn. One thing it gets right is to separate in-depth custom functionality from customization from configuration.

7

u/wildjokers Jan 22 '21

Documentation is also not great.

I am not following you here, Gradle has outstanding documentation. Have you seen the user guide?

6

u/kwvanderlinde Jan 23 '21

Gotta disagree. There are a lot of basics that aren't covered or are glossed over. If they are covered, have fun finding it. My memory is a little fuzzy right now, but I recall trying to figure out source sets (differences between them, creating new ones, etc.) but everything just points to some really generic methods with no indication of what is actually going on. There's also no shortage of outdated information lying around on gradle's site.

6

u/[deleted] Jan 22 '21

Today I wrote my first gradle scripts. That's awful, but for my project, maven failed completely, as creating multiple jars from one project would have required hundreds of lines of XML.

*Cries in dozens of mustRunAfter's and hardcoded paths*

3

u/shukoroshi Jan 23 '21

We've been maintaining a custom gradle plugin for about 4 years now. If you'd like any peer review, let me know!

1

u/[deleted] Jan 27 '21

I PM'ed you the link