r/learnjava • u/jayharemking • Jan 21 '22
How do I actually make programs independently
So I have been learning how to program in Java specifically through schooling alone completing projects given by my teacher and receiving lectures four about 4 years,Though I feel like a lot of what I am doing I would not be able to do on my own or working for company I spend weeks trying to figure out how to write the algorithms until I end up just asking the teacher what I am supposed to do, so I don’t end up far behind. everyone else in my class just writes the programs and many can turn them in the day tasks are given. So why are things not as simple for me why do I not understand a lot of what I am doing where am I supposed to go what am I supposed to do so I can feel like I know at least on basic level how to program.
17
u/L2_Envy Jan 21 '22
So a couple of things I recommend.
First, if you feel like you are struggling in class, watch some youtube videos, or get a tutor.
Second, if you want to start writing programs. Think of something you find would be fun to make. I have been programming for 10+ years, and I still try to find personal projects that challenge me. This is super key, as you begin to understand how everything fits together
Lastly, don’t worry as much about writing ‘algorithms’ like yes, they are important. But even more important is understanding OOP programming. Like the SOLID principle. Understand frameworks e.g Spring
Start off small, work your way up. It sounds like you have the knowledge, now you need the experience.
15
3
u/taftster Jan 21 '22
My advice might be too "beginner" for you, since you're a 4-year student. But maybe it will give some inspiration.
As far as algorithms, you can/should start to learn how to use pen & paper, or possibly better, an Excel spreadsheet, to map out how your algorithm works. Many algorithms involve looping of some sort, as an example. So you want to make a table and write out how your variables will change for each iteration of the loop. One row in the table equals one iteration in the loop.
Let's just do a stupid simple loop that counts by three 'n' times. The variables and expressions are in the header.
| var n | var sum | sum = sum + 3 |
|---|---|---|
| 0 | 0 | sum = 0 + 3 |
| 1 | 3 | sum = 3 + 3 |
| 2 | 6 | sum = 6 + 3 |
| 3 | 9 | sum = 9 + 3 |
This is obviously a very silly example. But it kind of shows you how you can use a table to "program" and can somewhat help you think about the steps needed to compute an answer. If you can program it in Excel, you can program it in whatever language.
For knowing how to compose your program, generally create well-defined single purpose methods/functions that do one small thing. And then, use your main method to "call" the other methods in the appropriate sequence. Don't chain too many methods together and don't try to do too much in any single method. Don't try to go all "object oriented" with your classes. Use classes to hold state data and some simple methods to operate on that state.
AND THE BIGGEST THING is that your struggles are normal. It's likely that some of those other students have already been introduced to programming materials from previous study or hobby programming as a youth. You will "get it" if you just continue to work at it. It took a long time for myself (and many others) before it clicked.
I still have anxiety that I'm not going to quite get some concept or algorithm in my workplace, but it turns out that I can hold my own. I'm now in this career 20+ years. My point is, you might very well be doing just fine, but have some anxiety about your status based on your peers. Just keep working it.
2
u/DigitalTorture Jan 21 '22
Some people can grasp the concepts while some have to work harder... or smarter. Don't feel bad that you are the latter. If this is something that really interests you, then you will succeed.
1
Jan 22 '22
Everyone goes through it man. It’s just part of the learning curve. The fact that you’re concerned and willing to go the extra mile and ask this question says a lot about you. One day it will click and you’ll pick up things easier.
Regarding your question, find an application that you think is cool and try to copy it. Do everything you can to get it done. Google and YouTube are your best friends. Just keep googling things till you figure it out. That’s all it comes down to. Odds are the specific thing you can’t figure out has been asked 20x on stack overflow. Just keep on searching till you get the issue fixed.
1
1
10
u/KinkyHuggingJerk Jan 21 '22
Always start small. (I call it the ASS principle.)
If there is a specific topic that you are having difficulty with, that may be a better conversation to have within your school. Is there a tutoring resource or teacher that may be able to help?
How well do you feel you understand each of the principles? i.e. can you recite some of the terminology, are there structure blocks that give you issues, or is it more of an organizational thing?
If more of an organizational thing... how are you faring in other classes? Do you feel you are retaining more or less information? Might be worth a conversation with a doctor, or a therapist if you're facing burnout or having difficulty concentrating.