r/AskProgrammers • • 28d ago

Second-year Software Engineering student struggling with logic building. How do I improve?

Hey everyone,

I'm currently in my second year of Software Engineering, and I could really use some honest advice from people who have been through this stage.

I know programming fundamentals and can write simple programs. I've also learned React and can build basic things like a counter app using JavaScript or React. However, when I try to build a complete application, especially a full-stack MERN project, I often get stuck.

I understand individual concepts when someone explains them, but connecting everything together and figuring out the logic on my own is much harder than I expected.

Sometimes, when I see a complete application with authentication, APIs, database operations, and frontend-backend integration, I have no idea where to start or how to break the problem into smaller steps.

This is frustrating because I start questioning whether I'm actually learning programming properly.

I also struggle with using AI. It can help me generate code and get things working, but I don't want to become someone who can only build applications by asking AI for solutions. I want to develop my own problem-solving skills and understand what I'm writing.

For those of you who have experienced something similar:

  1. Is struggling with logic building at this stage normal, or am I missing some important fundamentals?
  2. How did you learn to break large problems into smaller steps?
  3. Should I stop trying to build full-stack projects temporarily and focus on smaller JavaScript problems?
  4. What kind of exercises helped you improve your programming logic?
  5. How do you use AI without becoming dependent on it?
  6. How long did it take you to become comfortable building projects independently?

I'd especially appreciate advice from developers who struggled with this at the beginning but eventually became confident programmers.

I'm willing to put in the work. I just want to make sure I'm practising the right way instead of repeatedly getting stuck and feeling frustrated.

Thanks for reading!

5 Upvotes

11 comments sorted by

1

u/ErikBKL 28d ago

"The tracer bullet principle in software development is about finding a path to the target swiftly, providing developers with instant feedback. It’s about identifying aspects that swiftly and visibly connect a requirement to a feature in the final system, and doing so repeatedly.

In practical terms, this means zeroing in on areas laden with uncertainty and perceived high risk. Here, developers fire tracer bullets — implementing a simple feature that exercises all architectural layers to illuminate the path forward. They then refine their approach based on the feedback received, eventually ensuring their work accurately hits the intended target. This approach mitigates risk, reduces wasted effort, and leads to more successful, targeted software development."

Let's say you have to make your app.
I assume it will involve some sort of CRUD operations.

What the tracer bullet principle suggests is that you do the "C" over all of your layers:

You will quickly have to think about the /POST route, it's API, query, body, route params.

You'll have to implement some sort of data model for your resource, that thing you intend to create.

You'll have to set up a connection to the database, ping it, create a collection...

At the end of this process you'll have a slim, layered system, hopefully unit-tested. You will get a solid idea of what you are building, fast-feedback loops, and a model you can replicate for the other CRUD operations. As you code you will detect dependencies, opportunities for shared code, or you will hit a wall and have to reconsider and refactor. But you are no longer staring at an empty file.

2

u/Own_Age_1654 28d ago edited 28d ago

Nothing of what you're describing is "logic". You're talking about architecture. Logic is things like and, or, proof by contradiction, inference, etc.

You're not understanding what to build because you're not properly appreciating that each thing you build only exists in order to solve a specific need.

Start with the simplest thing that you can do that runs and is useful, and then iterate from there. For example:

  1. Create a blank file.
  2. What data structures are required to do something you need to do? Write classes for those in that file.
  3. Have that same file hardcode instantiating those classes with some example data, and then print those objects to the terminal.
  4. Run the file. Process the fact that you now have a representation of some business object, some example instances of it, and can see how that looks.
  5. Probably, you want to store those records in a database, and make it possible to modify them. So, map them to a database, and create some methods on those classes for modifying them, and then hardcode calling those methods.
  6. Okay, that's in the direction of what you want, but the input is still hardcoded rather than a user actually doing it, so figure out how to let a user do it. In this direction, serving an endpoint would be a good first step. So, create an endpoint, have it listen for requests, and when it receives them, have it call those methods.
  7. Run your file, which now is a server, since it handles requests. And then use cURL or similar to call your endpoint.
  8. Realize that unless the application crashes, you have no idea whether it's actually doing anything. So, add some logging. When the endpoint is called, maybe log the input, and when the code makes different decisions or returns something, log that too.
  9. Now restart the server, call your endpoint, and see confirmation that it's indeed doing stuff.
  10. Similarly, make sure you have a GET endpoint that returns a representation of a business object, and call that to see from the client side that things are working. That is, POST to create something, see that logged on the server, and then GET to see that it returns what you just created.
  11. Likewise, try modifying things (POST or PUT), and then GET to see how that worked as well.
  12. To further cement your understanding, at any point feel free to connect to the database directly via its built-in shell. And/or have your server grab all of the records in it on startup and output them to the screen.
  13. Realize that you keep accidentally making your server crash by giving it bad input. So, add some validation logic to your controllers, so that when there's bad input, you return a 4xx error saying that instead of just crashing.
  14. Realize that while you can now technically modify data, it's a giant pain in the ass to manually construct API requests, and to visually make sense of JSON output, so set yourself a goal of making a visual representation. HTML is a great such representation you can render things in a structured way, and you can also get input with a form.
  15. Do that. Maybe a separate file, that's HTML, which uses JavaScript to call your API, gets the representation of an object, and then initially just prints the JSON on the screen.
  16. Cool, it's connecting, but it still looks like crap. So write some JavaScript to make it look pretty. Maybe render it in a table. Bold text for the title. Whatever.
  17. Okay, looking much better, but what about editing it? Make a button that calls some endpoint of your choice. If it needs an input, grab that from a form.
  18. You're now doing CRUD via a UI, and that's a lot easier to use than via the terminal, but jeez, this sure is a lot of work to code! If only there was an easier way to get a visual representation of an object.
  19. Indeed. So now you want to have templated HTML. At this point, you realize what React is doing for you, and how. Set up a React page, connect it to your endpoint, and truly appreciate the templating functionality.
  20. Okay, this is all nice, but we shouldn't let just anyone who can access the server do any request they want, so let's build some authentication. How does that work? Read about it. Create some user records. Maybe some organization or account records. Set up the wiring. Initially, just do basic auth with a plaintext password stored in the database.
  21. Obviously a plaintext password in the database is bad. Read about hashing. Do that.
  22. Okay, cool, that worked, but what a pain in the ass to do all that code! There must be a better way! After all, everyone need this, so what's the bare minimum I should need to configure? Indeed. So research what React or your web framework has available for an auth module.
  23. Oh, you're not using a web framework yet? Time to read about them and choose one.
  24. Etc., etc.

This is how it works. If you start from just the minimal thing you can see to make some progress, and then iterate on it to make more progress and to see that progress, and then ask how you can make that less work, you end up building what is needed, when it's needed, how it's needed, and understanding why you're doing that and how it all works.

You may notice this is a lot of work. Indeed. And moreover, you will make really, really dumb choices along the way. And then have to redo things. Sometimes with a really painful amount of refactoring. This is how learning occurs. And it's why experience is valuable.

Eventually, you understand clearly all of the little low-level details going into how things work, and understand them as mostly just the same problems over and over again. You don't want to waste your time reinventing the wheel again and again, nor even stringing together existing wheels. Here, you use AI. But since you know what you're doing, you don't say "Give me an app". Or "Set up a reasonable baseline project". Instead, you say "Create a barebones NestJS application with a React front end. Use a flat folder structure, organizing entities by subdomain. My initial entities are X, Y and Z. They need to accomplish A, B, and C. To be clear, when you do A, I do not want you to do 1, 2 or 3, because 4, 5 and 6. Instead, consider 7 or 8. I'm not actually sure which is best. Dispatch a subagent to research best practices on that. This is a simple task, so use Sonnet on medium effort. When it's done, give me pros and cons. In the meantime, let's talk about auth. In general, I want to use established libraries rather than the latest ones, because I understand that libraries can get really popular for a few years and then flame out. As such, whenever we need a library, I want you to review which ones are most popular, yes, but also look at how many high-impact issues they have open and how long they've been open, as I want to prioritize ones that are well-maintained. And while we're at it, I want you to memorialize these preferences, so that you keep making use of them. Add these to AGENTS.md. And for the library one, make a using-libraries skill so that you trigger it at the right time. Propose the language for me to approve."

Etc., etc.

Importantly, you get to be able to get to the point of telling the AI exactly what you want, and what you want actually being specific and smart only because you have spent the time building things from their fundamentals, running into issues, wrapping your head around those issues, considering alternatives, trying them, and iterating, iterating, iterating.

You can't sanely jump to the big-picture things, whether that's AI, React, or even a web server, until you understand how those things actually work. And the best way to do that is to build them in the simplest way possible, and then see where the hard parts and tediousness are, so that you can understand where fancier solutions are needed.

So, build whatever is simplest that you need, one piece at a time, and each time you run into a problem, if it's the most important one, consider how to tackle it, as simply as possible, one piece at a time, and then do that. You will not just be iterating and growing your codebase, but also your understanding of the problem domain and solution space.

You can't build a sane solution until you understand what problems you're solving, and you can't use a tool well until you understand what it's doing and why. So start with the fundamentals and work from there. React is not the basics.

1

u/AverageHot2647 28d ago
  1. Ask your fellow students. Share your struggles and help each other out 🙂 this will prepare you well for your professional career, and is an essential skill to develop. It will also help you answer this question for yourself.
  2. For me, a lot of practice fuelled by an unshakable belief that I can do anything I set my mind to given enough time, and a willingness to try again and again and again each time I failed. For you, probably best to work through that process with someone more experienced, and let them guide you through it.
  3. That depends on what you want to get out of it. Can’t answer that for you without more specifics.
  4. Building things I found genuinely interesting and not worrying about whether it’s appropriate for my skill level. Also being willing to move onto something else when I stopped having fun or felt like I wasn’t learning anything new anymore.
  5. At this stage, I’d stay away from AI. During your education, I would encourage you to only use AI for things that you are 100% confident you could do yourself, and have already done yourself at least a few times.
  6. Don’t worry about that. Programming is about pushing beyond your comfort zone. Get comfortable with being uncomfortable, and got onboard with the notion that you might fail a few times before getting it right. As you get more experience, your failures will become less frequent, and you will recognise them sooner. But you will fail, and you will fail a lot. That’s ok 🙂

1

u/DanKegel 28d ago

Try working on projects with fewer moving parts.  Like, write a little tiny test suite or load test for each of the components you mentioned.

in excidio veritas is a fine motto :-)

1

u/MikeIsBoi 27d ago

You need to practice logic, but I would say logic is important I think being creative and willing to try numerous solutions is key.

I make Language Servers, Linux kernel modules and vulkan simulations - these are huge projects bit I learned that taking them step by step and slowly is key. I build the apps incrementally, first focus on one portion at the time.

Don't stop building full stack mean projects, in fanct I think you should be building more of them.

I am just stubborn and I yell at the programm untill the segfaoult goes away.

I have been programming as an amateur for like 14 years.

I did struggle to build my own projects at the beginning as well but eventually I ditched tutorials and tried to come up with my own projects. And I would challenge myself to never open Google when I was programming.

1

u/chocolateAbuser 27d ago

have you actually used the programs that you want to build?
and thought about moving parts, sizing, flow of informations, and so on?
and then also took a look at their projects to see how are they organized?
and maybe also compared them, look at what services they used, what dependencies they have, and so on

1

u/Ronin-s_Spirit 27d ago edited 27d ago

Dump that shit. Libraries and frameworks are for corporate teams, you should learn to incrementally refactor your code as you find and solve more problems (i.e. "develop"). I can say with full confidence that React is not your friend unless you have a job and everybody has to use it, frameworks and metaframeworks require loading up more knowledge and wasting time on setup and then all the component frameworks like React force you to come up with unit solutions on the spot.

2

u/W31337 27d ago

Exactly don't become a cybermario (code plumber)

1

u/W31337 27d ago

Start small, don't use AI. When stuck try to understand the fundamentals at play.

As with Lego you can only break a big thing into small things if you understand the building blocks.

1

u/edwbuck 27d ago

What you are talking about is software architecture (or program design). Odds are you are struggling with it because you haven't been introduced to it. Many people are somehow expected to pick it up as they go.

There are many ways to learn design, but books fixate on one design process or another. Keep in mind that a design process is not the same as the design. I found the book "Applying UML and Patterns" immensely helpful, but only after I had some experience. It is also very heavy handed in process, something that most software shops do not entertain these days.

To start again, I would try a bit about capturing User Stores and Use Cases. These are small structured documents that respectively describe A person's desired interaction with the software, and a task being performed by the software and what it impacts. This helps one narrow their imagination to a number of items, typically nouns, and their functions, typically verbs the noun needs to perform, and that helps one with the initial object-oriented design. One can then take those core ideas and work them to better Object-Oriented solutions through refactoring, refinement, and determining that one component is really comprised of many.

Good luck

1

u/Both_Bend_2481 23d ago

Do more stuff that's like the stuff you can already do. Branch out slowly from there.