r/learnprogramming • u/Repulsive_Metal_1569 • 23d ago
How do you deal with wanting to code something when you have no idea how to implement it and there isn't any info about it?
I've dropped several projects because I always end up hitting a point where there's a core mechanic I just don't know how to make. I know that's probably a sign that I'm trying to build projects that are above my current skill level, but at the same time I've been making small projects for quite a while and I feel like I'm always using the same set of skills. It feels like I've hit a wall. I don't really feel like I'm improving or learning anything new.
When I try to step outside my comfort zone, I can usually make progress by watching tutorials or reading documentation. The problem is when I can't find a tutorial for the specific thing I'm trying to do. That's when I get completely stuck because I don't know how to approach the problem or figure out the solution on my own.
What do you do in situations like that? How do you learn to build something when there's no guide to follow o information?
56
u/Goobly_Goober 23d ago
You break it down until you can deal with it
11
u/bizvibe8 23d ago
When tutorials don't exist for a specific mechanic, the issue is usually searching for the feature by name rather than by its underlying computer science pattern.
Here is a practical workflow to unblock yourself when you're stuck on an unfamiliar mechanic:
6
u/No_Report_4781 23d ago
I invent it.
3
u/kagato87 23d ago
You use pseudo code, right?
Start with "mechanic rules."
Turn the rules into their decision trees. Not as code, but flowchart or pseudo code. As you do this you'll naturally refine the rules.
Then take the rules and turn them I to proper pseudo code. If you want to "do the thing" but don't know how to define it, then "do the thing" is your pseudo. You'll come back to it. Continue on down.
Learn to use stubs. They're awesome. Pop on a stub, come back and solve it later. Just make sure there's a few unit tests that'll fail on the stub, because you will forget.
Then take your stubs, your poorly designed "do the thing" and break it apart. Doesnt have to be all the way, even just into two pieces is progress. Pseudo in the stub even while it's still returning the palceholder.
Keep going. Eventually your stubs won't be stubs any more, you'll go "howd I do that?" and be filled with an overwhelming sense of accomplishment.
Or just ask Claude. You don't get that growth and accomplishment, but it does get the job done. Sometimes.
5
u/YouPeopleCantBeReal4 23d ago
Nothing is new in software is something I was told a lot by my mentor (senior swe at my current workplace) the issue you most likely have is not breaking down your problem enough. Very few things are novel in this field, chances are someone has dealt with what you are dealing with in some form. Researching and finding it can be the hard part sometimes
2
u/codegems 23d ago
You can ask for help online. Ask as if you already solved it, and someone will be promptly there to correct you.
Cunningham's Law - The best way to get the correct answer on the Internet is not to ask a question, it's to post the wrong answer.
More seriously though, innovation does not occur in a vacuum. But you need to put in the effort to pull the relevant threads from various sources. What are you trying to make? Who are the people who have gotten closest? Are there any university departments doing research on it? Any recent papers, libraries, frameworks that get close? Maybe it's so niche there's only random abandoned GitHub repos about it. Any comments on online forums? What have you discovered on your own? Even more broadly: what field does it fall under? Mathematics? Astronomy? Dentistry? You get the point.
2
u/Own_Unit_6170 23d ago
There's always some source where you can look it up. It used to be printed manuals, then came Google, now it may be an AI. Probably nothing is more readily accessible on the Internet than programming information. Start with something general like "how o I access a database" or "how do I draw a circle on the screen," and narrow it down to more specific questions, until you understand how to write the actual code to do what you want. Chances are that you'll nee to ask lots and lots of questions, and it may take hours for you to gather enough information to write something useful; but the next time around it will be a lot easier.
1
u/chrisrrawr 23d ago
join a community. talk to people. describe your problem and have them ask questions.
you can try to solve it yourself but if you don't have a solid problem solving framework you will not get very far and it will be frustrating.
1
u/itsghostmage 23d ago
Man, I run into this often. I try to break it down as much as I can and use comments to keep track of all the pieces. If I feel like it's just beyond myself, I'll reach out to forums, subreddits, etc. I don't always find the solution but a lot of the time, I just needed experienced outside perspective 🤷🏻♂️
1
u/minneyar 23d ago
This is actually the hardest part of software engineering--not writing code, but solving problems that you've never solved before and that nobody else has solved before, either (or at least, nobody who bothered to write a tutorial for how to do it). Working through that is hard, but that is actually the best way to improve.
As others have mentioned, it's all about breaking things down into smaller problems. What are the inputs for the problem, and what are the outputs going to be? If there's no existing library that can do what you want, what would you expect the interface for that library to look like?
1
u/IAteTonysLoMein 23d ago
Start small and iterate. I mean, even breaking it into "it's going to need to iterate through this list, so let's start there" and go from there. As has been mentioned elsewhere, there's nothing new in software development, so break the problem down far enough and you'll start making progress
1
u/BranchLatter4294 23d ago
Break it down into small problems. Solve the small problems. Put them together to solve the big problem.
1
u/WhaleBird1776 23d ago
That’s about the time I whip out the paper and pencil and start breaking it down until I have small pieces I do now how to implement
1
u/Amuro_Ray 23d ago
Have you ever tried to ask for help yourself?
Do you have an example of of something where there is no information on how to do it?
1
u/Rabbit_Brave 23d ago edited 23d ago
Do you think that these two points might be related?
It sounds to me like you've been short-circuiting opportunities to practice problem solving on simpler problems, and now you're running into harder problems which are too advanced to be good practice for your level.
1
u/ironicperspective 23d ago
Read the docs for the language you’re working in after breaking down the problem into as small of pieces you can manage.
1
u/grymoire 23d ago
Think about the problem and create a flow-chart. What is the input and what is the output/result?
When does the results change and why?
Write pseudo-code like
If something happensand if also this happensthen do this thingIf the thing has this, thendo something else.If you can't describe what you want it to do, you can't write a program. These is nothing wrong with writing code where a part says
#do something here when I learn moreWrite the part you know and do the harder parts later.
There are times when you realize your flowchart/pseudo-code is completely wrong. You just start over. That's how you learn. I've worked months on code and realize it is all wrong. Re-writing it from scratch isn't that hard because you now understand the problem and the solution.
Thinking is the card part. Coding is easy.
1
u/One-Trips 23d ago
Same. I just shrink the idea until one piece works, then it's easier to build out from there.
1
u/LukaRozman27 23d ago
The trick is to break the core mechanic into the smallest possible pieces, then Google each sub-part separately. If you hit a wall on step two or three, that's usually where you find out what you actually need to learn next.
1
u/desrtfx 23d ago
Well, exactly coming up with solutions, developing these solutions on your own, by yourself is what programming is about.
Copying tutorials is not programming. It's copying.
Throwing out code is not programming. Developing solutions is.
How did the people do it before the internet existed? They planned. They designed. They tried. They failed. They tried harder. These people (me included) did not have tutorials, nor places like reddit. We had to do everything ourselves. This is what real learning is about. Copying tutorials is not learning.
1
u/ShimonEngineer55 23d ago
What I do is I use formal logic and reasoning to break down how to solve the problem which sits at the root of programming. It’s math. This is why people say learning formal logic is critical to programming. Yes, you don’t need to know it to copy code and string things together, but it’s useful to think this way when problems are abstract and unclear (e.g. no YouTube video to show you how to do something specific).
Basically I approach these situations using formal logic which is naturally how engineering is designed since it is based on formal logic.
1
u/Xtreme_Neon 23d ago
when there's no tutorial, the trick is usually to stop searching for the exact mechanic and search for the general name of the technique behind it. for example "how do i make X" gets nothing, but the underlying idea (a state machine, a spatial hash, a debounce, whatever it is) has tons of writeups. also try finding an open source project that does something similar and just read how they structured it, even if you don't copy anything. a tiny throwaway prototype of only that one mechanic, with no other code around it, makes it way easier to experiment. what's an example of a mechanic you got stuck on?
1
u/Y0uN00b 23d ago
that /plan does
1
u/Blando-Cartesian 23d ago
You seem to be working from impression that software development is a linear process where the whole thing is designed correctly from the start and then implemented part by part. That's not how it works.
Start doing the best implementation you can think of. It doesn't matter how awful it is. You might look up something similar for ideas, but those ideas don't make sense since you don't know why those ideas might be good. Just start implementing it as you thought it could be done. You'll soon start dreaming of ways you should have coded it differently. Then refactor that aspect of it and keep doing that over and over. Do not keep building on top of an implementation you recognized as sucking. You'll only end up with something too big to fix.
1
u/JGhostThing 23d ago
Here is the process I use. This may be of use to you. If you try it once and it has problems for you, maybe this isn't for you. If so, I hope that you find something.
This is my process. I start with data or object definitions, pseudo-code, real-code, lots of unit tests. Testing is best done with many users. As many as you can get. Solve each one of their bugs. For each bug found, write a new unit test. Perhaps you'll have more ideas. Avoid this. Avoid creature feep (feature creep). I recommend finishing this program before making a new product by extending this one.
If this works for you, fine. If this doesn't work for you, also fine; you'll need to find a different process. Different techniques work for different people.
1
u/2daytrending 23d ago
Try breaking the mechanic into smaller parts and testing each one. Sometimes little trial and error teaches more than finding the perfect tutorial.
1
u/Puzzleheaded_Kale_96 23d ago
Das klingt für mich weniger nach fehlenden Tutorials als nach einem Denkfehler beim Einstieg: Du fängst beim Werkzeug an, nicht beim Problem. Probier es mal top-down. Schreib die Kernmechanik als Use Case oder User Story auf, so genau wie möglich. Zum Beispiel: "Als Spieler will ich X tun, damit Y passiert." Dann zerlegst du das in Teilschritte, und plötzlich sind es mehrere kleine Probleme, zu denen es sehr wohl Infos gibt. Dass es kein Tutorial für das große Ganze gibt, ist normal. Das gibt es meist nur für die Einzelteile. Eine KI kann dir dabei helfen, Lücken und Randfälle zu finden, eine grobe Architektur vorzuschlagen und die Teilschritte zu erklären. Wenn du dir einen Prototyp bauen lässt, lass dir jeden Baustein erklären und bau die Kernmechanik danach selbst nach. Sonst hast du einen Prototyp, aber nichts gelernt. Arbeite in kleinen Schritten mit Git und schreib früh Tests. Dann merkst du sofort, ob eine Änderung etwas kaputt macht, und traust dich auch an Dinge, die über deinem Niveau liegen.
1
u/mredding 23d ago
Dig deep. Learning to program isn't the same as learning to make a video game. A game is going to require linear algebra, calculus, and physics. Programming alone won't teach you these things. If you have enough FUNCTIONAL knowledge in these domains, more than just rote academic memorization, then you'll be able to apply this knowledge to code and make progress. This suggests you need a certain depth and familiarity with these subject domains, enough to make them functional.
So for whatever problem domain you're interested in, you need to learn the domain fundamentals enough to make that knowledge functional. There's just no rushing it. You don't have enough functional domain knowledge yet, that's what you're telling me.
37 years - I can write robotics, video games, databases, and trading systems all day - for me it's not a project but a chore. But image processing? That's a VERY fascinating subject I kind of need to get into, but I have NO functional knowledge in it - I can't even start. Writing an edge detection algorithm would be a project for me, and a major accomplishment if I did. But I can speak from personal experience - though a tutorial can walk me through the code to write to get the result, that's not the same thing as understanding how or why it works. THAT is the part I need.
And you need the equivalent for whatever it is you're doing. Become a domain expert first.
And I'll give you a hint that you will also want to work on project planning and management. Writing the code is not the first step, and not the most interesting nor difficult part. The PROCESS of managing the project, developing the project is language agnostic. You need to figure stuff out that has nothing to do with actual code. What are the algorithms and processes you need to understand first? Good project development and management skills will help you break the process down so you know you're digging into the questions and finding the answers such that you can measure your progress.
It's hard at first, tedious, but it gets easier as it becomes intuitive.
1
u/goldscurvy 20d ago
Its a challenge. I look for those opportunities. Often you can find tutorials. A more useful method is finding similar projects on github and reading the code.