Now that this thread has been resurrected, I think I object to one of the premises. I don’t thing the purpose of teaching a foreign language is to foster critical thinking, structures of grammar, or even syntax (I do think that is the purpose of linguistics courses and foreign language classes that are taught in the CONTEXT of linguistics degrees, but that is a different beast). I believe that foreign languages are taught for the purpose of giving the student the potential ability to communicate effectively when English is not a language that can be used to communicate effectively.
If those other purposes were the goal of teaching foreign languages, foreign language teaching would be done very differently, in my opinion and experience (based on having gotten a Bachelors in Linguistics). Because I disagree with that premise, I believe that substituting a coding language does not fulfill the purpose of foreign language requirements.
Now, to be clear, I feel that requiring a foreign language is, in general, an outdated way that colleges/universities try to make their students seem more well rounded. I believe that requirement should be broadened in the modern world where employers want well rounded employees, but “fluent in a foreign language” is just one of many acceptable ways for an employee to be well rounded. This is especially true of humanities majors where foreign languages are often required, but rounding out in sciences / tech would better impress potential employers.