本文展示的代碼片段來自知乎的同名問答貼,本文列舉了一些反面例子,切勿模仿,就當(dāng)輕松一刻了吧~
題主的補充
String result;
......
return result.toString();
這種算嗎?大家盡情吐槽吧!
Cyandev 的分享
if (m_doc->isModified() ==
true)
{
for (
int i =
0; i <
100; i )
{
save();
//Save the document for 100 times to ensure it has been saved successfully.
}
}
不知誰寫的,總之我都看哭了~
侯杰 的分享
enum FiveLine
{
Gold,
Wood,
Water,
Fire,
Earth,
};
看
枚舉名字不知道五行(hang)是什么鬼,看了枚舉內(nèi)容恍然大悟,原來是五行(xing)……
李旭東 的吐槽
class=
"div1">
class=
"div2">
class=
"div3">
class=
"div4">
………
class=
"div27">
class=
"div28">
…………
class=
"div396">
class=
"div397">
…………
class=
"giveMeAFuckingClassName">
白砂糖 的分享
// 以下所有l(wèi)eft代表右
// 以下所有right代表左
Kun Andy 的分享
public enum ColorType
{
Green,
// 綠色
Hong,
// 紅色
}
//......
this.curColortype= ColorType.Hong;
......
毫無違和感,英語和漢語的激烈碰撞,一時愣是沒讀懂代碼,“Hong”為何物,你看注釋才恍然大悟,真是犀利!
可能是綠的拼音(lv) 有點像等級,所以為了防止歧義,用了Green!贊一個!
程序員很可愛,我愛程序猿大家庭!
這些蘊含智慧的
代碼是禮物也是驚喜!
可以幫你拉這么多zan!感謝!
真愛身邊的程序員!
孫傳武 的分享
有次看一項目源碼,注釋里有個warning。
// warning:
Do not make
any changes here.
// I got confused why it can run successfully.
// PLEASE
Do not make
any changes
before you figure it out.
紳士提督不笑船 的分享
變量名:
class UplaodDuiLie
// 上傳隊列
// Uplaod 非手誤,完全原文。
// 為什么你們只吐槽 typo 而不吐槽中英文混合呢。。
myd7349 的分享
從長度上來說,完爆樓上各位的。一起來感受下:
if(m_Str2.Find(
"'")>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
':')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'/')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'!')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'@')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'#')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'$')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'%')>=
0)
{
AfxMessageBox(
"您輸入的包含非法字符");
m_Str2=
"";
UpdateData(
FALSE);
return;
}
if(m_Str2.Find(
'
掃描二維碼,關(guān)注更多精彩內(nèi)容
本站聲明: 本文章由作者或相關(guān)機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除。