We analyze TranslucentTB with CppDepend: a clean Code City architecture, a B technical-debt rating, decoupled modular design and minimal debt earn it the CppDepend Gold Standard Code Quality Label.
1 comment
- I copied #import from ObjC as well as providing #include. #import is the ‘only ever include this once’, akin to ‘#pragma once’, but at the caller site
- I got rid of header files. If you want to define enums or types they go in the same file as the code. It’s surprising how useful this is, and it stops any drift between method signatures in the header/code, because there’s no code…
The latter raised the question: what about library code ? So the compiler does double-duty with ‘#use <xxx>’. If xxx is a .xc file, it is the same as ‘#import <xxx>; use xxx’, where ‘use xxx’ brings any static class methods into the global namespace. If, however, xxx is a library name (without the lib prefix or .so/.a suffix), then the compiler reads the DWARF info in the library, and brings the methods/functions/types etc into the current-compilation-unit’s namespace. #use honours the -I and -L flags for search
So to use functions in ‘libtls.so’, an external C library, it’s just ‘#use <tls>’ and link with the library. Interop in other languages always annoyed me so making it simple was a goal.
Read the full thread on Hacker News →
Related stories
- DEV Community · 6 points · 11 days ago
- DEV Community · 15 points · 3 days ago
- DEV Community · 6 points · 1 day ago
- DEV Community · 21 points · 9 days ago
- Hacker News · 2 points · 9 days ago
- #include – Don’t get fancyarne-mertz.deLobsters · 5 points · over 8 years ago