[閒聊] 你會如何寫一個getRandomName

看板Soft_Job作者 (hh81tw)時間14年前 (2010/02/15 02:38), 編輯推噓8(805)
留言13則, 9人參與, 最新討論串1/1
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

02/15 03:08, , 1F
XD 滿溫馨的
02/15 03:08, 1F

02/15 09:14, , 2F
然後TRWTF(TM)是即使$gender設成男性, 仍然會回傳Mary..
02/15 09:14, 2F

02/15 09:15, , 3F
或者要hardcode的話, 選一個男女皆可用的名字會比較好..
02/15 09:15, 3F

02/16 21:43, , 4F
瑪莉有夠衰
02/16 21:43, 4F

02/16 22:11, , 5F
在裡面加一行 //FIXME 然後置之不理~
02/16 22:11, 5F

02/16 22:24, , 6F
樓上XDDDD
02/16 22:24, 6F

02/16 23:19, , 7F
我遇過原廠的code過來內容有 //fix me,火都噴出來
02/16 23:19, 7F

02/17 15:15, , 8F
不懂,為什麼寫fix me?
02/17 15:15, 8F

02/17 15:35, , 9F
有bug吧
02/17 15:35, 9F

02/17 15:51, , 10F
就是只是說改掉他,然後什麼原因都沒說的意思嗎?
02/17 15:51, 10F

02/17 15:56, , 11F
就是他那時沒時間改.希望後面review時要記得改
02/17 15:56, 11F

02/17 15:56, , 12F
久而久之沒人 review 就... 放在那邊 release 出去了
02/17 15:56, 12F

02/17 16:04, , 13F
原來如此
02/17 16:04, 13F
文章代碼(AID): #1BU4CKCX (Soft_Job)