Oct 9th 2012, 13:47 by B.R.

Shutting out foreign brains is a good way to foster mediocrity

STUDENTS are annoying. They sleep till noon, listen to awful music and think Jackass is amusing. However, these are hardly compelling reasons for any nation to curb the influx of foreigners to its universities.

America has the best universities in the world, but its immigration enforcers have done a good job of making them less attractive. The proportion of the world’s overseas students who come to America has fallen from 23% in 2000 to 18% in 2009. America educated 66% of the world’s MBAs in 2000; that share fell to 44% in 2011, and has shrivelled even in absolute terms, from 126,000 to 116,000. The biggest turn-off is the difficulty of obtaining a work visa after graduating—even highly-skilled foreigners typically wait a decade for a green card. President Barack Obama pays lip service to the need to open up, but has overseen millions of deportations. A new study from the Kauffman Foundation, a think-tank in Missouri, finds that anti-immigrant politics appear to have stunted American enterprise. The proportion of Silicon Valley startups with immigrant founders has tumbled from 52% to 44% since 2005.

Britain has turned even harsher. The Conservative Party has promised to reduce net immigration from 250,000 a year when it came to power to 100,000 by 2015. Since it has no control over the number of EU citizens who enter Britain or the number of Brits who leave—the two main drivers of net immigration—it finds itself squeezing students from outside the EU.

It has not imposed an absolute cap on the number of student visas, but it has made the application process more arduous, and made it harder for non-Europeans to work in the UK once they have graduated. Previously, students would be allowed two years to find work. Now they must find a sponsoring company and a job with a starting salary of £20,000 ($32,300) a year, or face deportation. High-tech startups and small firms will find it especially hard to cut through the new thicket of regulations. Even big firms are confused as to whom they can employ. Students are also being told they can no longer bring their wives and children with them while they study.

Bad news travels fast. When foreign medics and mathematicians saw pictures last week of foreign students in Britain queuing overnight to register with the police, they drew the obvious conclusion. Blogs aimed at Asians who want to study abroad now take it for granted that America and Britain no longer welcome them. Enrolment at the British business schools covered in The Economist’s new MBA ranking has fallen by 11% over the past year.

All this matters for three reasons. First, education is a lucrative export: foreign students pay handsomely for tuition, textbooks and toga parties. Second, mixing with bright people from elsewhere is good for native-born students; it helps them understand the globalised world in which they will later seek jobs. Finally, foreign students forge connections that can last a lifetime. If they have studied or worked in a particular country, they are more likely to do business with that country when (as is likely) they eventually return home. Shutting out foreign students is thus much more damaging than sabotaging any other export industry.

How to lose the war for talent

Other countries are keen to woo the brains that America and Britain reject. Australia has reversed a crackdown on foreign students and started to welcome them. Canada has gone further, allowing all postgraduates to stay and work in the country for three years, with no restrictions. Those two countries’ combined share of the global overseas-student market rose from 5% in 2000 to 12% in 2009; that trend could accelerate.

Many continental European universities have joined the fray, offering courses in English and MBAs that cost far less than American ones. Standards are fast improving in Asia and South America, too. Ten years ago AMBA, a British body that accredits business schools, recognised none in China. Now it accredits 20, including five new ones in the past six months.

The world is engaged in a war for mobile talent. Nations that refuse to take part will lose. The good news is that the most potent weapon costs nothing at all. It is a welcome mat.