• RLB (unregistered)

    But... we already check that we have inputs in the Frist case, so the check for inputs in the second case is completely superfluous. this.serverConfig will never be set.

  • (nodebb) in reply to RLB

    That's the point. When they added the mixedConfig stuff, they didn't remove the obsolete serverConfig code, so it's vestigial.

  • Sniffnoy (unregistered)

    Also, the inputs and outputs variables are just thrown away, looks like? So seems like none of that processing actually matters, unless it has other hidden side-effects.

  • (nodebb)

    YEah but what if the status of "inputs" changes by the time you get to the "else". What then, huh?

  • (nodebb)

    var configuration = new ConfigurationBuilder().AddJsonFile("blahblah.json"); // done

  • NW (unregistered)

    Judging from the method signature this must be a constructor. Gutsy move to start opening streams and whatnot in a constructor....

  • (nodebb)

    @Sniffnoy ref:

    Also, the inputs and outputs variables are just thrown away, looks like? So seems like none of that processing actually matters, unless it has other hidden side-effects.

    It's always hard to know in these examples what's been snipped out. But overall I suspect that those too are vestiges, probably from before the whole thing was converted from some homebrew config system to a JSON-based JObject.

  • (nodebb) in reply to WTFGuy

    Technically JObject is not even part of the framework; it's part of the Newtonsoft library. In modern .net you only use the System.Text.Json JsonSerializer and that's it. The reason for that is pretty simple and it comes down to two words: Code Generators ;-)

Leave a comment on “Vestigial Organs”

Log In or post as a guest

Replying to comment #:

« Return to Article