Vassilii Khachaturov wrote:
> The length is due to the diff inability to say that a lot of
> lines were just indented right (as they were put inside an else
> {} )

Use the -w argument to diff to eliminate the whitespace noise for
readability.

But regardless, don't do this. :)

Wrapping huge blocks of code (like this one, which is a big GUI
object creation routine) inside giant if() statements is *very*
bad for readability, and even worse for maintainability.  If you
absolutely have to, then it is almost always better to split off
more functions as in:

  if(props.globals.getNode("/yasim") == nil) {
      popupWarningDialog();
  } else {
     createWBDialog();
  }

A bigger issue, however, is that this is *not* supposed to be a
YASim-specific dialog!  All it does is set fuel and weight
quantities in the property system, and the intent was always that
it would be FDM-independent.  As it happens, YASim is the only
FDM that reads those properties, but that is hopefully a
temporary situation.  This patch, IMHO, provides a disincentive
for the JSBSim folks to implement this feature as it explicitly
cuts them off from the dialog for testing.

Andy


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to