Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A bit OT: I very much appreciate well written C code for its simplicity and "rawness", but how come that many C codebases seem to place no importance on code comments?

This repo contains a few thousand lines of code without so much as a single comment. In my experience that tends to happen much less in other languages. And it's not like this C code is obvious.



C has an interesting culture of terse variable and function names, and limited comments. It comes from an entirely different mindset and time period in software. It predates most "modern" concepts of software re-usability that eventually turned into enterprise OOP practices and was crystalized in Java and C#.

It's not great anymore. The software world has moved on to understanding how important these things are (and even often takes things too far), but C seems a bit stuck in its ways.


The value of comments and references depends on the software context. If inexperienced people are expected to be editing or reading the code they're more valuable. However, they are expensive to keep in sync with changes to the implementation and the value has to balanced against this cost.

Java and C# did not replace C. They're typically used for different tasks.

Objectively speaking, do we have evidence these enterprise OOP practices lead to better software?


Comments increase compile time!


Not to mention file sizes!


Typing time as well!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: