DEV Community

Gregory Witek
Gregory Witek

Posted on

What *human* language do you write your code in?

Hi folks, a question just popped to my mind and I wanted to ask a broader audience: when writing code, do you name your variables/functions/classes etc using English or your native (or yet some other) language and why?

I'm asking cause I have seen at a couple examples in my career where people used language other than English and I'm curious how common it is.

The most obvious argument for using native language is that it's all easier to understand and especially for people who are not very fluent in English, coming up with proper names for functions in English might be challenging.

On the other side using another language causes a linguistic mix - we all probably use languages that have English keyword, so that means that all built-in functions and 3rd party functions are in English, while our own ones are not, which might make it more challenging to read.

Top comments (3)

Collapse
 
tbroyer profile image
Thomas Broyer

I use native language (French) for business entities, those we talk about with the customer. Everything else (more "technical") is in english. It creates some "fun" mixes but overall code is much easier to reason about.

I once worked on a project where everything was translated to english (at customer's demand, and with their own dictionary) and we were constantly wasting time translating between the requirements (in french) and code (in english).
I'll never do that again.

Collapse
 
noemarbali profile image
noemarbali

I use both. But I do prefer use native language. Why? Because it feels so smooth, when I use English it will take me more time to think.
But I will think again,because nowadays people work internationally and I think I have to consider it also.

Can't wait to read what others dev do.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

Note that part of this is dependent on the language being used. Some languages limit variable and function names to specific character sets, while others are less picky. Python and Elixir for example accept most Unicode letters and digits, and a lot of different punctuation, allowing for identifiers with names like lösen, είδος, запись, or possibly even 値 (I’ve never actually tested CJK ideograms as identifiers in either language though), but C is limited to ASCII letters, ASCII digits, and the underscore.

On the flip side, there are actually languages out there that use a non-English natural language as the basis for their keywords. The most interesting examples are probably ALGOL 68 (the official standard was published in a myriad of languages, and there were official translations of ALGOL itself into German, Russian, Bulgarian, French, and Japanese) and Scheme (the way Scheme works, internationaliserad versions can literally be loaded as libraries). Wikipedia has a page dedicated to such languages that lists a number of others.