[URL] Improve Your Programming Skills with

看板Soft_Job作者 (有些事,有時候。。。)時間11年前 (2014/12/27 10:46), 11年前編輯推噓5(500)
留言5則, 5人參與, 最新討論串1/1
Improve Your Programming Skills with Exercism.io http://www.infoq.com/news/2014/12/programming-skills-exercism " Exercism.io helps developers to increases their craftsmanship in a language through feedback and discussion. It’s a community and tool where developers can write code and discuss it to strengthen their problem-solving skills. " ============================================================== http://exercism.io/ 是這服務的網站,進去後能使用 github 帳號登入。 依他說明可以按裝 exercism 程式用來取得練習與 submit code 用的 練習有蠻多語言的: qty:~ qrtt1$ ./app/exercism/exercism fetch New: 19 problems Bob (clojure) /Users/qrtt1/exercism/clojure/bob Bob (coffeescript) /Users/qrtt1/exercism/coffeescript/bob Bob (cpp) /Users/qrtt1/exercism/cpp/bob Leap (csharp) /Users/qrtt1/exercism/csharp/leap Bob (elixir) /Users/qrtt1/exercism/elixir/bob Leap (erlang) /Users/qrtt1/exercism/erlang/leap Sum Of Multiples (fsharp) /Users/qrtt1/exercism/fsharp/sum-of-multiples Leap (go) /Users/qrtt1/exercism/go/leap Leap (haskell) /Users/qrtt1/exercism/haskell/leap Bob (javascript) /Users/qrtt1/exercism/javascript/bob Point Mutations (lisp) /Users/qrtt1/exercism/lisp/point-mutations Hamming (lua) /Users/qrtt1/exercism/lua/hamming Bob (objective-c) /Users/qrtt1/exercism/objective-c/bob Bob (ocaml) /Users/qrtt1/exercism/ocaml/bob Bob (perl5) /Users/qrtt1/exercism/perl5/bob Bob (python) /Users/qrtt1/exercism/python/bob Hamming (ruby) /Users/qrtt1/exercism/ruby/hamming Bob (scala) /Users/qrtt1/exercism/scala/bob Leap (swift) /Users/qrtt1/exercism/swift/leap unchanged: 0, updated: 0, new: 19 我選了 Python 進去看看,只有 3 個檔案。 一個是說明,一個是主程式,一個是 test case qty:~ qrtt1$ cd /Users/qrtt1/exercism/python/bob qty:bob qrtt1$ ls README.md bob.py bob_test.py 看介紹是以 testcase 驗證為主的(這樣也不用準備 server 來驗證了) 那就依著 TDD 的慣例,先跑一次 test 讓它 fail qty:bob qrtt1$ python -munittest bob_test FFFFFFFFFFFFFFFFFFFF ====================================================================== FAIL: test_asking_a_numeric_question (bob_test.BobTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "bob_test.py", line 32, in test_asking_a_numeric_question bob.hey('You are, what, like 15?') AssertionError: u'Sure.' != None ......................(略)............................. ====================================================================== FAIL: test_statement_containing_question_mark (bob_test.BobTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "bob_test.py", line 89, in test_statement_containing_question_mark 'Whatever.', bob.hey('Ending with ? means a question.') AssertionError: u'Whatever.' != None ====================================================================== FAIL: test_stating_something (bob_test.BobTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "bob_test.py", line 14, in test_stating_something bob.hey('Tom-ay-to, tom-aaaah-to.') AssertionError: u'Whatever.' != None ====================================================================== FAIL: test_talking_forcefully (bob_test.BobTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "bob_test.py", line 38, in test_talking_forcefully bob.hey("Let's go make out behind the gym!") AssertionError: u'Whatever.' != None ====================================================================== FAIL: test_using_acronyms_in_regular_speech (bob_test.BobTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "bob_test.py", line 43, in test_using_acronyms_in_regular_speech 'Whatever.', bob.hey("It's OK if you don't want to go to the DMV.") AssertionError: u'Whatever.' != None ---------------------------------------------------------------------- Ran 20 tests in 0.003s FAILED (failures=20) 接下來就依說明的規則來修正程式, 那麼程式長什麼樣子呢? qty:bob qrtt1$ cat bob.py # # Skeleton file for the Python "Bob" exercise. # def hey(what): return 果真是個空白實作,只有 function 的皮。 然後就要嗡嗡嗡的補上實作,直到對了為止!? 完工後就可以 submit 你的程式碼, 接下來的事情才是正事!!! 把 code 寫正確是基本的,但這回的命題在把它寫得「好」 http://exercism.io/onboarding/have-a-conversation Share Your Process " So you've submitted an exercise, now what? It's interesting to know how you approached the exercise. Feel free to comment, saying a bit about your thought process, the choices you made, things you considered and discarded, or interesting insights that you had while solving it. There's no One True SolutionTM to any of the problems (and don't believe anyone if they suggest there is). When others comment, remember that this is a conversation, not instruction. They probably don't have all the answers, and neither do you. Push back (politely) if you disagree with some feedback you get. It will make the conversation richer and more valuable to everyone to explore the reasoning and histories behind the preferences we all have. 依文意,簡略說明就是: " 在這一階段,你得試著描述你的「思路」,其他人會針對你的思考 給予評論,不管好壞與否,你可以選擇納入解法或是拒絕某些意見。 所有的評論往來都只能視為「對話」而不是「指導」。 我不知道這個總體的設計上在「心理學」的部分下了多少工夫, 但這個流程是經典的「後設認知」應用 http://zh.wikipedia.org/wiki/%E5%BE%8C%E8%A8%AD%E8%AA%8D%E7%9F%A5 當「個人」能試著回溯一個結果形成的過程中的各項心理活動, 或是具體的決策依據時,他才有可能有邏輯地精進他的成果。 因為當我們能再一次執行時,回顧上一次的「分枝」點, 做出稍有不同的決定,結果與預期的距離就可能有所改變。 換到教育或「自我學習」是件相當實用的心理活動。 -- 本季的素敵な選TAXI真強大, 可以回到過去一直重新選擇啊.. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.231.156.136 ※ 文章網址: http://www.ptt.cc/bbs/Soft_Job/M.1419648414.A.1A6.html ※ 編輯: qrtt1 (36.231.156.136), 12/27/2014 10:57:14

12/27 11:42, , 1F
12/27 11:42, 1F

12/27 13:28, , 2F
q推
12/27 13:28, 2F

12/27 21:03, , 3F
12/27 21:03, 3F

12/27 23:03, , 4F
推 有料文~
12/27 23:03, 4F

12/28 02:59, , 5F
感謝推
12/28 02:59, 5F
文章代碼(AID): #1KdXsU6c (Soft_Job)