[In 1949,] as soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realised that a large part of my life from then on was going to be spent in finding mistakes in my own programs. — Maurice Wilkes
In my opinion, this is the core of the reason why many people who are interested in programming (let alone those who aren't) lose interest once they start doing it. The experience of programming, even as an expert, let alone as a beginner, is one of being repeatedly told you are wrong by a compiler, only to have core dumps demonstrate your failures, only to have a program that at least doesn't crash but also doesn't do what you want or expect. Repeat this cycle enough times and you'll eventually have something that does what you expect often enough that you (incorrectly) deem won't be embarrassing to ship.