Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 8774
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • 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: 16715
278
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: 16715
278
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: 16715
278
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.
reply
    Bookmark Topic Watch Topic
  • New Topic