Keep your code in one language as a naming convention

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the workflows category.

Last Updated: 2024-04-26

I started working on someone else's project where there were no clear naming conventions for files and variables (e.g. are view folders singular or plural, capitalized or not? What about controllers?). Some files and methods were in English, others German. Given the mess, I started to abandon thinking about conventions.

This turned out to be a bad idea, since later the need arose to standardize everything, and I noticed my own code was contributing to the problem, which I was ashamed of. In future, I will ask about (and document) file and variable naming conventions before starting.

In particular, it's worth considering what natural language to use and when - e.g. for companies that are in French and English markets, one must decide where the languages get used (e.g. are only the routes in French but everything else in English?) This can affect, for example, integration testing, where there might be expectations against a certain language being on page or in a form element.