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.