作者hh81tw (hh81tw)
看板Soft_Job
標題[閒聊] 你會如何寫一個getRandomName
時間Mon Feb 15 02:38:09 2010
public static function getRandomName($gender)
{
return 'Mary';
}
Mike writes, "Oh, the things that I find in our codebase."
"I have no idea who put this in, or why it was put in. But it's there, and
it's somehow called in a few places. As tempted as I was to investigate how
it was used, I figured I'd spare my sanity."
Mike adds, "should there come a day that I need an actually random name,
perhaps I'll look for getReallyRandomName."
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.16.113
1F:推 Ting1024:XD 滿溫馨的 02/15 03:08
2F:推 leicheong:然後TRWTF(TM)是即使$gender設成男性, 仍然會回傳Mary.. 02/15 09:14
3F:→ leicheong:或者要hardcode的話, 選一個男女皆可用的名字會比較好.. 02/15 09:15
4F:推 luciferii:瑪莉有夠衰 02/16 21:43
5F:推 salagadoola:在裡面加一行 //FIXME 然後置之不理~ 02/16 22:11
6F:推 rshadow:樓上XDDDD 02/16 22:24
7F:推 antory:我遇過原廠的code過來內容有 //fix me,火都噴出來 02/16 23:19
8F:推 Sany:不懂,為什麼寫fix me? 02/17 15:15
9F:→ dingyuchi:有bug吧 02/17 15:35
10F:→ Sany:就是只是說改掉他,然後什麼原因都沒說的意思嗎? 02/17 15:51
11F:→ chengcti:就是他那時沒時間改.希望後面review時要記得改 02/17 15:56
12F:→ chengcti:久而久之沒人 review 就... 放在那邊 release 出去了 02/17 15:56
13F:推 Sany:原來如此 02/17 16:04