r/learnprogramming • u/Niluaa • 14h ago
Learning Java
Hello. I’m trying to learn Java, I’ve done the mooc.fi course a while back. I understand the ground principles of Java but I cannot “make” something out of nothing, always questioning myself and get stuck.
I was thinking of going the way everyone seems to recommend by building your own projects. The problem is if im going to make something like banking account etc. Found some good projects for beginner/intermediate.
What do I do when I’m stuck or don’t know my next step?
Do I google or ask AI for help (not making it write my code).
Any tips would be appreciated, like what did you guys do?
3
u/JGhostThing 14h ago
Don't try to make any sort of real banking app. It's too big for now, and you want a project that you can finish. I'd think about a to-do app based solely on the command line.
I've programmed in Java for quite some time and it is easy to do things in.
3
u/lmotaku 13h ago
When I code a project it's to fulfill a need.
Example:
I wanted a web app that can grab library data (fetch) for series(anime) online, find sources, download, stream it.
All I wanted to do is add the series name, it handles the rest. It needs to be in my language ((Eng subbed or dual audio). I prefer python (I know python) for web server/api building.
So, I start with:
How am I going to handle routing (pages, databases, caching data, configs, template/theming handling)
Is it AJAX(Asynchronous Javascript), Websockets, or something else?
What are the core features /browse /categories /search /settings /register /login /admin
I then code in those routes and how the api calls work around that.
Usually I build my scaffold /main.py or whatever name /src or /inc, /modules, /styles, /html
Design a head / body / footer shell for the content to clip into.
inc is for main / security core functions, modules are for db layers, fetchers, libraries and things that are third party.
Once you have a set scaffold in mind that is fully functional, you can then reuse that scaffold for other apps you build.
Once you have the HOW, the WHAT is the idea you have that plugs into the how. What is the intent behind your app goes into the scaffolding once. The rest is gravy because you can code once for security, sanitization, and structure.
1
u/BranchLatter4294 14h ago
We used to just practice in my day. It seems to have worked well for decades.
1
u/porn_sub_lurker 10h ago
And you practiced by not doing projects? Or what?
1
u/BranchLatter4294 10h ago
Skills first. Then projects.
1
u/porn_sub_lurker 10h ago
Weird, in university they taught us skills by giving us projects to implement.
1
u/BranchLatter4294 10h ago
If you understand the basic skills (sequence, selection, irritation, OOP, etc.) then do projects.
1
u/porn_sub_lurker 9h ago
You learn the basic skills by doing projects. Kinda like how you learn math by doing math problems, not by reading the book.
1
u/ShimonEngineer55 1h ago
You learn the basics to build projects by learning skills. A skill for example is understanding the basics of recursion and where this may or may not prevent bottlenecks in your program. You learn the theory of recursion before you actually use it to build a project; correct? This is the same with concepts such as data streaming, web sockets, and other concepts. You DEVELOP the skill via practice, but you need to learn it first prior to the projects in order to be able to use it in practice.
1
u/porn_sub_lurker 1h ago
Maybe your confusion is my use of the word "project". I would consider a program where you implement data structures to be a project, albeit a simple one. Like, we did a n-degrees of separation project when we learned graphs. I guess you could just describe it as a program. But it was essentially a project too. And yeah, of course read the book first to know what you're even doing.
Or maybe you thought I was conflating "learning" with "developing skills", to which I say, they're one in the same unless you take the most annoying pedantic interpretation of it. You "learn" by reading the book. You "really learn" by implementing it.
1
u/mindstorm8191 14h ago
Figuring out how you want to do something can be challenging, and I often struggle with that myself. Sometimes you have to try things, just to see if it'll work. If it doesn't... you at least have info about how not to do something, and you can try something else.
As to how to actually code what you want to do: start from the beginning. There will always be a beginning of some kind, even in complex systems. I find complex things easier to build when you do it in layers; For example, a game starts with a map, then a player, then enemies, then damage systems. Enemy logic can't be considered until you have enemies in the game. Player deaths can't be considered before they take damage. Projects build over time, piece by piece, not all at once.
1
u/porn_sub_lurker 10h ago
There are lots of more rewarding projects to learn. For example, you could make a card game like blackjack. You could learn lots of object oriented design principles like that. You could then reuse a lot of the same classes to turn that blackjack game into poker. And you'll learn a lot more object oriented design principles that way, and you'll learn where you messed up in the first place by the different road blocks you run into when trying to reuse those classes. In short, I would do something with a smaller scope which is easier to evaluate success or failure.
1
u/theJacofalltrades 4h ago
look at some curriculums of courses so you can find structure of how you want to go about it. I've seen people look at the same structures of bootcamps like bootdev to learn
•
u/ShimonEngineer55 55m ago
Learning and skill development aren’t exactly the same. Skill development is a part of learning, but it is around the 3rd step in the learning cycle and comes after the very basics. Like I have to understand what variable scope is in theory before I can develop that skill with projects. Someone isn’t going to be able to gain much from a project until they’ve found the meaning in what they’ve learned which requires some background knowledge, and until they target what they need to know. Those are two critical steps that come before someone can gain much from projects which is skill development.
It’s annoying and pedantic from the standpoint of how people with no structure learning system learn. I 100% agree because someone with no learning system just goes in and does stuff and actually consciously taking steps to learn isn’t really on their mind. But to people with a structure system there’s actually a major difference between the project phase and skill development, and the beginning phase which is simply finding meaning and targeting gaps in knowledge.
For example, it’s difficult to implement a program that requires functions that don’t mutate objects if someone doesn’t understand the basics of functional programming or mutations. If they don’t understand scoping, or lexical closures, that can be a challenge too no matter how many projects they do because they never filled in the basic gaps in their knowledge before jumping to step three with limited background knowledge.
5
u/OpsikionThemed 14h ago
I said "I want a game like civ, but just the exploration part at the beginning." And I built it, and it sucked. Like sucked sucked, with shitty ascii art and very little mechanics, but by the time I'd gotten sick of it I was a lot better a programmer.
I don't know if that exactly is what you are into - probably not - but that's the general idea: don't do something as "a project", do something because you want to have the end product in your hands. It's a lot better motivator.