One thing that has always annoyed me, is when people program in their own language (as in: non-English). They will use variable and function names in their own language, and write comments in their own language, and whatnot.
What’s worse, I noticed that a lot of course material also does this, even at an academic level. Which is rather ironic, since many such courses will use textbooks in English. However, for homework and other assignments, they generally use the native language, not just for the questions, but also in code examples and such.
NEVER DO THAT!
There are many things wrong with this, I will try to list a few:
- Many languages use special characters, which either need a specific ANSI code page, or an extended characterset using unicode. This means that the text is not guaranteed to display correctly on all computer systems. The encoding is also not guaranteed to be compatible with all programming tools. Sticking to the standard 7-bit ASCII codes is the only way to guarantee that the code will be readable on a large range of systems, and can be processed by a large range of programming tools.
- Even if you think your code will never be used outside your own country, that is no reason to assume your code will never be viewed by people who do not speak your language. Especially in Europe, schools and organizations are getting more international every day. People are allowed to work or study anywhere within the European Union. Universities are teaching classes entirely in English more and more, to accomodate foreign students. Companies hire people from outside the country to get higher-skilled people and/or better value for money. People contract companies abroad, etc. If you need to translate your code because a foreigner needs to read it, you’re already too late.
- Virtually all code you are interacting with, be it OS-code or other third-party libraries, is also written in English. So when you interject your own language in there, it only makes things more confusing.
- Virtually all programming languages use keywords, mnemonics and other terms taken from English (for-loops, while-loops, if-statements, etc) and have naming conventions for code that also follow English. Take for example JavaBeans, where properties are expected to use method names that start with get/set. It does not make sense to start your method name with an English term, and then continue in another language.
So well, if you’re new to programming, try to write all your code in English from day one. Don’t teach yourself the bad habit of programming in your own language, then you won’t have to drop that habit later either.
If you already have the bad habit of programming in your own language, then stop doing it right away!