Remix.run Logo
▲ cyberax 3 hours ago

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.

▲compiler-guy 8 minutes ago | parent | next [-]

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.

▲spatulon an hour ago | parent | prev | next [-]

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).

▲1718627440 2 hours ago | parent | prev | next [-]

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.)

▲mhh__ 3 hours ago | parent | prev | next [-]

This is also where conditions go in languages with contracts, I like it

▲zerr 3 hours ago | parent | prev | next [-]

This is common in Lisps.

▲bobmarleybiceps 2 hours ago | parent | prev [-]

never occurred to me to write a comment there, but it actually looks kind of clean imho. Really old C code looked like

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: