News for hackers. Stuff that matters.
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.