The stone-age called, they want their languages that need header files back!
(I use Rust btw.)
deleted by creator
Did they add modules to the standard yet?
deleted by creator
I know that header files have some pretty horrible issues with templates and cyclic dependencies and so on, but from an organisational perspective I really like them. If I have to implement some complicated algorithm I could easily have a thousand likes + of Code, but the header still quite nicely shows the general structure in one or two screens. Whenever I do classes in python I start wishing for headers at like 300 lines, simply because I loose track of all the functions I already made.
Maybe I’m just not a good python programmer tho.
I’d say at 1000 lines it usually makes sense to extract some parts into other files. But sure, I guess most obscurities have positive aspects. On the other hand, nothing is stopping you from writing a separate file with only function signatures next to your python scripts. It’s just not required, because why would it ;)
Why does your header file contain code?
It’s not the case with this meme, but in C++ template definitions have to be defined in the headers if they’re not full template specializations
Looks like we’ve got a Java programmer here taking C++ for a spin.
Why are you putting the implementation in the .h file? You’re supposed to declare in the header and implement in the .cpp files. The meme is reversed
If C++/C were real languages for real programming they’d enforce this in the compiler.
No sane language designer would say “it is imperative that you do not implement your class in its header file” then write a compiler designer to say “oh you implemented your code in the header file? lol lmao that rocks”
They have played you all for fools.
not saying it’s good design, I ditched C++ long ago. at least the C++20 modules API is gonna fix this, right guys?
I actually like how much freedom C++ gives you. As long as it is fed valid code, it does not give a fuck about how you choose to structure your project
That freedom becomes misery on the instant you have to start maintain the code from some other free spirit, whose style is totally different from yours.
Or the free spirit was actually you yourself but from three months ago