Hacker News new | ask | show | jobs
by strkek 2940 days ago
> btw, did you notice how there are hardly any books, conferences or discussions about C despite being a fairly popular language?

Oh, yes. When I wanted to fiddle with OpenGL (and later SDL), I was baffled to find that absolutely everything documentation-wise was for C++.

EDIT: Sorry, "documentation" was probably the wrong word to use here. I meant "learning resources".

4 comments

I ran into the same problem with the using the libraries for the C based ffmpeg (libavcodec, etc). Even worst is trying to search for information only to wind up with hundreds of entries on how to use ffmpeg with the CLI with maybe 1-2 entries related to binding to the libraries grammatically.

Even ffmpeg's own documentation outside of what they generate for their API is rather sparse if you wish to do more than use it on the command line.

Probably due to the game industry being quite C++ focused, and also Microsoft compilers’ lack of support for C99
Historically the C99 support by MS was quite bad. Fortunately VS 2017 has good (not 100%) C99 support.
Worse than bad: if I recall correctly, there was no C99 support at all until MS VS 2013. Before that you had to compile C as C++ in order to get C99-like features.
To the extent required by ISO C++14, with ISO C++17 requiring C11 library compliance.

If is after all called Visual C++.

> When I wanted to fiddle with OpenGL (and later SDL), I was baffled to find that absolutely everything documentation-wise was for C++.

Do you mean tutorials and the like? The official docs are pure C for both.

C.f. the official SDL API doc: https://wiki.libsdl.org/APIByCategory

Hum. That doesn't make sense, the OpenGL API is entirely C oriented and I don't know of any C++ docs.
It doesn’t make sense, but it jibes with my experience. Tutorials and blog posts about OpenGL are super heavy on C++, because gaming.

The official docs are C, of course, because the API is C. But the docs are rather abstruse for a beginner, and really become useful only well after you’ve gotten your bearings. (e.g. my personal beef: function names tend to be two nouns with no verb to say what the thing actually does, so you look in the docs and it says it “binds” noun A and noun B, with no explanation of what “binds” means in context, which direction the data binding goes, whether it persists, etc.)

The OP probably meant most OpenGL blogs, books and tutorials. The actual OpenGL API reference is pure C.