DEV Community

Discussion on: why branching on git is wrong

Collapse
 
pauljherring profile image
PJH

So,

if (useNewLogic) {
  awesomeNewFeatureEntryPoint();
} else {
    legacyEntryPoint();
}

Two months later:

if (useEvenNewerLogic){
    evenAwesomerNewFeatureEntryPoint();
}else{
    if (useNewLogic) {
        awesomeNewFeatureEntryPoint();
    } else {
        legacyEntryPoint();
    }
}

The following March:

if (useMagic){
  magicEntryPoint();
}else{
  if (useEvenNewerLogic){
      evenAwesomerNewFeatureEntryPoint();
  }else{
      if (useNewLogic) {
          awesomeNewFeatureEntryPoint();
      } else {
          legacyEntryPoint();
      }
  }
}

Not sure that I'd like to be the one to refactor that lot after a year or so...