Why should we always program in English?
September 3, 2012 | 2 min ReadWant to be a developer, but your English is really, really bad? Are you learning some other language and want to practice while doing your job? Or do you just want drive your colleagues insane with code that only you can read - because you happen to know Hindi?
If you are a Javascript developer, this internationalization tool fixes all these problems.
Instead of writing…
function foo( arr ) {
for( var i = 0; i < arr.length; i++ ) {
if( arr[ i ] === undefined ) {
arr[ i ] = null;
}
}
return arr;
}
…you could write…
funktion foo( arr ) {
für( var i = 0; i < arr.length; i++ ) {
wenn( arr[ i ] === undefiniert ) {
arr[ i ] = null;
}
}
rücksprung arr;
}
… or …
функция foo( arr ) {
для( пер i = 0; i < arr.length; i++ ) {
если( arr[ i ] === неопредел ) {
arr[ i ] = нуль;
}
}
возврат arr;
}
… and the code will still work.
Seriously though, I’m not 100% sure if this is supposed to be a joke or not. I’ve seen developers naming variables in their code in their native language. I even did it myself - when I was 12.
I’m not sure if it’s because of a lack of language skills or some sense of linguistic purity/anglophobia, but it’s really cringe-worthy. Not only will almost no one outside your country be able to understand it, but the constant switching between English keywords and another language is just confusing and hard to read. (Though I guess this tool would solve that particular problem…)