4 ms·
Related: Rob Pike on programming style, especially his note in include files: http://doc.cat-v.org/bell_labs/pikestyle http://doc.cat-v.org/bell_labs/pikestyle
by dapperdrake 2y ago
Related:
Rob Pike on programming style, especially his note in include files:
http://doc.cat-v.org/bell_labs/pikestyle http://doc.cat-v.org/bell_labs/pikestyle
See also: SQLites amalgamation. Others (iirc Philippe Gaultier) have called this a Unity build:
https://sqlite.org/amalgamation.html https://sqlite.org/amalgamation.html
Rob Pike on systems software research:
http://doc.cat-v.org/bell_labs/utah2000/utah2000.html http://doc.cat-v.org/bell_labs/utah2000/utah2000.html
EDIT: typo
- z_open 2y agoHis opinions on include files have fallen out of favor because compiling is faster and it adds needless work. Are there organizations that still do this? All the style guides I've seen do not.
- dapperdrake 2y agoIf your filesystem and disks are fast enough, then maybe Rob's assumptions don't apply.
- ryandrake 2y agoI still adhere to this for personal hobby projects, more out of a sense of craftsmanship than anything practical at this point.
- csb6 2y agoI believe clang and gcc avoid reading in and re-processing include files that are already included, so his advice is unnecessary and creates a lot of maintenance burden, especially for C++ where a lot more code is in header files. It may still be useful for old compilers, though.
- kevin_thibedeau 2y agoThey recognize include guards and skip any further inclusions for those cases. There are scenarios where you may want multiple inclusion and you can still have that.