top | item 46559205

(no title)

jasongill | 1 month ago

Ignoring concerns about the security of UPnP, and the fact that this is somewhat of a "solved" problem considering there are things like libupnp and miniupnpc, I am wondering if this is really the cleanest way to solve the problem in C++ with Qt?

I'm most curious about the fact that this program has ~30,000 lines of included headers to simply generate a static string (the XML output).

Obviously if you were generating large XML payloads repeatedly, then including a dependency would be a good idea, but this implementation is using "inja.hpp" which in turn requires "json.hpp" to output what is effectively a concatenated string.

Why not just use Qt's built in QStringLiteral and feed it the (short) bit of XML to it along with your 4 variables, similar to a sprintf?

discuss

order

WesolyKubeczek|1 month ago

Likely a side effect of Qt trying to be an “everything” library, batteries and battery factory included.

jasongill|1 month ago

I guess that's my point - the author is already using Qt which has so much included, but are still including two large header files in the project just to output a ~12 line XML snippet

jacquesm|1 month ago

Qt is terrible. Since a couple of years they want a login just to download the code required for a build and I really have zero desire to get a bunch of marketeers that are wondering if I'm ripe for the plucking yet just because I've decided to fix some bugs in open source code.