views:

114

answers:

1

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
+3  A: 

Definitely been there.

While it's frustrating to sometimes get caught up in the incorrect syntax, my guess is that in the long run you'll be a much better developer for having the multi-platform exposure.

The best thing I've found is to try to get blocks of significant time to focus on the project at hand. Ideally at least a couple of days. I usually don't even bother trying to get started programming if I don't have an hour or more to focus, because there is just too much inertia to overcome before I can even consider getting in the zone. Working on multiple disparate projects just makes it worse.

I'd suggest trying to block off your week. Perhaps Mondays for maintenance, Tuesday and Wednesday for the forms project, and Thursday-Friday for the web project. I've found that having a routine like that makes it easier to just fall into, rather than always wondering what I should be working on.

easel