News for hackers. Stuff that matters.
Re:What's the best / most interesting piece of code you've e... by foldr on Monday November 16, 2009 @08:56AM (#944421)
>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.

Re:What's the best / most interesting piece of code you've e... by mseebach on Monday November 16, 2009 @09:14AM (#944438)
Because 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)
Re:What's the best / most interesting piece of code you've e... by foldr on Monday November 16, 2009 @11:32AM (#944672)
Does 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.
Re:What's the best / most interesting piece of code you've e... by mseebach on Tuesday November 17, 2009 @06:19AM (#946235)
> 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.

Re:What's the best / most interesting piece of code you've e... by foldr on Tuesday November 17, 2009 @12:44PM (#946839)
>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.

Re:What's the best / most interesting piece of code you've e... by rimantas on Monday November 16, 2009 @09:16AM (#944440)
Because 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.
Re:What's the best / most interesting piece of code you've e... by foldr on Monday November 16, 2009 @11:14AM (#944643)
>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.

Re:What's the best / most interesting piece of code you've e... by jacquesm on Monday November 16, 2009 @09:26AM (#944449)
Re:What's the best / most interesting piece of code you've e... by sb on Monday November 16, 2009 @09:05AM (#944430)
But what if you have multi-national staff, or at least expect to hire non-natives?
Re:What's the best / most interesting piece of code you've e... by jacquesm on Monday November 16, 2009 @09:08AM (#944435)
In 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.

Re:What's the best / most interesting piece of code you've e... by sb on Monday November 16, 2009 @09:15AM (#944439)
See, there is a catch 22: If they had used English in the first place, they wouldn't run into these problems later on ;)
Re:What's the best / most interesting piece of code you've e... by foldr on Monday November 16, 2009 @11:40AM (#944683)
That's not a catch 22, it's just a problem.