Quantcast
Channel: 安全开发
Viewing all articles
Browse latest Browse all 6

让人抓狂的代码

$
0
0
NetKnight ' s blog ( http://www.nb7.net/ ) : 1.确保这个值等于ture
if (someBoolean == true) { 
doSomething(); 
}

2.只有等于ture时我才return ture


if (result == true)
  return true; 
else
  return result;

3.我就是不信任if


if (result <= 10) 
{ 
 handling(); 
} 
else if (result > 10) 
{ 
 otherHandling(); 
} 
else 
{ 
 handling(); // to be sure 
}


4.要写出一看就懂的代码


function DocumentDotWrite(s)
{ 
 document.write(s); 
} 

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images