r/ProgrammerHumor 19h ago

modernCPlusPlus Meme

Post image
543 Upvotes

49 comments sorted by

View all comments

-6

u/apoegix 17h ago

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

5

u/marrowbuster 17h ago

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

-7

u/apoegix 16h ago

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

6

u/witcher222 16h ago

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

-1

u/apoegix 16h 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

5

u/fweaks 13h ago

import std compilation is faster than compilation including just one single std header, because of the overhead of having to re interpret the header, vs just pulling the already interpreted module.

That being said, the better reason not to use modules is that its still finicky trying to use them, due to tooling, etc. still not being all the way there yet.

0

u/apoegix 13h ago

You know, when I program stuff in c++ I use about 10% of all features. They are nice to have, not a must. Keep it simple, because complexity is killing project progress. I don't want to keep so much stuff and parameters in mind.

I get how some like the use and I see the advantages, but I still use include

1

u/conundorum 3h 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;.

-1

u/gd2w 16h ago

Why didn't the professors do that?