• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

My first small project with Java

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I've just made my first small project with java, I've been learning java for 3 weeks now and i wanted to test myself with this project.
The project's concept is about trying to guess names given randomly by the computer and the more you guess the harder it becomes

any feedback is much appreciated. Thank you

https://github.com/Night9O/GuessTheName
 
Saloon Keeper
Posts: 10930
87
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most members and visitors will not click on unknown links. Please cut and paste your code into a post and UseCodeTags (<-link).
 
Sheriff
Posts: 17702
301
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you commit to source control, you'd normally commit the file name as is, not change it to something like GuessTheName_SourceCode. I expected to see GuessTheName.java instead since it's a Java program.
 
Junilu Lacar
Sheriff
Posts: 17702
301
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good attention to formatting and indentation!

Many of the names don't follow the normal Java convention for capitalization though. Method names and variable names start with lowercase letters and camelcase for any other words so RandomNameGenerator should be randomNameGenerator instead, PlayerLevel should be playerLevel and so on.
 
Junilu Lacar
Sheriff
Posts: 17702
301
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some methods are way too long and do way too much. The random name generator method and the probability method in particular are just monsters. Consider applying the Compose Method Refactoring to make the method shorter and to a single level of abstraction. Eliminate duplication as well.
 
It looks like it's time for me to write you a reality check! Or maybe a tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic