I currently have three independent projects on my plate - each requiring development in a different language.
There's a WCF Web Services / Windows Forms project in C# .Net 3.5, a web site in PHP with generous javascript, and maintenance on a legacy Windows application written in VB 6.
Because I'm switching so often, I frequently start writing lines of code in the wrong language without thinking. It's getting better with time, but there are always slip-ups and I'm obviously not being as productive as I could be.
Do many other developers encounter this language-switching problem?
If so, how do you manage or minimize productivity problems caused by having to switch your brain between languages?
Edit:
As a perfect example, look at a foreach loop for my three projects:
C#:
foreach (Person p in myPeople)
{
...
}
PHP:
foreach ($myPeople as $p)
{
...
}
VB:
For Each p As Person in myPeople
...
Next