It's normal to get stuck from time to time when you are trying to build something. However, when I make the same mistake again and again I know it has to do with my lack of knowledge about a topic.
When it is a framework or library specific to problem the answer is most likely in the docs, on stack-overflow or in a tutorial. However when it has to do with build in language features or theoretical knowledge it can be harder to spot what you don't know. To be fair I bump into the right information when I need it by accident. It's usually hidden in a talk or a well written article or post.
Two real life examples of the 'problem' I'm talking about:
When I stared using a lot more asynchronous JS the expectation vs reality of what I was trying to write did not always match. Some tinkering or workarounds would usually solve the problem. It wasn't until a very enthusiastic JS dev advised me to watch a talk on the event loop that I realized what a gap in my knowledge was. I had no idea how JS handled async operations under the hood and why some things wouldn't work.
In case you haven't seen it and you like JS check out "What the heck is the event loop anyway" by Philip Roberts. He talks about a lot more than just async programming, a lot of JS related buzzwords will make sense after hearing this talk.
Something I'm struggling with right now is ownership and borrowing in Rust, even though the book has an entire chapter on it. It basically has to do with the memory used by your code and whether you try to use the real value, a reference or a copy.
I frequently fight with the borrow checker when I try to do something in Rust. After some practice I started to get a little bit better and can at least understand why I am stuck. I ran into this post and if you happen to struggle with ownership this one will really help.
To be fair most things related to memory in Rust are a problem to me right now because I don't know that much about it. I guess that is the thing I'll have to understand at least a little bit better to truly understand what I'm doing.
How do you reveal what the gaps in your knowledge are? Do you have a favorite method for learning something more theoretical and applying it? I'd love to hear from other dev's how they deal with this 😄.
~ Happy Coding :)