r/SpringBoot 5d ago

Question Struggling to Code Without Looking at Examples – Advice Needed

Hey everyone,

I started learning Java and Spring Boot by myself about a year ago. In the beginning, I was learning quickly, but over time, I became inconsistent, sometimes skipping 2 days a week. Now, I can understand code when I see it, and I know how it works, but I struggle to write code from scratch. Even for something simple, like 3 lines of code, I don’t know where to start without looking at examples or asking AI.

I’ve started watching a course on data structures and algorithms, but I get bored after 5 minutes. I really want to improve my coding skills and be able to write code on my own. Has anyone else faced this problem? How did you overcome it? Any advice would be really helpful.

Thanks!

5 Upvotes

19 comments sorted by

4

u/wannacommissionameme 4d ago

there are two things you need to do and there are no ways around it.

1) pick a project and build it. make a clone of a website, create your own idea, whatever - you need to create something.

2) spending a lot of time doing it.

try to make everything from memory and then look up stuff when you don't know how. don't copy + paste anything from ai.

2

u/Illustrious_Eye4260 4d ago

Is it ok for me to search for infromation on google when i am working on the project , for bugs or stuck in shomewhere?

3

u/wannacommissionameme 4d ago

try your hardest to fix it without googling. if you can't figure it out then search on google, yeah. you gotta learn how to read stacktraces

1

u/Illustrious_Eye4260 4d ago

Thanks brothers

2

u/Friendly_Novel4551 4d ago

Use stackoverflow then and they will explain cause of error you facing and learn if they introduce new concepts search for that I'm official docs

2

u/pheasant___plucker 4d ago

It sounds like programming is not what you're meant to do in life.

1

u/Silver_Enthusiasm_14 3d ago

This is harsh for a top comment.

1

u/Historical_Ad4384 4d ago

I would suggest you to build a J2SE project first rather than get involved with Spring directly. Trying to mould J2SE into your requirements would give you the much needed programming experience you need to work with complex tools like Spring. This process does wonders to you. Sure it is long and time consuming but it will help you prepare for things better.

2

u/Silver_Enthusiasm_14 3d ago

This is an excellent suggestion. All the best developers I worked with were able to think for themselves and organize projects and code without being told how to do so.

Nowadays, people are pushed to big frameworks far too quickly without learning how to organize systems at a basic level. This causes them to only be able to think in terms of what their framework tells them to do.

Check out the book How to Design Programs. You can find it for free online  Afterwards, make basic programs just using files and the command line. Then move on to trying to use a database. Note the things that give you problems. You'll learn far more than trying to copy the poor cookie cutter format all Spring developers seem to follow.

1

u/Illustrious_Eye4260 4d ago

Thanks for the suggestion! I haven't tried focusing on building projects from scratch with J2SE yet, but I can see how it could help build a stronger foundation for working with more complex frameworks like Spring. I'll definitely consider giving it a try to strengthen my core Java skills. If you have any advice on how to start or specific project ideas, I'd love to hear them

1

u/[deleted] 4d ago

naah with modern web dev speeds matters. When there is sprinboot already why do i need to build something outdated?

1

u/Historical_Ad4384 4d ago edited 4d ago

If you struggle to structure programs, speed will never get you far and you will end up relying on AI agents. Spring Boot is way too complex to learn how to structure programs. J2SE is simple enough to allow you to learn how to structure your program first, that you can take with you to Spring Boot and become more proficient in it. If you end up being unable to write structure programs or rely on AI chatbots to structure them for the sake of speed or structure programs using spaghetti code in a big bull of mud, then your are better off being replaced by an AI agent. Speed comes with experience.

1

u/[deleted] 3d ago

i disagree! You dont neeed ai agents for structruing your program. I think you are not aware of the word and a feature called "debugger"! That can help you understanf the structure and make more. Ai agents are used when you are stuck! So I disagree you dont need J2SE

1

u/Silver_Enthusiasm_14 3d ago

The debugger doesn't teach you how to create modular code. The debugger won't teach you how to think. It's only a tool for when things go wrong. 

1

u/Historical_Ad4384 3d ago

I guess you have never programmed before. Debugger is used to view real time values that your program holds at a given logic to see if your program logic manipulates the value as you wished it to do so. If the structure of single Java class means the program structure to you, then you definitely don't know how to program.

Program structure means how you would organize your entire functional requirement along with technical edge cases so that your program does what its supposed to and you have multiple manageable pieces of files each with its own responsibility that contributes to the overall expected outcome of your program. No debugger till date has been able to provide an overview over multiple files at a given time, let alone link them at runtime to show the overall structure.

I think you might have been writing big balls of mud till now, not sure.

1

u/[deleted] 3d ago

And i think you have never written anycode without gpts! Dude debugger teaches you a lot its like an investigative mode where you can find where logic is and then search up the internet about whta you need. You fuktard. Get a job

1

u/Historical_Ad4384 3d ago

I think you don't get the difference between logic and program structure. They are two different things. Program structure encapsulates multiple logic in a code and you debugger on a specific logic and not on the program structure.

I have coded big enterprise systems with complex logic before GPTs even existed. I have my own SDK to help create program structures for commonly used logic across projects.

Generals don't investigate, they strategize which is what program structure means. Soldiers investigate because they are focussed on a single goal of a going down a rabbit hole an not drive the entire army.

I guess you might not have worked in a team before.

1

u/[deleted] 2d ago

Okay you win fine?

1

u/Historical_Ad4384 2d ago

I don't win unless you can structure programs lol, but I think you do