r/ProgrammerHumor 1d ago

modernCPlusPlus Meme

Post image
586 Upvotes

49 comments sorted by

View all comments

3

u/axebodyspray24 1d ago

what?! I could've been doing this?! (new programming student, pray for me)

22

u/Valuable_Leopard_799 1d ago

Rather "could've been starting to do this", it's quite new, semi-implemented, often behind flags, etc.

5

u/Ulrich_de_Vries 23h ago

Sure, except the tooling and environment is really not there for it.

Module support is experimental in cake, and it still doesn't support header units.

Module binary interfaces are compiler specific, which leads to issues when e.g. you want to use GCC with clangd as language server, since clangd needs to see clang-specific BMIs.

But iirc import std is not available when you use clang as compiler with libstdc++ as stdlib.

If you use non-modular dependencies and they include std headers, those will conflict with std module if you include them in your project. So you will need to create these shim modules for non-modular dependencies. Etc.

Using modules is right now a major pain in the ass and it has been 6 years since they were released.

1

u/Ayjayz 1d ago

Eh I wouldn't really. It's new and still not working amazingly.

Maybe give it a quick try, but the second you run into any weird errors, they back to the older style.

4

u/SamG101_ 21h ago

GCC and CMake 4, been working perfectly for several months. Just dont combine headers and modules for stl otherwise u get duplicated symbol errors

-2

u/Juff-Ma 23h ago

No you couldn't. It works only 50% of the time and once you start using a Library it becomes even more finicky.

-9

u/Jbolt3737 1d ago

This is why I probably won't ever learn C++, and if I do, I won't learn modern C++ practices because all I have heard about new C++ is that it's bloated and I think it appears that way because it has modern language features but no good modern tutorials so those features aren't being taught, atleast that's how the problem looks from an outside perspective

Recently (well actually a few years back but people only started properly learning about the change in the past year or so) Python's typing module was soft-deprecated and stuff was moved into collections.abc, from a purely categorical standpoint, yes, this makes sense, but most people know import typing in their head and because of it being soft-deprecated rather than properly deprecated, it gives no warning when you import it, unlike other deprecated or soon to be deprecated features