Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

So I've got to work with this set of code here for a re-write, and it's written by people who speak both English and French.

Here's a snapshot of what I'm talking about (only, about 4000 lines of this)

function refreshDest(FormEnCours,dest,hotel,duration) {
    var GateEnCours;
    GateEnCours = FormEnCours.gateway_dep.options[FormEnCours.gateway_dep.selectedIndex].value;
    if (GateEnCours == "") {  
        FormEnCours.dest_dep.length = 0  
    } else if (FormEnCours.dest_dep != null && FormEnCours.dest_dep.type && FormEnCours.dest_dep.value != "ALL") {
      if (Destinations[GateEnCours] == null || Destinations[GateEnCours].length == 0) { 
          RetreiveDestinations(FormEnCours,GateEnCours,dest,hotel,duration);
      } else { refreshDestSuite(FormEnCours,GateEnCours,dest,hotel,duration); }
    }
}

function refreshDuration(FormEnCours,GateEnCours,DestEnCours,hotel,duration) {
    // Refresh durations
    var FlagMoinsDe5Jours = "";
    var Flag5a10jours = "";
    var Flag11a16jours = "";
    var FlagPlusDe16Jours = "";
....... 

Is there any approach that I, as a speaker of only one of these languages, can use to make this entire process a lot less painful for both figuring out what everything does, and then refactoring it?

share|improve this question

4 Answers 4

up vote 6 down vote accepted

This isn't going to be that helpful, but I only see two options.

  1. Learn French
  2. Refactor

I am strongly in favor of the second option. It prevents someone from having to deal with the same issue in the future. It also increases the consistency throughout the code base to a certain style of coding (which seems to be lacking in general as there are variables that start with both upper and lower case letters).

4000 lines is not too bad to have to fix. I think the bigger issue is to get the team that works on the code base to follow a defined style of coding.

share|improve this answer
    
But this fix better be made at the right time, or else the product will suddenly break. –  Job Mar 16 '11 at 20:11

I had a similar issue once with a classic ASP site, only it was a mix of English and Spanish. I became good friends with Google Translate. I also changed names to English when I could as my English speaking team had taken over the project.

Is there anyone on your team that speaks French? Could they help with some translations?

share|improve this answer

about 4000 lines of this

You can probably fix this in a 2 hours with Goggle translate + Search and replace.

Once done, Get your self a beer and add it to your "Black Book of War stories" with proper embellishments.

share|improve this answer

If you ever need to send code back to that team, be sure to change the names to Russian. And if your compiler allows it, use Cyrillic characters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.