Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Voxera113885yQuick suggestion.
Try to break up the main method into smaller, well named functions.
Try to keep each function less than a page if possible and with at most 2 nested levels.
Smaller methods will be easier to follow and well named function act as in code documentation.
An example: if you have an if with two large parts, break each part into its own method with a descriptive name.
The logic of the if statement will be much easier to see and check for errors.
Same with loops with much content, put the loop in its own function.
Mocup example in no real language :)
Main()
setup();
ProgramLoop();
ProgramLoop()
While(!quit)
Process(GetInput()) -
Voxera113885yAnd, make sure to keep both versions
Just in case the rewrite does not work.
Other than that, looks quite a lot like one of my first programs, but not quite as bloated with unnecessary features ;) -
iiulian8275yThe features are part of the assignment.... they are a pain. Thank you very much for the feedback ;)
-
Heres a tip, instead of
ArrayList<peepeepoopoo> a = ...
You can
var a = new Arrayslist... -
Add a README.md, add the .idea and out folders to a .gitignore, just small git related observations ;)
Related Rants
I am working on a small project for school and want to share it with you. Can you give me some feedback on it? It is a payroll system in which you can register, view and delete employees and also generate payslips. Is my first ever project and I am somehow proud of it but I want to see what optimizations I can make to it if you are so kind to spare a few minutes of your busy life. o7 commanders :P
Here is the link to the GitHub: https://github.com/iiulian8/...
question
project