Is My Java Program Any Good?

0
0
Asked By CuriousCoder99 On

Hey everyone! I'm 14 and just got into Java programming. I spent a lot of time working on a program and would love to know if it's any good. I tried to implement some cool features, but I'm not sure if I've done it right or if there's room for improvement. I've posted the code on Pastebin here for anyone who wants to take a look: https://pastebin.pl/view/6c72f03c. Thanks for any feedback!

2 Answers

Answered By CodeCritiqueKing On

Hey! First off, kudos for getting something to run. If it's working, that's a win! One thing I noticed is that you should prioritize formatting your code. It makes a huge difference in readability. Tools like IntelliJ or VSCode can help with that— they even auto-format your code! Also, try to use descriptive variable names. For example, instead of using 'b' for the operator in your calculate method, label it 'operator' so it’s easier to understand. Overall, great job for a beginner! Keep at it!

Answered By DevilAdvocate On

There are some major issues I see, though. First, you've got a security flaw with hardcoded passwords, which is not a good practice at all. Also, the way you've structured your loops could lead to infinite loops— you should think about using while(true) instead. Plus, you should make sure to close your Scanner object to avoid memory leaks. Just a heads up, it could be improved quite a lot in terms of structure and naming conventions!

CuriousCoder99 -

I appreciate the feedback! I realize those issues need attention, but this was just a fun project for me. I’ll definitely keep your advice in mind for my next one!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.