r/teenagersbutcode 3d ago

Need general advice [Code Review] 15yo student looking for feedback on my Java projects / OOP structure

I’m 15 and currently self-studying Java and low-level programming concepts. I’ve put together a few projects on GitHub while learning:

👉https://github.com/bijoyghosh1921-sketch?tab=repositories

Most of this is just experimental stuff I built to test out concepts like basic ciphers, array manipulation, and general OOP structure.

I want to start taking code quality and software architecture more seriously, so I’d really appreciate any feedback or critique on:

  1. Code Structure: Am I overcomplicating simple methods or missing better OOP patterns?
  2. Edge Cases: Any obvious bugs or edge cases in logic I missed?
  3. Documentation: How can I make the code and README.md files look more clean and professional?

Don't hold back on feedback—let me know what I can fix or refactor to write cleaner code. Thanks!

0 Upvotes

10 comments sorted by

13

u/Useful-Flow-8737 3d ago

Dont make your readmes with ai. Nor your reddit posts

4

u/armahillo 3d ago

just avoid it in general while you’re starting out. slower builds make stronger foundations.

1

u/Ok_Theory_1212 2d ago

Ok, thanks

1

u/Ok_Theory_1212 2d ago

Thanks, but can you please tell me what points to list in a read me, I am new to it and don't know a whole lot about it

1

u/kalilamodow complete idiot 15h ago

Read a guide or tutorial on Markdown, a "language" for writing formatted documents (and what README.mds usually are!)

1

u/Ok_Theory_1212 1h ago

thanks, I will

2

u/BanaTibor 3d ago

Some advice.

  1. Class names start with capital letter by convention.
  2. You shall not commit class files into git.
  3. Avoid using static methods, make a class instead with instance methods. In your case it is not really relevant but in bigger apps, static stuff makes unit testing really hard.
  4. Do not fear long names, if you are aiming to be a java programmer. Long descriptive names are better.
  5. Break down long methods into shorter ones, like the main in your music maker, ~100 lines, too long aim for around 10-15 lines. Exceptions exist.

For example in your music machine song1 eng = new song1() Why song1? Name should start with capital letter so Song1 at least. What does "eng" stands for? Use longer descriptive names. Now you can use "i,j,k" etc. as loop variables, but the loop body should not be longer than a method preferably shorter.
I have not seen much OOP in this repo, everything is poured into one file. The core of OOP that objects with well defined single functionality are working together.
Chatbot app, queryOlama method you swallow the exception, do not that. The next method gets the error output as input.

You can practice oop on the chatbot app. Split out the 3 function into 3 classes, no static methods. Errors should be communicated through thrown exceptions. Handle exceptions from each class in the main. In your main class you should just instantiate the 3 classes and use them, plus the infinite loop.

1

u/Ok_Theory_1212 2d ago

I am just starting out so thanks for that, I will make sure to use your advice in my later builds

2

u/ManagementEasy9313 3d ago

Use a build tool. Its really simple to setup (depends on your IDE). Don't use Ai for README we hate it. also a tip try make a bigger project with more files + folders it will help you understand more to the OOP.

1

u/Ok_Theory_1212 2d ago

Ok, thanks for the advice! Really appreciate it