让人抓狂的代码

来源:外刊IT评论网 作者:外刊IT评论
  

 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);
}

时间:2012-09-04 09:36 来源:外刊IT评论网 作者:外刊IT评论 原文链接

好文,顶一下
(1)
100%
文章真差,踩一下
(0)
0%
------分隔线----------------------------


把开源带在你的身边-精美linux小纪念品
无觅相关文章插件,快速提升流量