Re:Trying out C++20's modules with Clang and Make
by 38 on Sunday October 15, 2023 @01:14PM
(#37891539)
> It's the same for pretty much any language.
no, its not. just off the top, I can say that D, Go, Nim, Rust and Zig dont do this.
also this isn't really an argument. instead of actually disagreeing with the original premise "headers are terrible" (which you cant), you've started a new argument, which is "other languages use headers", which no one was contesting.
> There’s no rule that they have to only contain declarations
Same thing in Python, you can write statements at the top level of a module, and it will be executed whenever someone first import that module...
> or that they have to appear at the top of source files
Same thing in Python, you can `import` anywhere, and the context/order matters and overwrites existing scope declarations.
> or that they have to be .h files
Same thing in Python, the extension doesn't matter if you use import lib, only if you use the `import` keyword does the name/path matters.