I agree, it's both. I remember a donald knuth quote that about 2% of undergraduates have the mental quirks that make them good at programming. He didn't say "intelligence" or "talent", he said "quirks".
That wasn't just false modesty, there are a lot of factors that have to come together for someone to want to be a programmer, and some of them really do seem more like quirks than talents at times.
That wasn't just false modesty, there are a lot of factors that have to come together for someone to want to be a programmer, and some of them really do seem more like quirks than talents at times.