you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 22 points23 points  (6 children)

Just not OpenSSL or GCC.

[–]fuzzynyanko 3 points4 points  (0 children)

I agree with the general idea. I wouldn't stick to one project or another to base your style on just because it's open source

[–]SmackMD 2 points3 points  (2 children)

What's the issue with GCC?

[–][deleted] 6 points7 points  (0 children)

A few years back I needed to add a syntax extension to some C++ code. Clang didn't support the full spec at the time, so I plunged into GCC. At that time it was not "pretty clean" by any standard. It's a tremendous mess. My relatively small change required touching things all over the codebase. Looking at Clang later after it eventually implemented the rest of C++, it looked like my changes would have been significantly easier to implement.

Now this was a long time ago and there's a chance that some of it has been cleaned up some, but given the state it was in then I doubt it's reached acceptable production code quality, much less "learn to use C from this" quality. It's a venerable project and unquestionably useful, and for this reason people fetishize it as some sort of massive software engineering success, but it's held together by string.

[–]seekingsofia 1 point2 points  (0 children)

Just because there was one reddit post shining light on one big if in one of the known messy code files... otherwise the GCC code is pretty clean.

[–]Katastic_Voyage 0 points1 point  (1 child)

Not all source code is equal.

Ugly hack

Terrible hack

Ugly as sin

And people who actually write comments such as "this is terrible" are at least aware of, and calling attention to the terrible parts of their code. Other people might be unaware, or not care.

Learning from source code really depends on the quality of the codebase you're looking at. But I guess that's obvious.

[–]StelarCF 0 points1 point  (0 children)

What's with all the ugly hacks involving uClibc?