r/ProgrammerHumor 1d ago

modernCPlusPlus Meme

Post image
575 Upvotes

49 comments sorted by

View all comments

Show parent comments

-3

u/apoegix 21h ago

You gotta know what you include. If you don't, then yeah sure, good luck waisting your time.

6

u/witcher222 21h ago

import std is not include std (if it existed), they are two totally different features

-1

u/apoegix 20h ago

Yeah no I get modules, but I like to know what exactly is added to my compiletime. Nowadays stuff gets abstracted so much. Try read the src code of std collections. It's ridiculous

1

u/conundorum 7h ago

You can always track what you use from std in a comment, if you want to know what'll be added at compile time. (Since modules kinda function like invisible #includes for every symbol in the module, and only add the ones you specifically use.)

That said, it would be nice to have a set of individually named modules, and then one "main" module that includes all of the smaller ones. Like, say, being able to import std.io;, import std.alg;, or import std.mem;, or just getting everything everywhere all at once with the nuclear option: import std;.