3 ms·
Mostly that was an interesting article, but there was one pain point: having to read the parameter list to a routine three (!) times. Honestly, why has no lan
by Roboprog 12y ago
Mostly that was an interesting article, but there was one pain point: having to read the parameter list to a routine three (!) times.
Honestly, why has no language (few languages?) come up with a scheme yet to put the formal parameters to a routine one per line, with documentation, like so:
...
param-name [<type, if specified>] [<documentation>]
...
Swap the name and type order for "New Jersey" style languages vs "Swiss" style languages as needed.
This is actually how I used to write out my C function headers (Frack K&R layout!), even though we didn't use a doc generator tool such as Doxygen (sp?).
Javadoc is only slightly less offensive, naming the parameters twice, due to slavish adherence to the altar of New Jersey formatting. I would love to see "//@ description..." after each parameter as an alternate to "* @param name description..." duplication above the parameters. "WET brain-death forever!", I guess.
- kjs3 12y agoCan you show an example of your C header style? I confess I'm not quite sure I follow you there.
- Roboprog 12y ago/* Return validated output for printing */ static t_output * val_and_xform ( int in_cnt /* input item counter, 1 based */ t_input * raw_in /* raw input, immutable, not null */ ) { ... } Further examples: https://github.com/roboprog/buzzard/blob/master/bzrt/src/bzrt_alloc.h https://github.com/roboprog/buzzard/blob/master/bzrt/src/bzr...
- kjs3 12y agoAh, got it. That has a lot going for it, documentation wise. Thanks for the illumination. I can see the style-nazis hating on it with a white-hot fury, tho.