For those who are bilingual, how do you name your variables and functions? What about comments? Do you only use your mother tongue? Do you mix the languages?
For example: You're Portuguese and use English for all of your projects, but now you have a project that needs to be in Portuguese (only the frontend); what's your plan?
Top comments (20)
All English, all the time.
You never know who else needs to look at or work on your code at some point in the future, even if it's a solo project. It's a good habit to get into no matter what (and if you're not fluent in English it can also be a good learning experience).
Standard libraries/APIs/keywords are in English anyway so even if you want to write your code in another language, at best it's going to turn into an inconsistent jumble of that language mixed in with a lot of English. I really don't see much advantage to doing this.
Hey there, Portuguese here too.
I only use English for programming for two main reasons:
Although I'm not thinking about changing this approach, I'd like to know others opinions.
French here.
I only use English for variables, functions and comments. I've been used to do things like that. I learn to code with english resources, so it feels more natural to code in this way. Commit messages are also in English. Like Joao said, I think english is universal enough, most keywords are already in english, and clear code doesn't require a high level of english I believe.
The problem that I have sometimes is to come up with good names to describe what the function or variable is supposed to be.
I have trouble finding good names in French that are not so long you've forgotten the beginning of them when you reach the end.
I guess it's a force of habit.
It honestly feels weird to try to write code in French. It just doesn't feel natural. I suppose it's because I only wrote in English, but it's really strange.
Been in the same case .. Our direction decided to outsource a project to India .. they asked us to translate docs from French to English
Spanish here. All english, everywhere, no exceptions (even JIRA tickets, comments, Confluence pages).
The main reason for me is being able to hire international developers. And I find it really important to have a multicultural team because it brings new points of view, alternative ways of doing things and it's just more fun overall. I am currently working in germany and I could join my company effortlessly because they had everything in english.
P.S. If I do a job interview and I see that the company has any code that is not all in english, it is a big red sign for me.
Monolingual Englishman here.
English obviously since it's all I have but, I always use American-English spelling for consistency. Color over colour, center over centre, canceling over cancelling and so on.
I would never do that outside of code.
Heya!
Native language - Russian;
Code language - English; the only option that makes sense for me;
Comments language - English; I would write Russian occasionally if required, though;
Obvious advantage is being understood virtually worldwide.
Illusive advantage is that sticking with ASCII lifts off text encoding problems.
I am a native Italian speaker, now living in Spain. I am fluent in three languages, but I have always used English for variable names and comments.
Three reasons:
I speak French and English. I always code in English. For work, I have to code in English so others will be able to work on the same code. If I do a quick personal project, I don't even consider doing it in French, because so many of keywords in the language are in English, and when I read code, I read operators in English.
Once, I wrote something in French for a presentation I was doing, and the process was really difficult. When you speak two or more languages and interact with someone who speaks the same languages, you can change between languages easily, even in the same sentence, but there are unspoken "rules" for when you can change. You wouldnt' say, "Le cat est going d'attraper the oiseau red sur the arbre". When I code with French variables, that's how it feels. I spend too much time "code switching" between languages, it's painful:
If la somme is greater than or equal to le minimum requis, then fait quelque chose
Brazilian here.
I only use Portuguese for one main reason: it's impossible to effectively translate specific business domain vocabulary without creating ambiguity and confusion between developers and stakeholders. This is called Ubiquitous Language in Domain Driven Design.
We've tried once to mix languages (Portuguese for domain and English for the rest), but it quickly became a total mess.
I'm from Venezuela, I use Spanish and English between projects.
I use Spanish code for everything, unless the project is for a external company/client that speak English.
Local projects "spanish".
Spanish speakers "spanish".
Mexican projects Spanish for code and frontend "spanish and English" if they needed.
If I work with others I use their language "english or Spanish"
Puerto Rico. Well was really difficult, they use both english and Spanish, I started the code in Spanish but they use specific things on English so I mixed and was an awful code, even databases fields was weird hahaha I didn't know English well when I started the project (I need more practice)