Re:Ask HN: Good practices for my first C project
by __d on Wednesday October 18, 2023 @06:54PM
(#37935896)
"namespacing" in C means prefixes on public symbols.
Typically, they're two-part. First you have the project/company prefix, and then the ADT (abstract data type) prefix. So, eg. "foo_hash_" is a prefix from company/project "foo" and is a part of the "hash" ADT interface.
As a consequence, C people like abbreviations. Which is fine in moderation.
Private functions don't need the prefixes, of course.
Public variables are a little problematic if you ever port to Windows (DLLs), so try to avoid them.
Typically, they're two-part. First you have the project/company prefix, and then the ADT (abstract data type) prefix. So, eg. "foo_hash_" is a prefix from company/project "foo" and is a part of the "hash" ADT interface.
As a consequence, C people like abbreviations. Which is fine in moderation.
Private functions don't need the prefixes, of course.
Public variables are a little problematic if you ever port to Windows (DLLs), so try to avoid them.