It has an interesting code style, the comments go _after_ the function definition but before the opening bracket.
It looks weird, but it actually makes sense! The flow is more natural - first the function definition, and then the explanation of what it does. It also avoids repeating the function name.
I write comments about what a function does and it's interface before, but comments about the implementation after. Also my pre- and post-conditions go there of course. (I'm mostly writing in C.)
One of the more unusual aspects is the naming convention for types. Most type names use the a_ prefix (e.g. a_statement_ptr), but names beginning with a vowel start with an_ instead (e.g. an_object_lifetime_ptr).
Code from that era predates the web, and a lot of open source style guides, and even most open source code itself.
So it came up in an era where folks were inventing their own style and the huge homogenizing influence of the gnu standards (and other open source projects) hadn't taken hold.
I like it. It feels like another language, and has its advantages. I really like to know of alternate ways of doing things, even if I don't adopt them myself.
You got me thinking about C/C++ style guides of my youth...
I think Indian Hill (C, not C++) was the first one I ever read: <a href="https://www2.cs.arizona.edu/~mccann/cstyle.html" rel="nofollow">https://www2.cs.arizona.edu/~mccann/cstyle.html
Looks like there is an updated version (1997) here: <a href="https://www.cs.cornell.edu/people/egs/comp303/tutorials/cstyle.pdf" rel="nofollow">https://www.cs.cornell.edu/people/egs/comp303/tutorials/csty...
Paul Haeberli's "The SGI C Source Compliance Requirements" is hard to forget:
<a href="https://www.graficaobscura.com/ccode/index.html" rel="nofollow">https://www.graficaobscura.com/ccode/index.html
I wonder whether there is a centralised historical archive of C/C++ style guides?
cyberax · · focus · HN ↗
It looks weird, but it actually makes sense! The flow is more natural - first the function definition, and then the explanation of what it does. It also avoids repeating the function name.
mhh__ · · focus · HN ↗
zerr · · focus · HN ↗
bobmarleybiceps · · focus · HN ↗
void func(var1, var2) int var1, char* var2. { ... }
perhaps some legacy from that? Probably not, but just first thing that popped into my head since it feels similar :shrug:
1718627440 · · focus · HN ↗
spatulon · · focus · HN ↗
compiler-guy · · focus · HN ↗
So it came up in an era where folks were inventing their own style and the huge homogenizing influence of the gnu standards (and other open source projects) hadn't taken hold.
I like it. It feels like another language, and has its advantages. I really like to know of alternate ways of doing things, even if I don't adopt them myself.
RossBencina · · focus · HN ↗
I think Indian Hill (C, not C++) was the first one I ever read: <a href="https://www2.cs.arizona.edu/~mccann/cstyle.html" rel="nofollow">https://www2.cs.arizona.edu/~mccann/cstyle.html
Looks like there is an updated version (1997) here: <a href="https://www.cs.cornell.edu/people/egs/comp303/tutorials/cstyle.pdf" rel="nofollow">https://www.cs.cornell.edu/people/egs/comp303/tutorials/csty...
Paul Haeberli's "The SGI C Source Compliance Requirements" is hard to forget: <a href="https://www.graficaobscura.com/ccode/index.html" rel="nofollow">https://www.graficaobscura.com/ccode/index.html
I wonder whether there is a centralised historical archive of C/C++ style guides?
The modern staples are covered here, I guess:
<a href="https://github.com/kciter/awesome-style-guide#cpp" rel="nofollow">https://github.com/kciter/awesome-style-guide#cpp
asveikau · · focus · HN ↗
RossBencina · · focus · HN ↗
jabl · · focus · HN ↗
(Using FORTRAN here rather than the more correct Fortran to denote the traditional pre-modern (Fortran 90+) programming style.)