Failure is a temporary state of mind, not an actual position
Saying your a failure, intones that you will always be a failure. This is not true unless you make it true. Believing you are only going to fail forever is almost a self fulfilling prophecy. Think about it, if you were to go into anything and everything believing your going to fail, odds are you will. Now this is especially true when your doing things that really just rely on you. It’s up to you to get better, learn, and succeed. Developing is hard, since you will fail often and it might feel like it wont ever get better.
Now does that mean your a failure? Hell no. There are basically 0 developers who don’t fail on a daily basis. The ones that don’t fail probably aren’t working that hard, or doing the same easy stuff over and over again. This feeling is very common. If your learning something like programming, its going to be hard, and rough road. But that’s why its worth it, it’s not easy, but then if it was easy everyone would do it!
Now, I said failure is a temporary state of mind at the start, because you can think of yourself as a failure all you want, but you can change whatever is making feel like that by overcoming your challenges. You could be spending 2 days, or 2 weeks on a problem and finding it was something dumb. You always can overcome, there isn’t a high limit, you don’t need to be able to run a 5 minute mile, or have a high IQ. You just need time, patience, practice and grit to see it through.
You will learn more trying to figure something out, than if you succeed the first time. It’s in failure we learn the most.You might spend a month dealing with an issue, but its still not permanent if you keep pushing. You might try 500 different ways of solving a problem before figuring it out, and you know what you just learned 500 ways not to do something! If you didn’t struggle, if you didn’t fall flat on your face, you probably wont learn a single thing, you would miss out on all that experience.
I’ll leave you with this, failure is the best teacher embrace it and learn to overcome. There won’t be a day when you know everything, so expect to fail, and see it as a opportunity to grow, succeed and overcome.
Goodluck, happy programming and keep it up!