Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

could someone can take a look at my code and leave feedback?  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i also have another one_____________________

 
Marshal
Posts: 62231
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post; you should always use them as the make the code look better Unfortunately, they also highlight some formatting problems:-
  • 1: The use of tabs for indenting.
  • 2: Inconsistent indenting. Get a decent text editor, eg jEdit, kate, gedit, NotePad2, NotePad++ and set its “automatic indentation” option. Then lines 11 and 12 would look better. Or use the formatting options in your IDE.
  • 3: Inappropriate documentation comments, and //TODO empty method comments, presumably inserted by an IDE, not deleted.
  • 4: Multiple declarations on one line (eg 12), made even worse by being interspersed with initialisations.
  • 5: No {} after if on line 23.
  • 6: Some lines too long, and too many blank lines; both those things make the code harder to read.
  • 7: Some of the variables’ names do not make their meaning obvious, eg orate.
  • 8: No spaces around some binary operators, eg <
  • 9: Use of the newline character; you should use printf and %n instead.
  • And some design things.
  • 1: Far too much code in the main method.
  • 2: No sign of object‑oriented design anywhere.
  • 3: The meaning of the two loops is not obvious. The first while has a condition which includes redundant parts.
  • Does your code do what you want it to? I think it needs a lot of tidying up, I am afraid.
     
    What's brown and sticky? ... a stick. Or a tiny ad.
    RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
    https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!