سؤال

My background is with high level web programming (JavaScript, Django, Compojure, etc.), but now I'm learning C. I've been going through the beej.us networking tutorial, which is a good resource, but I started wondering where to find good documentation in general for discovering and using C libraries.

I know that I can look at the header files on my own system (not really sure where to find the implementations, so I guess that could be part of my question, but it's not really).

In other languages or ecosystems that I've worked with there's always been some major source of info that helps you at least as a starting point, and then you can branch out from there:

And then when you come across a library of some kind that you'd like to try out you can usually find the source code and an up-to-date (or at least time-stamped), easy to follow readme at github or some such place. It's very helpful.

But what I'm finding working through Beej's tutorial, is that, outside of Beej's tutorial, I'm not sure how I would go about finding what's in each of the libraries being #includeded, other than looking for the headers in the /usr/include directory and following the trail from there. I suppose there's nothing wrong with that, but I'm sort of used to a little less friction and a little more...I don't know...community, maybe? So is there a resource hub of the C community?

هل كانت مفيدة؟

المحلول

There's no "resource hub".

If you are talking about headers defined by various standards (C standard, POSIX standard, etc.) then standards bodies provide standard documents that serve as a reference; and there are plenty of third-party avenues that provide documentation (e.g. Linux man pages).

If you mean any particular project's API (let's say MySQL to pick a random example). Typically , the project should provide added documentation that describes how to do it , along with a description of all functions in reference format.

Sometimes, the project's developer might not have written documentation, but they may have put good comments within the header files that describe the expected inputs and outputs of every functions, and possibly even a guide on how to get started.

Programmers are often poor at writing documentation.. it's a skill to learn like any other. An example of terrible documentation would be OpenSSL. (I don't mean to offend any developers who put in a lot of hard work on the product , I just refer to the available documentation and readability of header files).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top