Re: [dev] semicolons

2011-11-18 Thread Kurt H Maier
precisely what is the payoff for nerding out about this? -- # Kurt H Maier

Re: [dev] semicolons

2011-11-18 Thread Patrick Haller
On 2011-11-18 13:24, pancake wrote: > should we support code written by bitches? K&R v1, page 59: for (i = 0, j = strlen(s)-1; i < j; i++, j--) { SLoC count? Bitch count? ;)

Re: [dev] semicolons

2011-11-18 Thread pancake
On 11/18/11 14:03, Patrick Haller wrote: On 2011-11-18 11:40, pancake wrote: $ cat dwm.c | sed -e 's,;,ROFL\n,g' |grep ROFL |wc -l use cpp to deal with the includes, defines, comments. __sloc() { grep -v '^#include.*<' "$1" | cpp - | grep -v '^#' | grep -v '^$' } sloc() { __sl

Re: [dev] semicolons

2011-11-18 Thread Patrick Haller
On 2011-11-18 11:40, pancake wrote: > > $ cat dwm.c | sed -e 's,;,ROFL\n,g' |grep ROFL |wc -l use cpp to deal with the includes, defines, comments. __sloc() { grep -v '^#include.*<' "$1" | cpp - | grep -v '^#' | grep -v '^$' } sloc() { __sloc "$1" | wc -l __sloc "$1" | se

Re: [dev] semicolons

2011-11-18 Thread Rob
On 18 November 2011 12:24, pancake wrote: > should we support code written by bitches? main(argc, argv) int argc; char **argv; { } // SLOC of two, should be zero #define SEMI ; int main(int argc, char **argv) { int i SEMI for(i = 0 SEMI i < argc SEMI i++) printf("argv[%d] = %s\n", i

Re: [dev] semicolons

2011-11-18 Thread pancake
On 11/18/11 13:10, Rob wrote: On 18 November 2011 11:41, Roger wrote: Anything can be worked around one way or another. For reference, standard benchmark tools also never look at just "one thing". Exactly, short of writing a C-parser and doing some heuristic on the syntax tree, you'll just en

Re: [dev] semicolons

2011-11-18 Thread Rob
On 18 November 2011 11:41, Roger wrote: > Anything can be worked around one way or another.  For reference, standard > benchmark tools also never look at just "one thing". Exactly, short of writing a C-parser and doing some heuristic on the syntax tree, you'll just end up missing things anyway.

Re: [dev] semicolons

2011-11-18 Thread Roger
> On Fri, Nov 18, 2011 at 11:40:10AM +0100, pancake wrote: >I've checked iolanguage.org and noticed that they are calculating the >complexity/size >of their vm in semicolons instead of number of lines. > >I think this is a much simpler way to calculate the complexity of a >program and can be >imp

[dev] semicolons

2011-11-18 Thread pancake
I've checked iolanguage.org and noticed that they are calculating the complexity/size of their vm in semicolons instead of number of lines. I think this is a much simpler way to calculate the complexity of a program and can be implemented easily with awk. using sloccount is probably cool, but