3 ms·
>I would expect anybody in a project to code using English Why? This might make sense for open source code at the moment, but if it's code internal to (say) a
by foldr 17y ago
>I would expect anybody in a project to code using English
Why? This might make sense for open source code at the moment, but if it's code internal to (say) a German organization, commenting in the native language of the coders is likely to be easier and lead to less confusion.
- sb 17y agoBut what if you have multi-national staff, or at least expect to hire non-natives?
- jacquesm 17y agoIn this case the answer would then be "Learn German". Most multi-nationals have coding standards that mandate the use of English though. But you'd be surprised how many companies that grew to be multi-nationals from regional companies have tons of code documented and written in the native language.
- mseebach 17y agoBecause when you use English, you can write many statements that reads nicely - which you should aim for. if user.hasFoo() and company.isBar() then baz.play( jazz ) In German: if benutzer.hastFoo() and firma.istBar() then baz.spiel( jazz ) That's five language-switches in a single line. Much, much harder to read. (granted, only one if the language uses && and braces instead of and and then)
- foldr 17y agoDoes it really make it "much, much" harder to read? No proficient coder will be reading lines of code as English sentences, even if by some happy coincidence they happen to read that way. I don't think having a few keywords in a different language makes much difference. You might just as well say that the switch in languages makes the code easier to read, since it separates out keywords from variable names.
- mseebach 17y ago> Does it really make it "much, much" harder to read? Yes. Maybe not harder, but more strenuous. > No proficient coder will be reading lines of code as English sentences In that case, I'm not a proficient coder. Neither was the inventors of the IF..THEN..ELSE and WHILE .. DO .. and DO .. WHILE .. statements. Or the guys who made the convention to use hasXX/isXX for boolean getters. Or LINQ. > I don't think having a few keywords in a different language makes much difference. I do, and I've coded and maintained a lot of code in both camps. And, we're not aiming for "much difference", we're aiming for "easier". > You might just as well say that the switch in languages makes the code easier to read, since it separates out keywords from variable names. Well, I don't think any proficient coder has any problem with that. We have syntax (and syntax highlighting) for that purpose.
- foldr 17y ago>Yes. Maybe not harder, but more strenuous. So, what you actually mean to say here is "no"? Sorry, but I just don't see that having non-English identifiers makes it any harder (or more strenuous) to read. >In that case, I'm not a proficient coder. You certainly are not proficient if you attempt to read lines of code as English sentences because they happen to contain a few English words. >Well, I don't think any proficient coder has any problem with that. Nor will any proficient coder have a problem with a few English keywords.
- rimantas 17y agoBecause we live in the global world and you can never be sure where will your code end up. I have had to deal with comments and DB schema which were neither in English nor in a language I speak, there was little pleasure in that. Having at least schema and indetifiers in English would have made everything much much easier. All programming languages I work with are more or less English based, so having schemas, comments, etc. in English is just a good fit and makes code easier to get should it land on the lap of some guy in another country.
- jacquesm 17y agoThat may not remain the case for long: http://www.chinesepython.org/cgi_bin/cgb.cgi/english/english.html http://www.chinesepython.org/cgi_bin/cgb.cgi/english/english...
- foldr 17y ago>Because we live in the global world and you can never be sure where will your code end up Well you can't be sure of anything, but sometimes you know for more-or-less certain that English speakers aren't going to read the code.