Link Details

Link 93287 thumbnail
User 111696 avatar

By bloid
Published: Jul 08 2008 / 11:55

Several days ago I wrote about common excuses people use for commenting code and things you can do to get rid of them. I took the stance that rarely is there something so complex that it really requires comments.
  • 5
  • 2
  • 2087
  • 6
User 282283 avatar

Tantalus replied ago:

0 votes Vote down Vote up Reply

So, before it was open sourced and famous, if you came across this bit of code:

float InvSqrt (float x){

float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - (i>>1);
x = *(float*)&i;
x = x*(1.5f - xhalf*x*x);
return x;

you wouldn't want a little comment hint to help you out?

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Upvoters (5)

Downvoters (2)

Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java