Right after Christmas, Vaughn Vernon did a survey on X (formerly Twitter) whether - if your first language is not English - you should or want to code in your native language or in English. This is an interesting question and while I have posted some short answers, I want to elaborate more on this.
Programming is done in English, right?
Programming languages have always been English. This means that all keywords in any programming language used up until today have been English (one exception I know is discussed below): class, final, public, private, interface, void etc. are all English terms and must be used to satisfy the compiler. This means that anyone who learned to code learned to do this in English.
There is one exception to this that I know of. Microsoft's Office offers Visual Basic for Application (VBA) for automating tasks (i.e., Macros). VBA is a Basic dialect which also uses English keywords. However, Microsoft localized VBA with Office 95. A German developer (or to be more precise: a user using the German version of Microsoft Office 95) had to write Funktion instead of Function and Prüfe instead of Switch. This change was quickly reverted because the acceptance was... well... not good. Developers simply are used to write code in English: All examples you can find are English, documentation is in English, and libraries and frameworks are in English. Software developers form an international community and have mostly agreed to use English! The only localized thing that remained in Microsoft Office is that functions used in calculated cells in Excel are translated (I think they are internally stored in English because it is possible to open a spreadsheet created with an English version of Excel with a German version and the names appear translated and vice versa).
The functions in calculated cells remain translated while VBA did not may shed some light on different user groups. VBA is a programming language and as such more used by developers or people with a similar skill profile while spreadsheets are used by... well, normal users like accountants.
So much finance is done in Excel (and we may argue whether this is a good thing or not) but accountants can build complex spreadsheets.
The underlying assumption must be that accountants may build spreadsheets better when using their native language, which makes sense because school math is taught in their native language. As such they are more familiar with
Code is Communication
What does this mean for the code base of our software projects, e.g., written in Java, Python or C#? First of all, I like to take a short step back. As the language in programming language indicates, a programming language not only for coding - it is about communication. And the main part of the communication is not between the developer and the compiler but between developers themselves and between developers and other stakeholders. Yes, the accountant might not read the source code for the finance application that you develop directly, but you as a developer need to translate between your code base and the stakeholders, either because you have questions or because stakeholders have questions. So we should always keep in mind that software development is very much communication and we as humans are likely better in that in our native languages.
If our project is international, then the question regarding the language becomes moot - at least in my opinion. International teams usually use English, and this means that all documentation and communication will likely be in English anyway. This in turn means that non-native speaking developers will learn the domain in English terms and thus are able to communicate and design the domain with English names.
Reasons to use Your Native Language
But what about more local projects? Or in domains that are very specific to a country and difficult to translate? There are jokes that the majority of tax regulations worldwide are written in German (and unfortunately, I think that this is true). Would we write a German tax software with English domain terms? That's likely difficult especially if we need to ask questions to our tax consultants on how to calculate things.
For years I have been in a Swiss project that is concerned with land register data (but Switzerland has four different official languages none of which is English but the predominantly one used is Swiss German). What language should we use for our domain concepts and thus use as names and identifiers in our code? My answer years ago would have been to use English terms. But from today's perspective I was probably a bit naive. "Everyone uses English names" is not a real design rationale and thus Vaughn's question got me thinking.
But do we want to mix German (or another language) with English? It's not so nice at many points.
And my main concern aren't the keywords of the programming languages.
Instead there are many conventions like prefixing getters and setters with get
and set
in Java, which are required to make certain frameworks to work.
What not to Translate!
In the last months I have been building a small generator for math questions for children out of totally private reasons.
And I used German names for the domain because I can explain math and name math concepts in German much better than in English.
For domain terms (i.e., nouns) using German is easy.
Interestingly, verbs are much more difficult - and not only due to get
and set
.
For example, there is also the Builder Pattern and consequently a build()
operation preceded by withXYZ()
operations.
I would never translate Design Patterns (although the German edition of the book did this, which was a total nightmare) and as such I would not translate these parts of the method and class names.
Also, collections etc. will be used with the API provided by the language. As such, we will always have the add()
in customers.add(c);
- regardless of whether we localize customers
and our c
or not.
What about adjectives?
addNewXYZ()
?addNeuesXYZ
?fügeNeuesXYZHinzu
?
Luckily, Java and C# support Unicode names so that they can accomodate Umlauts in German (and all kinds of different characters for different languages).
In my small application I settled with addNewXYZ()
. Perhaps I could live with translating the adjective but again the translation of the verb is cumbersome -
especially in German, because there are cases in the Grammar where verbs will be split like in this case (hinzufügen is the indicative that is used as füge... hinzu in its imperative form), which breaks the verb + object naming scheme.
Although this math project is a simple one, I can read and understand the code well and the code is easy to navigate due to the consistent naming (and structure - but that is for another time).
For Swiss land registries the case was more difficult.
The official land register schema provided by the Federal administration is in German, which might be a point of discussion with French and Italian speaking land register officers.
However, all software providers are based in the German-speaking parts of Switzerland and as such no French-speaking land register officer will see the XML being passed around.
The platform Terravis has built simpler schemas for different stakeholders and these were to be done in English.
The reality is that most of them are a mix between German and English because nobody knew the exact translation of deep-down land register details (if there is any equivalent at all).
What is the exact difference between a
What does this all mean? First of all, it is much easier if your native language is English and all your stakeholders are native speakers :) Although, British and Americans would likely argue over which English to use - a comment about which the Australians will certainly rage!
If not, I have realized by thinking about this question that I would prefer to use German nouns in projects that have German speaking stakeholders. The Ubiqituous Language should be in the same language that is spoken by the stakeholders. Otherwise, you run into problems with translations or mistakes in the translations, and people being added to your team will likely need to learn the domain-specifics of English in addition to the domain itself. Do I like the mix of the languages in the code? I am still not sure as you can see by the examples given above. Currently, I prefer just using nouns in the native language and the verbs and adjectives in English will help to integrate your code with framework and library code and the experience reused from design patterns.
<<< Previous Blog Post Mein Weg von der Sprachtherapie zur Geschäftsprozessoptimierung: Ein unerwarteter Karrierepfad |
Next Blog Post >>> Camunda 7 Message Events and Optimistic Locking |