Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualRivieraKid

Posted 09 April 2013 - 06:38 AM

"int[] blk=new int[64];" vs "int blk[64];";
"for(i=0;  i<n; i++)ct[b+i]=Foo(cs[b+i]);" vs "while(cs<cse)*ct++=Foo(*cs++);";

"ct[i]=(byte)((((int)cs[i])*xsc+2048)>>12);" vs "*ct++=((*cs++)*xsc+2048)>>12;"

 

var blk = new int[64];

var ct = cs.Skip(b).Take(n).Select(Foo);

var ct = cs.Select(v => (byte)((v*xsc + 2048) >> 12));

 

easier to read, deferred, wont crash because of array arithmetic.

I don't have to define cse or ct earlier in the code

scalable, I can parallelize easily.

all are 1 line as expected, not crushed together

aggregates errors

 

these are the things I like about programming.


#2RivieraKid

Posted 09 April 2013 - 06:37 AM

"int[] blk=new int[64];" vs "int blk[64];";
"for(i=0;  i<n; i++)ct[b+i]=Foo(cs[b+i]);" vs "while(cs<cse)*ct++=Foo(*cs++);";

"ct[i]=(byte)((((int)cs[i])*xsc+2048)>>12);" vs "*ct++=((*cs++)*xsc+2048)>>12;"

;>

 

var blk = new int[64];

var ct = cs.Skip(b).Take(n).Select(Foo);

var ct = cs.Select(v => (byte)((v*xsc + 2048) >> 12));

 

easier to read, deferred, wont crash because of array arithmetic.

I don't have to define cse or ct earlier in the code

scalable, I can parallelize easily.

all are 1 line as expected, not crushed together

aggregates errors

 

these are the things I like about programming.


#1RivieraKid

Posted 09 April 2013 - 06:37 AM

"int[] blk=new int[64];" vs "int blk[64];";
"for(i=0;  i<n; i++)ct[b+i]=Foo(cs[b+i]);" vs "while(cs<cse)*ct++=Foo(*cs++);";

"ct[i]=(byte)((((int)cs[i])*xsc+2048)>>12);" vs "*ct++=((*cs++)*xsc+2048)>>12;"

;>

 

var blk = new int[64];

var ct = cs.Skip(b).Take(n).Select(Foo);

var ct = cs.Select(v => (byte)((v*xsc + 2048) >> 12));

 

easier to read, deferred, wont crash because of array arithmetic.

I don't have to define cse or ct earlier in the code

scalable, I can parallelize easily.

all are 1 line as expected, not crushed together

aggregates errors

 

these are the things I like about programming.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


PARTNERS