r/learnjava • • Nov 24 '20

Any Java project suggestions?

Hello all. I'm new to Java(coming from Python) and Python(for me) is very different. I want to get good at Java because I would love to develop android apps and desktop software in general. And I came here for some suggestions. I came up with a project myself(Discord bot), but the API was so complicated I couldn't follow, and so I'm here looking for other ideas. Thanks in advance.

45 Upvotes

30 comments sorted by

View all comments

3

u/knoam Nov 25 '20 edited Nov 25 '20

Were you using the API directly from Discord documentation? It's probably easier if you use a wrapper library. I just found 2 by googling "java discord api wrapper".

APIs are invaluable if you want to make anything significant. They're definitely something you'll want to learn fairly soon. But I can understand if they're a bit overwhelming since they'll hit you with a bunch of new concepts at once. I unfortunately don't know any good explanations off the top of my head to point you to. I learned it myself pretty gradually over time. If you tell me more specifically what you're getting hung up on maybe I could help point you toward something.

Learning Android is a lot more complicated than learning an API. It's just that it's more straightforward to find a tutorial or class that will walk you through it.

1

u/Aeternus44 Nov 25 '20

Hello. Thank you for taking the time to answer, I do truly appreciate it. For the Discord bot, I was following along a video that was using a dated version of JDA, and I got stuck having to adapt the new one to the code in the video. It frustrated me somewhat quickly. And what frustrated me even more, is that I did everything right, adapted the new code well, but still it didn't work. The bot just sat there and didn't react to anything I did(although I set it to react in certain ways).

2

u/knoam Nov 25 '20

The other library, Discord4J has been updated just 2 days ago, whereas JDA has been last updated in June. JDA has more stars on GitHub so it wasn't a bad choice at the time, but given your problems I'd try Discord4J. Unfortunately with free libraries like these the developers tend to just be working on a volunteer basis so you can't expect too much. And for something like an API wrapper library like this, a lot of more capable developers that could help maintain the library aren't going to bother trying to use someone else's library that's fraught with risks like this when they could more easily use the REST API directly.

It's bad news to be making changes to something before you have it working. Having something working that you can fall back on and try again is way better.

1

u/Aeternus44 Nov 25 '20

I guess I'll try my luck at Dicord4J. Thank you for the help.

1

u/knoam Nov 25 '20

I think I misunderstood. If it's the video you were following that was outdated then I'd find another video or tutorial to follow. And just start small. You have to be able to successfully connect before your chat bot can try to react to something. Did it connect successfully? At that point you're trying to debug to figure out what's going on, which is a whole big skill in itself. Throw in some logging and try hooking up your debugger and step through your code.