Learning a programming language is also about as difficult (and probably easier for some) than learning a foreign language (Spanish, French, etc) for 1-2 years which most states require.
I would just like to point out that students in the US do not actually learn languages in school. The "1-2 years" is hardly sufficient and US students do not graduate with the ability to read/write/speak another language besides English, as kids in countries like Taiwan, Netherlands, etc. do
I never suggested 1-2 years was sufficient or effective. In fact, the 2 years of the required Spanish I was taught was quickly forgotten by the time I graduated.
At least by learning programming, students can learn concepts and ways of thinking about problems that they can reuse later in life.
I was arguing with a friend about this long ago. He won the argument by simply asking me to translate the word "rectangle" into Spanish. It really opened my eyes to just how inadequate my foreign language education had been.