Looking for Feedback on My Java Random Name Generator

0
0
Asked By CreativeCoder92 On

Hey everyone! I've just started learning Java a couple of weeks ago, mainly to create mods for Minecraft. Once I get the hang of Java, I'm planning to dive into C# and explore more in game development.

To challenge myself, I created a random name generator that aims to produce unique names rather than random gibberish. I think I'm done for now, but I'm open to adding more features later as I continue learning.

I'd love to hear your thoughts on my coding! Am I doing well, or is there anything in my approach that might cause issues down the line? Am I cluttering my code unnecessarily? I want to avoid forming bad habits while I'm still figuring things out.

You can check out my project at my GitHub: [RandomNameGenerator](https://github.com/Vember/RandomNameGenerator). Thanks for any feedback you can provide!

1 Answer

Answered By CodeNinja7 On

Overall, your project looks solid! Here are a few things I noticed:

- Pay attention to pluralization! For example, `Name names = new Name()` seems inconsistent. Is it supposed to be one name or multiple?
- In your `Name` class, you've hardcoded the lengths of some arrays. This can lead to maintenance issues because if you need to change something, you'll have to update multiple locations.
- In the `UserInterface`, consider using a data structure for user actions instead of having the logic scattered throughout your code. This way, if you need to adjust the actions, you only need to change one spot!

NameWizard88 -

I appreciate the feedback!
- Changing the class name to something like "NameGenerator" sounds better.
- About updating string arrays — I wasn’t looking to implement dynamic arrays but will think about how that impacts future usability.
- And yes, I'm referring to the `processCommand` method — I'm following the course structure, but maybe I should rethink how I organize these methods!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.