Re: [請益] 程式該怎麼越寫越好呢
※ 引述《adrianshum (Alien)》之銘言:
: 其實, 往往要寫一千字去解釋, 我覺得那不算真的高手.
: 我一向的目標都是要把程式寫得 self-descriptive, 要
: 別人不看 comment 也看得懂.
: comment 就留在偶然為了效率寫得難明, 或有特別東西要
: 別人留意的時候才用吧.
: (還在磨練中)
同意,還要寫註解那就代表程式碼本身描述力不足。
「程式可讀性」有個很經典的例子 XD
假設有一個 Date 類別,請問建構函數要怎麼設計?
Date date1 = Jan(12, 2008) ;
Date date2 = Feb( 9, 2009) ;
忘記在哪邊看到的了... XD
--
To iterate is human, to recurse, divine.
遞迴只應天上有, 凡人該當用迴圈. L. Peter Deutsch
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.160.254.105
→
08/21 18:18, , 1F
08/21 18:18, 1F
→
08/21 19:54, , 2F
08/21 19:54, 2F
→
08/21 20:19, , 3F
08/21 20:19, 3F
→
08/21 21:20, , 4F
08/21 21:20, 4F
→
08/21 21:25, , 5F
08/21 21:25, 5F
→
08/21 21:26, , 6F
08/21 21:26, 6F
→
08/21 21:26, , 7F
08/21 21:26, 7F
→
08/22 04:24, , 8F
08/22 04:24, 8F
→
08/22 04:26, , 9F
08/22 04:26, 9F
→
08/22 04:26, , 10F
08/22 04:26, 10F
→
08/22 13:06, , 11F
08/22 13:06, 11F
→
08/22 13:06, , 12F
08/22 13:06, 12F
→
08/22 13:10, , 13F
08/22 13:10, 13F
→
08/22 13:10, , 14F
08/22 13:10, 14F
→
08/22 13:17, , 15F
08/22 13:17, 15F
→
08/22 14:05, , 16F
08/22 14:05, 16F
推
08/22 14:16, , 17F
08/22 14:16, 17F
→
08/22 15:27, , 18F
08/22 15:27, 18F
→
08/24 14:50, , 19F
08/24 14:50, 19F
→
08/24 14:50, , 20F
08/24 14:50, 20F
→
08/24 14:50, , 21F
08/24 14:50, 21F
推
08/24 17:31, , 22F
08/24 17:31, 22F
推
08/25 10:43, , 23F
08/25 10:43, 23F
→
08/25 10:44, , 24F
08/25 10:44, 24F
→
08/25 10:45, , 25F
08/25 10:45, 25F
→
08/25 10:45, , 26F
08/25 10:45, 26F
→
08/25 10:46, , 27F
08/25 10:46, 27F
→
08/25 10:46, , 28F
08/25 10:46, 28F
→
08/25 10:46, , 29F
08/25 10:46, 29F
推
08/25 11:16, , 30F
08/25 11:16, 30F
→
08/25 11:17, , 31F
08/25 11:17, 31F
→
08/25 11:17, , 32F
08/25 11:17, 32F
→
08/25 11:19, , 33F
08/25 11:19, 33F
→
08/25 11:19, , 34F
08/25 11:19, 34F
→
08/25 12:09, , 35F
08/25 12:09, 35F
→
08/25 12:10, , 36F
08/25 12:10, 36F
→
08/25 12:12, , 37F
08/25 12:12, 37F
→
08/25 12:12, , 38F
08/25 12:12, 38F
→
08/25 12:16, , 39F
08/25 12:16, 39F
→
08/25 12:16, , 40F
08/25 12:16, 40F
→
08/25 12:17, , 41F
08/25 12:17, 41F
→
08/25 12:19, , 42F
08/25 12:19, 42F
→
08/25 12:19, , 43F
08/25 12:19, 43F
→
08/25 12:25, , 44F
08/25 12:25, 44F
→
08/25 12:26, , 45F
08/25 12:26, 45F
推
08/25 17:06, , 46F
08/25 17:06, 46F
推
08/25 23:57, , 47F
08/25 23:57, 47F
→
08/25 23:58, , 48F
08/25 23:58, 48F
→
08/25 23:58, , 49F
08/25 23:58, 49F
→
08/26 00:42, , 50F
08/26 00:42, 50F
→
08/26 00:42, , 51F
08/26 00:42, 51F
推
08/26 01:53, , 52F
08/26 01:53, 52F
推
08/26 01:56, , 53F
08/26 01:56, 53F
→
08/26 01:56, , 54F
08/26 01:56, 54F
→
08/26 08:29, , 55F
08/26 08:29, 55F
→
08/26 11:29, , 56F
08/26 11:29, 56F
→
08/26 11:30, , 57F
08/26 11:30, 57F
→
08/26 11:30, , 58F
08/26 11:30, 58F
→
08/26 11:31, , 59F
08/26 11:31, 59F
→
08/26 11:39, , 60F
08/26 11:39, 60F
→
08/26 13:02, , 61F
08/26 13:02, 61F
→
08/26 13:03, , 62F
08/26 13:03, 62F
→
08/26 13:05, , 63F
08/26 13:05, 63F
→
08/26 13:05, , 64F
08/26 13:05, 64F
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章