<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Heron’s Blog - Medium]]></title>
        <description><![CDATA[Architect Happier Minds | Engineering the intersection of AI and clinical mental health. Authored by a Google Senior Engineer, CMU &amp; Stanford LEAD alum. - Medium]]></description>
        <link>https://medium.com/heronyang?source=rss----d0ef0e7db3bd---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Heron’s Blog - Medium</title>
            <link>https://medium.com/heronyang?source=rss----d0ef0e7db3bd---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 03:33:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/heronyang" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[第二代諮商機器鴨 — Ducky 2]]></title>
            <link>https://medium.com/heronyang/%E7%AC%AC%E4%BA%8C%E4%BB%A3%E8%AB%AE%E5%95%86%E6%A9%9F%E5%99%A8%E9%B4%A8-ducky-2-4fb94abf59fc?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/4fb94abf59fc</guid>
            <category><![CDATA[ducky]]></category>
            <category><![CDATA[聊天機器人]]></category>
            <category><![CDATA[心理健康]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[心理諮商]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 23:39:51 GMT</pubDate>
            <atom:updated>2023-04-28T23:40:14.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LuEL_rVGBL02MzuyiBasgw.jpeg" /></figure><blockquote><strong>跟新的鴨鴨聊天： </strong><a href="http://ducky2.heron.me/"><strong>http://ducky2.heron.me/</strong></a></blockquote><h3>前言</h3><p>2017年冬天，我寫了<a href="https://blog.heron.me/%E8%AB%AE%E5%95%86%E6%A9%9F%E5%99%A8%E4%BA%BA-ducky-a7a6be312377">第一代的諮商機器鴨Ducky</a>發表在網路上，至今已有逾千人跟Ducky聊過天，當時<a href="https://m.facebook.com/permalink.php?story_fbid=795698650593005&amp;id=113742678788609">海苔熊分享在Facebook上</a>且有百人轉貼，直到不久前Ducky因為缺乏維護壞掉之後，還是有不少人持續跟他聊天著。</p><p>這幾年之間，我搜集到許多反饋，與幾位相關的專業人士討論之後，我們開發了第二代Ducky，目前發表在LINE上給大家試用：<a href="http://ducky2.heron.me/">http://ducky2.heron.me/</a>。</p><h3>WHY — 為什麼要做第二代Ducky？</h3><p>兩個主要原因讓我們開發第二代Ducky：</p><ol><li><strong>心理健康不易注意</strong>：當一個人心理狀況不好且持續很久時，容易演變成更嚴重的心理疾病，然而我們平時容易忽略去追蹤自己的心理狀態。我們會定期做健康檢查，也該定期追蹤自己的心理健康（可收聽<a href="https://www.soft-aware.wtf/">軟來如此</a>EP9瞭解更多）。</li><li><strong>缺少能傾訴的空間</strong>：延續第一代最重要的功能，我們往往需要一個地方可以把自己的心情傾訴出來，重點不在於對方回答什麼，而是自己把這些情緒、事情、想法等等講出來的過程。</li></ol><h3>WHAT — 第二代Ducky可以做什麼？</h3><p>對應上述兩個原因，第二代Ducky具有兩個功能（往後可能持續增加）：</p><ol><li><strong>定期心理健康檢查</strong>：第二代Ducky每週會關心你這週過得好不好，你只需要在「🙂、😐、🙁」選項中點一個回覆，他就會記得，接著在往後的日子中關心你、提供對你可能有幫助的訊息。而在你回覆之後，他會分享一張梗圖或鼓勵的圖片感謝你。</li><li><strong>樹洞</strong>：如同第一代Ducky，他會回覆你對他說的話，雖然沒能給你很有高智慧的話，但他總是能一直聽你說，且有些字是特別敏感的小彩蛋，你有找到嗎？</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*nyttG6va_tfCLQvHj0TUGg.png" /><figcaption>鴨鴨的定期心理健康檢查</figcaption></figure><h3>HOW — 第二代Ducky要怎麼用呢？</h3><p>在LINE上面加他，直接跟他聊天就可以囉！連結：<a href="http://ducky2.heron.me/">http://ducky2.heron.me/</a><br>也請幫忙分享連結給你身邊可能需要的朋友。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZsC2JXV1c08Q_Ew1A8BmkQ.png" /><figcaption>我們要幫助更多的人哦！</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fb94abf59fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/%E7%AC%AC%E4%BA%8C%E4%BB%A3%E8%AB%AE%E5%95%86%E6%A9%9F%E5%99%A8%E9%B4%A8-ducky-2-4fb94abf59fc">第二代諮商機器鴨 — Ducky 2</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Psychology of Money (Reading Note)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/heronyang/the-psychology-of-money-reading-note-42f0efbe1ca7?source=rss----d0ef0e7db3bd---4"><img src="https://cdn-images-1.medium.com/max/2600/1*YUv0xgsddRB8Bzxn6ZiTBg.jpeg" width="7780"></a></p><p class="medium-feed-snippet">The Psychology of Money describes that personal finance should consider your happiness as part of the goal&#x200A;&#x2014;&#x200A;I think this book points out&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/heronyang/the-psychology-of-money-reading-note-42f0efbe1ca7?source=rss----d0ef0e7db3bd---4">Continue reading on Heron’s Blog »</a></p></div>]]></description>
            <link>https://medium.com/heronyang/the-psychology-of-money-reading-note-42f0efbe1ca7?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/42f0efbe1ca7</guid>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[money]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sun, 16 Apr 2023 18:21:12 GMT</pubDate>
            <atom:updated>2023-04-16T18:21:12.889Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[ELDROW — The Wordle Solver]]></title>
            <link>https://medium.com/heronyang/eldrow-the-wordle-solver-c06c7e407d3b?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/c06c7e407d3b</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[solver]]></category>
            <category><![CDATA[wordle]]></category>
            <category><![CDATA[eldrow]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sun, 13 Feb 2022 17:10:15 GMT</pubDate>
            <atom:updated>2022-02-13T17:10:14.922Z</atom:updated>
            <content:encoded><![CDATA[<h3>ELDROW — The Wordle Solver</h3><h4>Here: <a href="https://wordle-eldrow.herokuapp.com/](https://wordle-eldrow.herokuapp.com).">https://wordle-eldrow.herokuapp.com/</a></h4><p>While enjoying playing <a href="https://www.nytimes.com/games/wordle/index.html">Wordle</a> for a couple days, I wanted some dictionary lookup tools that could help me when I’m stuck. I thought about building a Wordle Solver but didn’t expect it actually happens until yesterday.</p><p>This blog briefly documents how I built a Wordle Solver less than 1 day. See code at <a href="https://github.com/heronyang/eldrow">https://github.com/heronyang/eldrow</a>.</p><h3>Design Goals</h3><p>The solver <strong>should work</strong> (of curse) and <strong>should be built fast</strong> (otherwise I will lose interest and stop investing).</p><h3>Process</h3><p>As I was unsure how much time to invest into this solver, I implemented it incrementally — so I can still takeaway something if I stopped in the middle.</p><h4>Step 1 — The Solver Brain</h4><p><strong>Interface</strong><br>I started to code the main logic of solving a Wordle with a bad interface that only programmers can use it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3156ae27f7d7824b6d291c26956d07d/href">https://medium.com/media/c3156ae27f7d7824b6d291c26956d07d/href</a></iframe><p><strong>Language</strong><br>I picked <strong>Dart</strong> as I can reuse it later if want to continue to build a Flutter app. Writing Dart takes much more time as I am new to Dart, but this is the additional cost I am willing to pay.</p><p><strong>Algorithm</strong><br>The main solving algorithm was straightforward — it looks up all valid words, applies the game rules to remove illegal words, and prints out the legal words. I didn’t spend time to optimize the algorithm as it’s O(N*M) where N~=100K and M=5 which is pretty easy for today’s devices.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3c73079c40d6e7772ea16dcba1fbc68/href">https://medium.com/media/c3c73079c40d6e7772ea16dcba1fbc68/href</a></iframe><h4>Step 2 — The App (Flutter) Interface</h4><p>As I found out the solver works fine, I want to make it accessible on my phone so I can use it when I’m out playing Wordle.</p><p><strong>User Interface (UI)</strong></p><p>In this step, I focus on building the UI for the solver and doesn’t care about the solver brain at all. The UI should be designed with the user in mind, not the solver — so I designed it to look similar to today’s Wordle game for people easy to fill in letters.</p><p>Users need to put the green and yellow letters in the correct column as the column means its position in the word, but grey letters can be out-of-order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*qqSYM8_ANbRRh0iH7yHa8w.png" /></figure><p><strong>Bridging UI and Brain</strong><br>Once we have the UI and solver brain (a solver with Dart interface), we can bridge them together. That is, within the callback function of clicking on the submit button, we prepare the parameters for the solver brain, calls the solver brain to solve, and parse the result back to the UI.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c29d7c23c23f658b36c230bd6db3b025/href">https://medium.com/media/c29d7c23c23f658b36c230bd6db3b025/href</a></iframe><p>Here’s an example of how ELDROW solves a real Wordle Game:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*XQpkW7_J7XTd4J88Dnscnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Flf4Ndjgn4ayu-0X2HOmcg.png" /><figcaption>Use the information from the first two rows to fill-in the solver. Pick one word from the answer list to solve the game.</figcaption></figure><p><strong>Deploy</strong><br>Finally, I built the code into a web app and deploy it onto Heroku. The commands are:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40cc3295e61bd81e15fc5c4069807797/href">https://medium.com/media/40cc3295e61bd81e15fc5c4069807797/href</a></iframe><p>See the deployed app at <a href="https://wordle-eldrow.herokuapp.com](https://wordle-eldrow.herokuapp.com).">https://wordle-eldrow.herokuapp.com</a>.</p><h4>Step 3 — Continuous Update</h4><p>Okay, I actually haven’t done this step yet — this is a future step I will continue if its benefit outweighs the cost.</p><p>This step includes:</p><ul><li>Sort the answer words with their popularity. (Show common words on top.)</li><li>Maintain an issue list which contains user feedbacks, bugs, wanted features, etc.</li><li>Consider fancy add-on features — e.g. the solver reads a screenshot instead of you typing in the letters.</li><li>etc.</li></ul><h3>Summary</h3><p>The MVC concept affects the flow of how I built ELDROW (although this term didn’t actually appear in my mind). I started with the model (M) so I can still have a solver with poor interface to use if I gave up in the middle. Then, I focus on the view (V) where I only think about the user. Lastly, I added the controller (C) to connect the model and the view.</p><p>Building an app quickly is fun and fulfilling :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r2OpLgkRjsHk1pvLWF_RuQ.png" /></figure><blockquote><strong>Follow me on </strong><a href="http://facebook.com/blog.heron.me"><strong>Facebook</strong></a><strong>.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c06c7e407d3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/eldrow-the-wordle-solver-c06c7e407d3b">ELDROW — The Wordle Solver</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Radical Candor — Book Reading Note]]></title>
            <link>https://medium.com/heronyang/radical-candor-book-reading-note-c78b028938c9?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/c78b028938c9</guid>
            <category><![CDATA[radical-candor]]></category>
            <category><![CDATA[management-books]]></category>
            <category><![CDATA[reading-notes]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Mon, 17 Jan 2022 03:55:33 GMT</pubDate>
            <atom:updated>2022-01-17T03:55:33.660Z</atom:updated>
            <content:encoded><![CDATA[<h3>Radical Candor — Book Reading Note</h3><p>I summarized <a href="https://www.radicalcandor.com/">Radical Candor</a> into the following mind map for future me:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jskC2NG6vPJ_gusRCO54yw.png" /></figure><p>The Get-Stuff-Done Wheel is as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ps6G0IhcpCXvl1EYlVIf0w.png" /></figure><p>And, the long version of my reading note is as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w1a6237PUWkRRYpBp1OAhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dCY2u60UWtRIrmlQzv0ZlQ.jpeg" /></figure><p><strong><em>Follow me on </em></strong><a href="http://facebook.com/blog.heron.me"><strong><em>Facebook</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c78b028938c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/radical-candor-book-reading-note-c78b028938c9">Radical Candor — Book Reading Note</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Science of Well-Being (Happiness)]]></title>
            <link>https://medium.com/heronyang/the-science-of-well-being-4715ccdc8bb5?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/4715ccdc8bb5</guid>
            <category><![CDATA[the-science-of-well-being]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[mindmap]]></category>
            <category><![CDATA[reading-notes]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sun, 20 Jun 2021 02:24:43 GMT</pubDate>
            <atom:updated>2021-06-20T02:25:13.336Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I took <a href="https://www.coursera.org/learn/the-science-of-well-being">The Science of Well-Being on Coursera</a> — a course that teaches you happiness. This blog documents my summary paragraph and its mind map.</p><h4>Summary</h4><p>Wanting a wrong thing — <strong>miswanting</strong> — such as job, money, awesome stuff, etc, is the reason of not being happy. Annoying features of our brain caused miswanting include bad intuitions, can’t think in absolutes, and being used to stuff.</p><p>Two ways of bringing happiness are:</p><ul><li><strong>Intentionally strategy</strong>: thwart the adaption and reset the reference point of comparison.</li><li><strong>Better wanting</strong>: we should want these things instead: kindness, social connection, time affluence, mind control (e.g. meditation), and healthy practice (e.g. sleep and exercise).</li></ul><p>To act, we intentionally practice: signature strength (apply your strengths), savoring, gratitude, kindness, social connection, exercise, sleep, and meditation. Last, investing in experience other than stuffs brings happiness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y7qU4qDTD8Hs8yKDzLZq8g.png" /></figure><h4>Takeaway</h4><p>After taking the course, I finally understand there’s a misconnection between “what I expect to make me happy” and “what actually makes me happy”. This is a question I’ve been measuring and rethinking over the past few months and the course (and this post) answers it nicely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_44QM2z9bpXaZRTZcfEjQ.jpeg" /></figure><blockquote><strong>Follow me on </strong><a href="http://facebook.com/blog.heron.me"><strong>Facebook</strong></a><strong>.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4715ccdc8bb5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/the-science-of-well-being-4715ccdc8bb5">The Science of Well-Being (Happiness)</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[認知行為治療 (CBT)]]></title>
            <link>https://medium.com/heronyang/%E8%AA%8D%E7%9F%A5%E8%A1%8C%E7%82%BA%E6%B2%BB%E7%99%82-cbt-a4f052e07c0e?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/a4f052e07c0e</guid>
            <category><![CDATA[心理學]]></category>
            <category><![CDATA[cbt]]></category>
            <category><![CDATA[reading-notes]]></category>
            <category><![CDATA[情緒平復]]></category>
            <category><![CDATA[認知行為治療]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sun, 23 May 2021 01:43:00 GMT</pubDate>
            <atom:updated>2021-05-23T01:43:00.508Z</atom:updated>
            <content:encoded><![CDATA[<p>我把<a href="https://www.books.com.tw/products/0010885987">情緒平復練習：認知行為治療實作指南</a>這本書理解成一張圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5mara4THUmzhMiVPwauhQ.jpeg" /></figure><p>小記：我喜歡的寫實攝影似乎也是一種正念練習，因為它專注於觀察眼前事物、保持客觀態度。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpUuv0U3rR3Tx5AJJXVq7Q.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4f052e07c0e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/%E8%AA%8D%E7%9F%A5%E8%A1%8C%E7%82%BA%E6%B2%BB%E7%99%82-cbt-a4f052e07c0e">認知行為治療 (CBT)</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[程序員都是樂觀主義者]]></title>
            <link>https://medium.com/heronyang/%E7%A8%8B%E5%BA%8F%E5%93%A1%E9%83%BD%E6%98%AF%E6%A8%82%E8%A7%80%E4%B8%BB%E7%BE%A9%E8%80%85-25088d3faf0b?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/25088d3faf0b</guid>
            <category><![CDATA[人月神話]]></category>
            <category><![CDATA[軟體測試]]></category>
            <category><![CDATA[程序員]]></category>
            <category><![CDATA[樂觀主義者]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Tue, 12 Jan 2021 05:52:52 GMT</pubDate>
            <atom:updated>2021-01-12T06:07:49.311Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>「這功能我加一下，很快，明天就好」一位程序員說，結果過了快兩週都說還沒做完。</em></blockquote><p>不論你自己是一個寫程式的人，或者是平時跟程序員合作的人，以上的故事是不是聽起來很熟悉？「程序員都是樂觀主義（All programmers are optimists）」這句話源自於近半個世紀前出版的軟體書：<a href="https://blog.heron.me/the-mythical-man-month-92086cd6d6a6">人月神話（The Mythical Man-Month）</a>，而至今，每日開發軟體的我總是會想起，也深深影響我評估開發時程的方式。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XleoPXmL9_wobsStGxs-kw.jpeg" /></figure><h3>什麼意思？</h3><p>程序員在評估完成某一軟體功能時，容易給出一個<strong>最樂觀的理想時程</strong>，而實際上卻往往花出數倍多的時間。由於程序員給予的時間比最終實際的情況短太多了，於是我們說程序員都是樂觀主義者，仿佛是一種刻意的偏見。</p><h3>為什麼？</h3><p>程序員習慣用<strong>「順順地會需要花多久時間把程式打出來」</strong>來評斷所需的開發時間，於是忽略掉兩件事實：寫程式只是軟體開發的一小部分、程式開發充滿不確定性。</p><h4>寫程式只是一小部分</h4><p>健康的程式開發流程包含：設計、寫程式、單元測試與整合測試。人月神話作者認為的比例如下：</p><ul><li>1/3 設計 (Design)</li><li>1/6 寫程式 (Coding)</li><li>1/4 單元測試 (Component Testing)</li><li>1/3 系統整合測試 (System Testing)</li></ul><p>也就是，設計清楚之後，<strong>寫程式的時間其實相對很少的，只有六分之一，且超過一半的時間在測試新加入的功能</strong>。</p><h4>程式開發充滿不確定性</h4><p>程式開發是充滿不確定性的，<strong>大多時候都不會走在一個「最理想的情況」上</strong>。原因是因為程式開發是一個創作過程，前無古人，沒有人做過一樣的事情來保證沒有問題，於是，意外總是在發生，例如：使用套件X之後出現Error卻查不到原因、函式庫Y中竟然不支援我想要的用法Z、等等。每一件意外都會耗掉非常非常多的時間來解決，如一天至數週。</p><h3>那怎麼辦？</h3><p>不論你自己是程序員，或者你必須跟程序員合作，可以試試以下方式來預估更準確的軟體開發時程。</p><h4>意識實際值與預估值</h4><p>有意識（Be Conscious）於實際值和預估值之間的誤差是解決問題的起點。你可以試著看過去（自己或別人）評估過的開發時間與實際所花時間，然後問：</p><ul><li>實際上所花的時間與當初預估的差多少？</li><li>這個差別是因為時間花在什麼地方？</li><li>是否有出現「意外（Surprise）」所以花了異常多的時間？</li><li>是否在預估與實際上花足夠的「測試」時間？</li></ul><h4>累績經驗</h4><p>透過有意識地練習如上述，加上單純的經驗累積，你的預估值應該會離實際值較為相近。記得持續透過新觀察的資料點（實際值與預估值的落差）來修正自己的評估能力。</p><p>經驗較少的程序員往往會讓自己死命地拼一個曾答應過的「馬上就寫好」，而經驗多的工程師則能穩穩地在差不多預估的時間上交差。</p><h4>明白軟體開發流程</h4><p>明白軟體開發流程包含反覆修改的設計與大量的測試，「寫了可以動了」與「寫好、測試好、可以上架」的差別如天與地。程序員自己、與程序員合作的設計師或PM等等、還有程序員的主管都應有一樣的了解，且對於「寫好」有相同的定義。如此一來，程序員不用讓自己埋頭趕交差、團隊能準時地完成目標，最重要的是：寫出來的軟體是經過妥當測試的，所以用起來是穩定且能長久地成長。</p><h3>結語</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*u8uQIiVWXxyxIUd-RzYFmg.png" /></figure><p><strong>「程序員都是樂觀主義者」不是偏見，而是警語</strong>，它提醒我們時程評估上常犯的錯。每一個程序員都有一個預估落差比例 D，定義為實際所花時間除以預估所花時間；我們要時時觀察身邊程序員與自己的 D、不斷地修正讓它接近1。</p><blockquote><strong>Follow </strong><a href="https://www.facebook.com/blog.heron.me"><strong>Heron’s Blog on Facebook</strong></a><strong>.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25088d3faf0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/%E7%A8%8B%E5%BA%8F%E5%93%A1%E9%83%BD%E6%98%AF%E6%A8%82%E8%A7%80%E4%B8%BB%E7%BE%A9%E8%80%85-25088d3faf0b">程序員都是樂觀主義者</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Design Pattern in C++] Command Pattern]]></title>
            <link>https://medium.com/heronyang/design-pattern-in-c-command-pattern-6611d4150a4a?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/6611d4150a4a</guid>
            <category><![CDATA[command-pattern]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[design-patterns-in-cpp]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sun, 06 Dec 2020 19:49:02 GMT</pubDate>
            <atom:updated>2020-12-06T19:49:02.527Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://blog.heron.me/tagged/design-patterns-in-cpp">Design Pattern in C++</a> is a series of Heron’s blog posts that shares C++ code examples of each design pattern. You can find all code at <a href="https://github.com/heronyang/design-pattern">this Github repo</a>. I don’t explain the details of each pattern in these posts, please refer to other resources if that’s what you’re looking for.</p><h3>Definition</h3><blockquote>Command Pattern encapsulate all information needed to perform an action into a single method. Different implements can override the method differently and the callers are unaware of the implementations.</blockquote><h3>Code</h3><p>Command is an interface that exposes Execute(), implemented by AttackCommand and DefenseCommand. Game is the caller of different Command implementations and is unaware how each command is handled as all of them expose the same interface. As a result, Game can easily map different buttons to execute different commands.</p><p><strong>command.h</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc2ecd51774ae60e30c45b3a58d52cbc/href">https://medium.com/media/fc2ecd51774ae60e30c45b3a58d52cbc/href</a></iframe><p><strong>attack_command.h</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a60692bfd8aa88770995e941b216081d/href">https://medium.com/media/a60692bfd8aa88770995e941b216081d/href</a></iframe><p>DefenseCommand is similar to AttackCommand so I am skipping it here.</p><p><strong>game.h</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63ba41a47f73ce96bd17df4f30ec482c/href">https://medium.com/media/63ba41a47f73ce96bd17df4f30ec482c/href</a></iframe><p><strong>game.cc</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6309e66a6d2b7eaa56c8c5ffae2acff4/href">https://medium.com/media/6309e66a6d2b7eaa56c8c5ffae2acff4/href</a></iframe><p><strong>main.cc</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67f036f4da3b5d0a34d9df1fb8baee8/href">https://medium.com/media/a67f036f4da3b5d0a34d9df1fb8baee8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IL-cygsYVnWNiUHXbjnow.jpeg" /><figcaption>Can you find the ‘command’ in this photo?</figcaption></figure><h3>Note</h3><p>I noticed two properties about Command Pattern:</p><ul><li>“Commands are an object-oriented replacement for callbacks.” With Command Pattern, we can implement a flow that triggers a method — say Execute() - when a target event happens. Execute() then plays the same role as callbacks.</li><li>Command Pattern enables us to ‘undo’ an action. To implement ‘undo’, (1) Other than Execute(), each command object should also implement Undo() which does the action to undo an Execute(), then (2) We push the executed Command objects into a stack. When the caller wants to ‘undo’, we pop one Command object from the stack and call its Undo().</li></ul><h3><strong>Full Code</strong></h3><p><a href="https://github.com/heronyang/design-pattern/tree/master/behavioral/command">heronyang/design-pattern</a></p><h3>Reference</h3><ul><li><a href="https://en.wikipedia.org/wiki/Command_pattern">https://en.wikipedia.org/wiki/Command_pattern</a></li><li><a href="https://gameprogrammingpatterns.com/command.html">https://gameprogrammingpatterns.com/command.html</a></li></ul><blockquote><strong>Follow me on </strong><a href="https://blog.heron.me/fb.com/blog.heron.me"><strong>Facebook</strong></a><strong>.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6611d4150a4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/design-pattern-in-c-command-pattern-6611d4150a4a">[Design Pattern in C++] Command Pattern</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Design Pattern in C++] Chain of Responsibility]]></title>
            <link>https://medium.com/heronyang/design-pattern-in-c-chain-of-responsibility-324e47ea345a?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/324e47ea345a</guid>
            <category><![CDATA[chain-of-responsibility]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[design-patterns-in-cpp]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Sat, 28 Nov 2020 03:45:44 GMT</pubDate>
            <atom:updated>2020-11-28T03:46:10.630Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://blog.heron.me/tagged/design-patterns-in-cpp">Design Pattern in C++</a> is a series of Heron’s blog posts that shares C++ code examples of each design pattern. You can find all code at <a href="https://github.com/heronyang/design-pattern">this Github repo</a>. I don’t explain the details of each pattern in these posts, please refer to other resources if that’s what you’re looking for.</p><h3><strong>Definition</strong></h3><blockquote>Chain of Responsibility pattern passes a request into a chain of objects — each object processes the request and decides whether to pass to the next object.</blockquote><h3>Code</h3><p>Logger is an abstract class implemented by ConsoleLogger, FileLogger, and EmailLogger. Logger provides AddNext() to chain another Logger. When the caller calls Log(), the logger writes log and asks the next logger does the same if needed.</p><p><strong>logger.h</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c78d75256bf35af08183505b7fb5d4d3/href">https://medium.com/media/c78d75256bf35af08183505b7fb5d4d3/href</a></iframe><p><strong>logger.cc</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14882e0f4697989295eb394d3716a67f/href">https://medium.com/media/14882e0f4697989295eb394d3716a67f/href</a></iframe><p><strong>console_logger.h</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/892516481c2967f60320b64c5afb0e6d/href">https://medium.com/media/892516481c2967f60320b64c5afb0e6d/href</a></iframe><p><strong>console_logger.cc</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30540c7b2fe6a0998595f992723f1c1c/href">https://medium.com/media/30540c7b2fe6a0998595f992723f1c1c/href</a></iframe><p>Note that FileLogger and EmailLogger are similar to ConsoleLogger so I skipped them in this post.</p><p><strong>main.cc</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/448faeee3ba169a5994096fe1bb6e722/href">https://medium.com/media/448faeee3ba169a5994096fe1bb6e722/href</a></iframe><h3>Full Code</h3><p><a href="https://github.com/heronyang/design-pattern/tree/master/behavioral/chain-of-responsibility">heronyang/design-pattern</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w68BEPDmqPxmVs9KVxauxQ.jpeg" /></figure><h3>Reference</h3><ul><li><a href="https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern">https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern</a></li><li><a href="https://www.geeksforgeeks.org/chain-responsibility-design-pattern/">https://www.geeksforgeeks.org/chain-responsibility-design-pattern/</a></li></ul><blockquote><strong>Follow me on </strong><a href="https://medium.com/fb.com/blog.heron.me"><strong>Facebook</strong></a><strong>.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=324e47ea345a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/design-pattern-in-c-chain-of-responsibility-324e47ea345a">[Design Pattern in C++] Chain of Responsibility</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging Teams]]></title>
            <link>https://medium.com/heronyang/debugging-teams-844d8faf2e40?source=rss----d0ef0e7db3bd---4</link>
            <guid isPermaLink="false">https://medium.com/p/844d8faf2e40</guid>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[debugging-team]]></category>
            <category><![CDATA[leadership]]></category>
            <dc:creator><![CDATA[Heron Yang]]></dc:creator>
            <pubDate>Fri, 30 Oct 2020 07:10:31 GMT</pubDate>
            <atom:updated>2020-10-30T07:10:31.507Z</atom:updated>
            <content:encoded><![CDATA[<p>I read the book - <a href="https://www.amazon.com/Debugging-Teams-Productivity-through-Collaboration/dp/1491932058">Debugging Teams: Better Productivity through Collaboration</a> - recently to learn more about collaborations. This post contains the sentences from the book that I found helpful for myself and the future me. I subjectively divided the sentences into two sets — the very important ones and others.</p><h3>Important Sentences</h3><ul><li>HRT (important): — <strong>Humility</strong>: You are not the center of the universe. You’re neither omniscient nor infallible. You’re open to self-improvement. <strong>Respect</strong>: You genuinely care about others you work with. You treat them as human beings, and appreciate their abilities and accomplishments. <strong>Trust</strong>: You believe others are competent and will do the right thing, and you’re okay with letting them drive when appropriate.</li><li>Give people: “autonomy”, “mastery”, and “purpose”.</li><li>“Track happiness” — ask “what do you need?”</li><li>“Failure is an option.” — If you’re not failing now and then, you’re not being innovative enough or taking enough risks.</li><li>The more you are open to influence, the more you are able to influence; the more vulnerable you are, the stronger you appear.</li><li>Even if you’re great at writing code, there’s still an upper limit to the amount of code you can write. Seek to replace yourself.</li><li>“Do the right thing, wait to get fired.” (Chade-Meng Tan, Googler) If I don’t get fired, I’ve done the Right Thing for everyone. If I do get fired, this is the wrong employer to work for in the first place. So, either way, I win. That is my career strategy.</li><li>At some point, you need to decide when it’s time to cut your losses and move on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HD3SJ5zZ8LxjUtN5G-8Hgw.jpeg" /></figure><h3>More Sentences</h3><ul><li>Mission: more time creating and less time fighting — by improving their ability to collaborate with other people.</li><li>‘Hide my code’ is caused by insecurity — people are afraid of others seeing and judging their work in progress. Hiding is considered harmful — how do you even know if you’re on the right track?</li><li>‘Bus factor’ is the number of people that need to get hit by a bus before your project is completely doomed.</li><li>Linus’s real achievement was to lead these people and coordinate their work.</li><li>Working alone is inherently riskier than working with others.</li><li>It’s not about tracking or manipulating people; it’s about creating relationships to get things done, and relationships always outlast projects.</li><li>Nobody wants to work with someone who consistently behaves like he’s the most important person in the room.</li><li>Rather than worrying about whether you’re personally awesome, try to build a sense of team accomplishment and group pride.</li><li>Once you reach a local maximum on your team, you stop learning. And when you stop learning, you get bored.</li><li>If you don’t put effort into building and maintaining your culture, your team will eventually be overtaken by strong personalities that cultivate their culture in your team. If you build a strongly defined one, it will become self-selecting.</li><li>As your project progresses, the mission statement keeps things on track.</li><li>Try to schedule the meeting near other interrupt points in your day.</li><li>Traditional managers worry about how to get things done, while leaders worry about what things get done .. (and trust their team to figure out how to do it.)</li><li>“A people hire other A people; B people hire C people.”</li><li>Leader is always on stage.</li><li>In many cases, knowing the right person is more valuable than knowing the right answer.</li><li>One of the hardest things to do as a team leader is to watch a more junior-level team member spend three hours working on something you know you can knock out in 20 minutes.</li><li>Being sensitive to personal situations that your team members are going through can give you a lot of insight into why they may be more or less productive at any given time.</li><li>Let your team know when they’re doing well.</li><li>Focus on the long term: Do you truly believe the project will still benefit in the long run? Do you believe the conflict will ultimately resolve itself in a useful way?</li><li>When you fail, take responsibility, don’t seek to assign blame, and document what happened and what you can do to avoid that same failure again.</li><li>Bad manager sees your existence solely as a means to get herself promoted, and she doesn’t care about your career, much less your team’s happiness.</li><li>Is your manager serving you? Or are you serving your manager? It should always be the former.</li><li>You need to try to ensure that both your manager and the people outside your team are not only aware of what you’re doing, but are aware that you’re doing it well.</li><li>Avoid promising things that you can’t deliver, even if it means saying “no” more often than you’d like.</li><li>After years of trial and error, we’ve found that shorter emails are even more likely to get a response.</li><li>There’s probably nothing else you can do. Don’t be a victim. Get the heck out of there.</li><li>You can’t ignore marketing, but you can actively cooperate with marketing.</li><li>“Focus on the user, and all else will follow.”</li><li>Measure usage, not users.</li></ul><h3>My Thoughts</h3><p>I like the book focuses on <strong>HRT (Humility, Respect, Trust)</strong> as the key factors in collaborations. The book also points out things that are easily be missed out, e.g. always track happiness. I am afraid that I will forget important things learned from this book over time, so I put them into this post for myself and the future me.</p><p><em>Follow me up on Facebook: </em><a href="https://medium.com/fb.com/blog.heron.me"><em>fb.com/</em>blog.heron.me</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=844d8faf2e40" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heronyang/debugging-teams-844d8faf2e40">Debugging Teams</a> was originally published in <a href="https://medium.com/heronyang">Heron’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>