• (nodebb)

    This isn't quite as bad as it looks at frist*. It's mostly just a single function that has too many parameters. Making it a macro might make it easier to read, since you could replace all of the repeated object properties (which is what makes the line so long) with a few variables. Changing the parameters to be a few objects and then using the properties inside the function would also help a lot.

    • Which may actually make it a bigger WTF
  • (nodebb)

    As sometimes happens, TRWTF is the way the article is written here.

    Frist of all, the author should have broken the lines on commas, not at convenient dots. Doing that, and discarding all the repeated jibberjabber, we end up with this:

    Losses = calcLossesInPart(
    	RatedFrequency, RadialPositionToMainDuct, IsTransposed, 
    	ParallelRadialCount, ParallelAxialCount, Type,
    	DimensionRadialElectric,
    	DimensionAxialElectric+InsulThickness,
    	getElectricConductivityAtTemperatureT1(
    		ElectricConductivityT0,
    		MaterialFactor,
    		ReferenceTemperatureT0,
    		ReferenceTemperature),
    	LayerNumberRatedVoltage,
    	InitechNeoDTActivePartPartLayerContainer(0),
    	RFactor)
    

    And that's much easier to follow.

  • (nodebb) in reply to Steve_The_Cynic

    It is, nonetheless, as noted by @Dragnslcr, a function with an uncomfortably large number of parameters.

    Aaaannnd, I was snecod...

  • Burner (unregistered)

    "I do not know exactly what this is doing" Paid by the character, and time it takes to complete.

  • (nodebb)

    Trying desperately to find a silver lining in this abomination, I will admit that the names are more meaningful than I expected.

Leave a comment on “Formula Length”

Log In or post as a guest

Replying to comment #:

« Return to Article