News for hackers. Stuff that matters.
Re:How to C in 2016 by unscaled on Friday January 08, 2016 @09:19PM (#10869770)
As a C++ programmer who delved deeply into nginx, I think that your chosen example of "high quality C code" is telling of the state of C programs. It could be one of the best specimens of C code in terms of organization, but absolutely speaking it's one of the best large code-bases I had to deal with:

1. Almost devoid of any documentation. 2. No ADTs - all struct fields are directly accessed, even though there are sometimes very complicated invariants that must be preserved (and these invariants are not documented anywhere, of course). 3. Ultra-short variable names that really describe nothing but their types (it's like Hungarian notation with only the notation part). 4. These mystery variables are all defined in the top of the function of course, making them hard to trace. Does anyone even compile Nginx with C89? 5. Configuration parsing creates a lengthy boilerplate that's really hard to track. 6. Asynchronous code is very hard to track, with a myriad of phase-specific meaning for return codes, callbacks and other stuff that makes reading Boost.ASIO code look like a walk in the park.

I think it really shows the sad state of C programming. Die-hard C programmers always complain C++ is hard to read because of its template and OOP abstractions, and it sometimes really is a mess to read, but C is even harder since large programs always re-implement their own half-assed version of OOP and template-macros inside.

Re:How to C in 2016 by danmaz74 on Saturday January 09, 2016 @06:45AM (#10870924)
> but absolutely speaking it's one of the best large code-bases I had to deal with

You meant "one of the worst"?

Re:How to C in 2016 by paulddraper on Saturday January 09, 2016 @11:01PM (#10874082)
Either that, or best example of the worst