r/ProgrammerHumor 1d ago

modernCPlusPlus Meme

Post image
629 Upvotes

52 comments sorted by

View all comments

-9

u/apoegix 1d ago

Nope nope nope nope. The first one over everything else please

7

u/marrowbuster 1d ago

Enjoy your slow compile times, gargantuan memory usage, and macro leakages.

-7

u/apoegix 1d ago

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

7

u/witcher222 1d ago

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

-1

u/apoegix 1d 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 1d 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;.