File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes could someone can take a look at my code and leave feedback? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "could someone can take a look at my code and leave feedback?" Watch "could someone can take a look at my code and leave feedback?" New topic
Author

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

Mario Leo
Greenhorn

Joined: Mar 27, 2013
Posts: 2

i also have another one_____________________

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40034
    
  28
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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: could someone can take a look at my code and leave feedback?