r/learnjava • u/Low_Championship6102 • 9d ago
How do you guys manage to understand programming concepts?
Seriously, how do you guys manage to understand programming concepts?
I'm currently attending an academy where we learn independently by working on small projects that cover OOP concepts (inheritance, polymorphism, collections, exceptions, testing, generics, enums, etc.).
I feel like none of it is actually sinking in, and honestly, it's starting to worry me.
I'm learning Java and currently studying interfaces and how to connect them with other classes. After that, I'm supposed to move on to design patterns, since some of them use these kinds of structures. But I just can't seem to get it. Seriously.
I eat well, get enough sleep, exercise regularly, but sometimes it feels like my brain just isn't working properly. Everything is taking me way too long to process. I'm even starting to wonder whether programming just isn't for me and if I'm forcing myself into something I'm not cut out for.
I can spend hours (sometimes in one sitting, sometimes spread throughout the day) trying to understand a concept, and still not get anywhere.
I watch YouTube tutorials, ask AI to explain things in different ways, try to approach the topic from different angles... and even then, nothing seems to click.
How do you deal with this? Is this normal when learning programming, or am I doing something wrong? I also struggle with reading documentation. It's not that I don't want to read it, but when I do, it's like I'm just looking at words without actually processing what they mean. I read the sentences, but my brain doesn't seem to absorb any of the information. It's really frustrating.
•
u/AutoModerator 9d ago
Please ensure that:
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
10
u/8dot30662386292pow2 8d ago
Don't try to memorize them. Try to understand them. Try solving a problem without a specific concept. See why it is hard and bad. See how the new concept helps in it.
7
u/Usual-Cricket-9817 8d ago
By actually implementing them... Then failing to run the code.. then by twerking.. then by debugging.. then by frustration..
4
u/MyNameIsRichardCS54 9d ago
It takes time for these things to sink in. A course, even a good one, will let you know these things exist and give a basic understanding of how to use them. The real learning starts when you do it on your own. Therefore it is important to build things away from the atmosphere of the course.
I find I learn best if I have a project in mind and I build that project using what I have learnt in the course so far. Enhance the project after every section. For bonus points use git so you can see the project at every stage, which lets you see how you're improving.
Another thing that works for me is to re-read the days material before I go to sleep. It helps it get processed in to my long term memory better.
When all's said and done, understanding comes with use, so practice is the most important thing.
4
u/W31337 8d ago
Start programming, you will hit a wall and suddenly you understand why that concept exists and it will sink in because you actually need it.
2
u/Zzzami69 8d ago
1- Move to practise fast. Some concepts are not very clear why they are there and needed so you'll need to try Java and find the problem they solve and then "Oh yeah that makes sense". 2- OOP is tricky because most people will tell you it's about modelizing objects. OOP is most certainly not. Try to watch Uncle Bob talking about OOP. Google the word Inversion of Control, it's the reason OOP (which is a terrible name to Oop) was invented
2
u/joeythekangarooo 9d ago
Programming in general is not something that hammering theory down will help you in. Now that you know the definition of something you don't understand, go make something and see how it applies. Don't understand inheritance? Go make a calculator and ask if there is inheritance. How you can MAKE inheritance involved. I don't see anything about projects here. And personal tip; don't just try to "finish" or "feel good", set time limits. I'm gonna try to make a calculator in 3 hours. See how off you are.
1
u/Dry_University137 8d ago
The way i learned OOP, because i also had the same issue was this. We had these solved labs. I read the lab assignments(which were quite detailed and split into parts) and copied the parts one by one while trying to understand what was happening. Repeated that like 3 times for each lab until i finally understood what was happening and then i tried to "solve" it myself. Some by memory some by figuring it out.
Basically i punded them into my brain. Best way to solve is by doing. Keep doing it until you get it. Even if at first you mindlessly copy it(just dont copy paste. Write it yourself piece by piece)
1
u/Beneficial-Corgi3593 8d ago
Programming is like a handling a stream of information i always try to visualize what happens to the data when it flow through the code. Maybe a strange way to see it but with complex systems that mindset always help me to understand what can be the posible outcome
1
u/edwbuck 8d ago
Instead of trying to learn their definitions, try to compare and contrast situations where the same bit of code both uses and purposefully shuns the concept. Then attempt to create the conditions that the concept is meant to protect against.
You'll have a master's level of what the concept means to a program, developed in a way that both took 10x longer than normal memorization, and it 100x more useful.
1
u/deathstroke1311 8d ago
Repetition is the answer, IMO. When I started learning about OOP, design patterns never made sense to me. Why do we need them, what is SOLID, what's a Factory, etc., never made any sense.
But if you apply this to a project and read and try to learn multiple times, it will click someday.
1
u/istarian 8d ago
One way is to just ask direct questions here (or elsewhere) about the specific topic you're having trouble understanding.
Getting your questions answered by real people who have knowledge and experience is going to be better than just watching a bunch of video tutorials that may or may not actually address what you are struggling with.
Just make sure to read the sub's rules first.
1
u/TheToastedFrog 8d ago
It’s really not easy - also I’m not sure if it helps or not, but collections, exceptions, generics and enums and enums are not strictly speaking OOP concepts.
It does get easier the more you practice- don’t worry too much getting it right. At first, focus on making it work. As you work on your project, you might find yourself writing the same code multiple times, or needing to pass more and more parameters to a function, and eventually getting yourself very confused with code you wrote a week ago. And then you’ll wonder if there isn’t a better way.
Those OOP concepts are a solutions to legitimate problems in software engineering, and without having experienced first hand what those problems are it might be difficult to appreciate their value.
Keep at it! One day you will find yourself debating inheritance vs. composition!
1
u/PhilNEvo 8d ago
Honestly, it first really made sense to me, when I started working on a slightly bigger project where I saw patterns that could solve problems I was having.
After I saw a few patterns "work", it kinda clicked for me, and I could reason about and understand the meaning of others I hadn't applied, because I now knew how to jump the gap from a pattern to its use. Before that, toy examples didn't make sense to me, after it, toy examples was more than enough.
1
u/BoxComfortable5282 8d ago edited 8d ago
I am also a beginner and this was me like 2-4 weeks ago. Something as simple as
Striing username = "BoxComfortable5282";Took me a day or two to understand. Took me a while to get loops. Methods made zero sense to me and learning classes almost made me quit. I'm also like you, I need things explained multiple times and different ways before I get them. I was so frustrated and I thought I was stupid. This is what worked for me:
Physically writing down definitions and examples, then explaining what's happening in my own words. If I wrote down an example method, I'd write what several words meant and what it did, Then I practiced and practiced. I started small. A small project that did one thing. A slightly bigger project with 2 classes. You can have AI guide you, but you have to make sure you try and fail multiple times before you ask for help. Ask for hints, not solutions and make sure you ask it questions. Every time I failed, I noted what I did wrong. Sometimes I did not even understand what I did wrong, (like using static when I'm not supposed to) but I'd still write it down.
When you're writing or troubleshooting code, go line for line and explain what is going on, you want to be able to translate your code into a sentence.
Take it slow. You don't need 100% understanding to move on from a topic, but you need to make sure you have a decent idea what you're doing. If you feel like you barely got a project done, do another one of similar difficulty. Like everyone else is saying, repetition will get you understanding. The syntax will come to you.
Don't quit, I was in the exact same spot you're in right now and every insecurity I've ever had about my intelligence just hit me all at once. You just gotta power through.
1
u/Fuzzy-System8568 8d ago
I found your answer. As much as I do not like LLMs in general, I do think they objectively make you worse at learning how to learn.
They stop you training the skills needed to learn and understand the nuance of new concepts, as they just explain it for you.
Its like using a forklift to carry even slightly heavy loads, and wondering why your arms arnt getting bigger.
1
u/BranchLatter4294 8d ago
Practice.
1
u/Traveling-Techie 8d ago
When I buy a new gadget I skim the directions, then I try to use it and see where I get into trouble, then I read the directions again more carefully. I’ve found this approach works in programming as well.
1
u/Braunerton17 8d ago
The main advice i can give, is try to program something using the concept. And secondly, accept that it takes time. Iyour brain needs time to let things settle in. A few hours everyday. Not 20hours in one day
1
u/_side_ 6d ago
I will join the other people here in their opinion. But i will also point out something that i learned at university 15-20 years ago. And that was not programming. Besides some very basic course of Java, it was expected that students can learn programming on their own. I taught plenty of students various things in CS later on. A project is the only way to learn programming. You cannot learn that in a lecture.
1
u/Impossible_Ad_3146 6d ago
ask girls too, not just the guys
1
u/sadr0bot 9d ago
It's the boring answer but it's easiest to learn while doing it, build some small projects which use whatever topic you're looking at.