I desperately want to just code the right way |
Harsh truth time, perhaps. Firstly, there is no right way. There is no right way. There is no right way. The best you can hope for is a solution that meets all the needs and constraints at hand, which will include such things as performance needs and hardware limitations and the abilities of the writers and the abilities of the maintainers and the known need for future expansion and many, many other factors. There is no right way. There are only ways that meet the requirements and needs to greater or lesser extents.
As a beginner, you'll make mistakes. You cannot expect to write as if you have ten years' experience and have made many, many mistakes, because you don't have ten years' experience. You haven't gathered the practical wisdom to do so.
You can read about design patterns and you can read what's considered "good code" to see how experienced, skilled coders wrote code for their particular needs and their particular situation (although without any knowledge and experience of your own to hang it on, how could you possibly know if what you're reading is good or bad? It'd be cargo-cult programming, copying blindly), but if you're hoping to be able to read something now that will distill a decade's wisdom into your head, you're seeking the impossible.
I learned online from watching tutorials on youtube |
That's a way to learn the syntax and a handful of very basic techniques. You won't learn how to actually program like that (although once you have enough knowledge and experience that you have a mental context that helps you understand, series like "Handmade Hero" are very educational; in my opinion, beginners get very little out of watching "Handmade Hero", but more experienced coders can really get a lot out of it. Watching someone mouth-breath their way through slowly typing in a way to reverse a string over ten minutes is not useful to anyone).
Have you written your save/load methods yet? If you've written nothing, then you're suffering from analysis paralysis. Code that doesn't work because it doesn't exist scores zero points and does nobody any good; particularly you.
I really dont know what is needed, |
No worries. I can help you with that. You need to be able to enter an account's details and save them to disk. Then, restart the program and be able to load them from disk so that you can see that the details are the same.
That's what needed. Do it. Stop worrying. Do it. Do it. I'm really serious. Spending an hour making it work will do you so much more good and be so much more educational than trying to architecture astronaut some magical perfect solution inside your head.
When you've done it, you'll have so much more understanding. Show us your code. We'll suggest an alternative method. We'll suggest a way you can expend your program. Perhaps handling different kinds of objects. Perhaps writing binary rather than text. Perhaps a level of abstraction. Right now, we can't help you learn because you're stuck in your own analysis cycle, intimidated by what you don't know. Just start coding; start learning.
perhaps one that just explains stuff concisely. |
This is going to take a long time. You can read a single sentence telling you how to chisel granite, but that won't make you a sculptor.
it just seems like i can never get my code up to standards. |
You can't code as if you have a decade's experience? Keep going and see how you're doing in a decade's time.
Definitely, definitely STOP WORRYING about the fact that you're not writing perfect code. Just enjoy writing it, enjoy learning, accept that beginners are not as good at anything as people who've been doing it for a lifetime.