4 ms·
What does 1.5 lines of code mean?
by Kiro 6y ago
What does 1.5 lines of code mean?
- ngold 6y ago>Note that parsing and conversion takes up just 0.5 lines of fired_main().
- setr 6y agoI think 1 line to modify the function sig, and .5 to call the library Its purely marketing math, I think.
- cb321 6y agoI was wondering the same thing. Perhaps he means all the extra "fire::" annotations one needs to put in place in function parameter lists as well as the ultimate dispatcher instatiating cpp macro? Really there is always at least 2.5 with the #include <fire.h>, later macro and annotations. https://github.com/c-blake/cligen https://github.com/c-blake/cligen achieves the actual 1-line of code dream without extra annotations and even leveraging existing API documentation and even colorizing said rST docs in terminal generated help output. { Of course, that one line might be an "import cligen; dispatch(foo)" which is arguably denser than most people would format it. } One usually wants to add some per-parameter help, though, unless your parameter names are always much more descriptive than "x" and "y".
- anigbrowl 6y ago'Give me your attention'.
- hibbelig 6y agoThe last line calls fired_main and is the full line. The definition of the function fired_main is similar to the definition of the function main, so it is not an extra line that is needed. But about half of the line deal with describing the command line arguments.