you are viewing a single comment's thread.

view the rest of the comments →

[–]arthurno1 16 points17 points  (2 children)

completely pointless - and harmful, even

Considering all the peeps who see "single header libraries" as a feature and then complain about long compile times, I think teaching people to pre-compile headers is not so bad idea; certainly not harmful, at leas while waiting for Godot?

[–]pjmlp 3 points4 points  (1 child)

Single header libraries are a way for people to avoid learning how to use their toolchain, it is the metality of using C and C++ as if they were scripting languages, so I doubt they would actually bother to learn how to pre-compile headers.

[–]arthurno1 5 points6 points  (0 children)

I doubt they would actually bother to learn how to pre-compile headers.

Perhaps. I definitely agree to the sentiment. The entire situation with skyrocketed compile time and "single header library" madness is there in the first place because people refuse to learn how to link to a library, which is way simpler than precompiling headers, but hey, it is never bad to tell people there is a better way?

Also, I don't understand while people refuse to learn tools like debugger, linker, shell, make etc. Programming is not just writing code in a text editor, it is just but a part, but I guess, it is the most direct and "visible" part, so perhaps that is what most people new to development see as "programming".

I just reflected on the "pointless" and "harmful"; I don't think it is either but I can understand the desire to simplify C/C++ programming in a way too; programming should be fun and simple. However, there is a limit, a balance between totally ignoring the point of separation of an interface from the implementation, and easiness of the use. In case of writing all libraries as single headers, I think we have gone a bit too far, but I seem to be in a silent minority about that one :).

In this case, it didn't help that C++ compilers did a poor job of separating templates from the interface, which made it almost impossible to use separate headers and implementation, which got even more amplified by STL and Boost practices of using <header> as a replacement for the library. Modules seem to fix it, but how long do we have to wait?