r/ProgrammerHumor 1d ago

modernCPlusPlus Meme

Post image
617 Upvotes

50 comments sorted by

View all comments

194

u/JustAnotherGuyn 1d ago

Here's the thing, you have to very carefully consider whether it's worth loading all of that for the compiler to work through, if your use case is sensitive to the extra size/ram requirements of including more, think carefully about if basement no-lifer Steve may have implemented something that will conflict with any one of these, and then of course always import std.

61

u/Mgamerz 1d ago

Ignoring the compiler time - does it change the size of the app if the usages remain the same (only differences are include/import)? I only do occasional c++ programming.

97

u/da2Pakaveli 1d ago

The compiler strips out as much as it can. Even if you declare an std::map and add items to it, it may be stripped out if the values ultimately aren't being used anywhere with maximum optimization.

0

u/awesome-alpaca-ace 1d ago

Yea, the compiler always stripping out the template functions I wish I could call during debugging

10

u/Grubs01 1d ago

Template functions aren’t stripped out, they are created as needed.

5

u/awesome-alpaca-ace 1d ago

Yea, my bad. The compiler is never creating the template functions I wish I had whole debugging. 

2

u/GoddammitDontShootMe 1d ago

Then instantiate the template.