The real issue is not learning to code, it is learning to problem solve. That is the part that is hard.
I recently overheard a guy on the train talk about why he dropped CompSci as a major to his friend. He talked about the times where he would leave out a semicolon and the program would crash. And it would take hours for him to find the culprit. Leaving out the efficiency of his debugging, what I listened to more was the tone of his explanation. It was like a diatribe. His attitude was literally that any career where you have to worry about little things like semicolons was not the type of career for him. I suspect he had gone into the CompSci program because of the material benefits. And left once he discovered the devil is in the details. Programming is like weaving more than writing. I remember that he said he had switched majors to Business and loved it. Basically, he said CompSci was torture. Because he did not revel, like many of us do, in the sometimes long and backtracking path that we go through to write code. To make something, to weave lines of code into something tangible.
I don' think that example proves your point: perhaps he loved problem solving / was an excellent problem solver and pursued CompSci for that reason, only to drop it because he disliked the formalism required by programming (or math, for example).
While coding is a formal style of problem solving, I think the sentiment that those who can't code can't problem solve / dislike problem solving is ill-founded and misguided.
I recently overheard a guy on the train talk about why he dropped CompSci as a major to his friend. He talked about the times where he would leave out a semicolon and the program would crash. And it would take hours for him to find the culprit. Leaving out the efficiency of his debugging, what I listened to more was the tone of his explanation. It was like a diatribe. His attitude was literally that any career where you have to worry about little things like semicolons was not the type of career for him. I suspect he had gone into the CompSci program because of the material benefits. And left once he discovered the devil is in the details. Programming is like weaving more than writing. I remember that he said he had switched majors to Business and loved it. Basically, he said CompSci was torture. Because he did not revel, like many of us do, in the sometimes long and backtracking path that we go through to write code. To make something, to weave lines of code into something tangible.