dcforeman / fpscreatorengine

Automatically exported from code.google.com/p/fpscreatorengine
0 stars 0 forks source link

bad programming style #148

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Not really an issue but I think you can improve your programming style.

Ex  
1) code like
 distance = sqrt(abs(tdx#*tdx#)+abs(tdy#*tdy#)+abs(tdz#*trdz#))
should be
distance = sqrt(tdx#*tdx#+tdy#*tdy#+tdz#*trdz#)
remove 3 abs call function since abs(x*x) = x*x
A little difference but if you place that code in long for next loop
2) code like
if x < minX then x = minX
if x> maxX then x = maxX
should be
if x < minX then
  x = minX
else 
  if x > maxX then
    x = maxX
  end if
end if
cause x can't be both <minX and > maxX

Original issue reported on code.google.com by FrrrS...@gmail.com on 7 Nov 2013 at 2:31