<?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[Stories by Tammy Chu on Medium]]></title>
        <description><![CDATA[Stories by Tammy Chu on Medium]]></description>
        <link>https://medium.com/@tctammychu?source=rss-d22f7961d3dc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*HIFLMg5PLjdBQVByxIr6fQ.jpeg</url>
            <title>Stories by Tammy Chu on Medium</title>
            <link>https://medium.com/@tctammychu?source=rss-d22f7961d3dc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:44:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tctammychu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[給自己一個機會當全職Indiehacker]]></title>
            <link>https://medium.com/@tctammychu/%E7%B5%A6%E8%87%AA%E5%B7%B1%E4%B8%80%E5%80%8B%E6%A9%9F%E6%9C%83%E7%95%B6%E5%85%A8%E8%81%B7indiehacker-f39da4bd966d?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/f39da4bd966d</guid>
            <category><![CDATA[indiehackers]]></category>
            <category><![CDATA[一人公司]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[indiedev]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 08:59:30 GMT</pubDate>
            <atom:updated>2020-03-24T09:09:34.995Z</atom:updated>
            <content:encoded><![CDATA[<h3>裁員到轉職 — 給自己一個機會當全職Indiehacker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dc7TNZNmtHEBpPiw" /><figcaption>Photo by <a href="https://unsplash.com/@noahsilliman?utm_source=medium&amp;utm_medium=referral">Noah Silliman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>2020對我來說是巨大的變革，年初時我的前公司便裁了百分之十五的員工，包括我在內，我們整個dev team都離開了。相較於其他公司，這一波裁員這並不是因為疫情，早在疫情爆發前就裁完了。業界的小道消息是因為前公司正在準備下一輪的融資，為此整頓一下財務。</p><p>CEO在最後的Townhall meeting時哭了。雖然被裁員了，但我還是百分之百相信他對區塊鏈抱有的夢。其實我們很多人早就知道這遲早會發生，我和我的PM在最後這一年總有種懷才不遇的感覺，想衝刺都無法施展自己的拳腳。</p><blockquote>So there is no hard feeling.</blockquote><p>人生一直以來平平順順的，被裁員真的是一記當頭棒喝，讓我開始認真思考我想要的是什麼。都已經二十多歲快三十了，想做什麼就要趁現在。</p><p>我幾年前認識了<a href="https://indiehackers.com/">indiehackers</a>這個網站，便一直很嚮往indiehackers的生活。</p><h3>什麼是Indiehacker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GaOh-p5aW7EGVUzNNPAqSg.png" /><figcaption>Definition of indiehacker</figcaption></figure><p>如果直接照字面上來翻譯，indiehackers指的是獨立駭客，但這個解釋不太準確。indiehackers不一定要會寫程式碼，但對科技要有一定的敏銳度。就算不會部署網頁或是app，indiehackers要懂的運用線上的資源完成自己的產品，No code是最近越來越流行的趨勢。indiehackers出產的產品很廣泛，從SaaS到電商到求職版都有。</p><h3>動力</h3><p>Follow indiehackers這幾年下來，我一直陸陸續續有想要自己做產品的念頭，但一直沒有動力持之以恆，只有一直不斷地讀indiehackers的訪談。<a href="https://nomadlist.com/">Nomadlist</a>的創始人Pieter Levels在訪談裡提到：</p><blockquote>There’s something called startup porn, and you can’t read too much, and listen too much, too many podcasts, you can’t replace action with consuming media about startups…</blockquote><p>而我在過去那幾年做的便是不斷地閱讀startup porn。為了給自己製造動力，我還曾經去廟裡拜拜，跟神明訂下目標，達到後就要去還願。我很虔誠嗎？我也不知道，但我想要迫使自己開始行動，最後好像也沒什麼成效。</p><p>但被裁員後的第二天，我便開始部署曾經做過的一個的<a href="https://cereo.io/">side project</a>，變得比有工作的時候更有效率。原來沒有正職工作是一個無法消耗的動力。</p><h3>跳脫舒適圈</h3><p>一個人獨立做產品等於一個人要擔下產品設計、銷售和行銷所有的工作。</p><p>對身為程序員的我來說，要在極短的時間內完成了產品的部署不是問題。我的產品<a href="https://cereo.io/">Cereo</a>，大概在兩個禮拜的時間內便上線了。但對於銷售、SEO、email campaign、content marketing我是一竅不通，一切從零開始。但三月初我給自己的目標是：放下手中的程式碼，專注在尋找使用者。</p><p>一開始我只在<a href="https://github.com/mmccaff/PlacesToPostYourStartup">各種關於新創公司和產品的網站</a>宣傳Cereo，每天盯著Google Analytics，希望網站的流量可以奇蹟的上升。但2020並不是一個build it and they will come的年代，我知道我的產品距離使用者還有一大段距離。</p><p>在行銷跟銷售方面我給自己設立了一些目標：</p><ul><li>每天找出10個潛在客戶並cold email他們</li><li>每天寫一篇關於Cereo的文章並轉貼到三個網站</li><li>每天找到三個網站宣傳Cereo</li></ul><p>一個禮拜下來我寄了不少cold email，回答了很多Quora questions（<a href="https://www.quora.com/What-is-the-best-way-to-learn-proper-Bug-Tracking/answer/Tammy-Chu-2">這裡</a>、<a href="https://www.quora.com/How-do-I-write-a-bug-report-that-will-make-developers-happy/answer/Tammy-Chu-2">這裡</a>、<a href="https://www.quora.com/Is-there-a-web-based-bug-tracking-tool-that-I-can-use-to-let-users-of-my-webapp-file-bugs/answer/Tammy-Chu-2">這裡</a>），交出了<a href="https://cereo.io/blog">三篇blog</a>。</p><h3>心情三溫暖</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEU3Onc1hdCuksXraUWE5A.jpeg" /><figcaption><a href="https://justineclay.com/wp-content/uploads/2017/03/the-life-of-an-entrepreneur-1024x636.jpg">source</a></figcaption></figure><p>剛開始寄email給潛在客戶的時候，心裡總是覺得不踏實。Email了幾個許久沒有聯絡的舊識，卻一點回音都沒有，讓我有一點沮喪。畢竟從才沒有做過銷售，再加上我的個性不是很喜歡自我推銷，一開始得失心有一點重。</p><p>寄了許多email後，我得到的第一個回應是</p><blockquote>we’re unable to proceed with your offer as this is not the point of focus for our team at this time.</blockquote><p>雖然被拒絕了，但我還蠻開心的，因為終於有人理我了！</p><p>統計下來大概20封emails左右會有一個人回應，當我收到第一個正面的回應時，才終於覺得「天啊，我不是瘋子，沒有浪費時間在一個沒用的產品上。」</p><blockquote>I’ve been waiting for a tool like this for quite some time!</blockquote><h3>總結</h3><p>成為全職的indiehacker已經將近兩個月，我終於瞭解這條路真的不簡單，但我還是打算給自己一段時間試試看。我現在要克服的問題是和</p><ul><li><strong>潛在客戶之間時差</strong>：相隔十小時才回應別人的email實在是很沒有效率</li><li><a href="https://medium.com/as-a-product-designer/%E7%82%BA%E4%BB%80%E9%BA%BC%E6%88%91%E7%84%A1%E6%B3%95%E5%9D%A6%E7%8E%87%E5%9C%B0%E6%93%81%E6%8A%B1%E6%88%90%E5%8A%9F-%E5%86%92%E7%89%8C%E8%80%85%E7%97%87%E5%80%99%E7%BE%A4-2c8520a2c710"><strong>冒牌者症候群</strong></a><strong>和得失心</strong>：如果這條路要走的長遠我必須要調整一下自己的心態</li></ul><p>最後工商服務一下，文內提到的產品Cereo是一個意見回饋和bug追蹤的工具，目前正式開放beta測試。</p><p><a href="https://cereo.io/">https://cereo.io</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*xo6KjJO-phfpYwqRDuiRGQ.png" /></figure><p>我之後也會在medium繼續分享心路歷程，有興趣的話可以持續關注。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f39da4bd966d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reselect source code — seeing closure and memoization in practice]]></title>
            <link>https://medium.com/cloudboost/reselect-source-code-seeing-closure-and-memoization-in-practice-8d12139cb756?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d12139cb756</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[memoization]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reselect]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Tue, 13 Aug 2019 04:21:13 GMT</pubDate>
            <atom:updated>2019-08-14T02:23:23.125Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YBjqq2mvulSqCmzD" /><figcaption>Source: <a href="https://unsplash.com/photos/s8HyIEe7lF0">unsplash</a></figcaption></figure><p>When I set out to optimize my react-redux app, I’ve gone through plenty of blog posts. Many of them mention using Reselect to improve performance by memoization. I’m a firm believer of <strong><em>learning to reinvent the wheel, but don’t reinvent it </em></strong>and decided to comb through Reselect’s source code to see memoization in practice (instead of only learning it for <a href="https://www.interviewcake.com/concept/java/memoization">interview prep</a>😅)</p><h4>Why Reselect</h4><p>In a react-redux app, components wrapped in connect function will run mapStateToProps after each dispatch. mapStateToProps calls selectors to compute new props. If the returned props have been updated, the connected components will be re-render. The problem is that selectors need to repeat the computations for every dispatch, which can be costly. Reselect to the rescue, Reselect makes use of an optimization technique called memoization. Wikipedia defines memoization as:</p><blockquote>an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.</blockquote><p>Reselect avoids re-computations by creating <strong>memoized selectors</strong>.</p><h4>How Reselect works</h4><p>Let’s look at an example to get started.</p><figure><img alt="An example of using Reselect" src="https://cdn-images-1.medium.com/max/1024/0*AD0VOL2pPr2h0P3M.png" /><figcaption>An example of using Reselect</figcaption></figure><p>The code above is taken from the Reselect documentation. createSelector creates a selector by taking an array of input selectors and a transform function as arguments. The selector uses input selectors to retrieve data from the redux store. It then calls transform function with the returned values of the input-selectors as arguments and outputs the result. Here’s where memoization comes into the picture:</p><blockquote>If the values of the input-selectors are the same as the previous call to the selector, it will return the previously computed value instead of calling the transform function.</blockquote><h4>Memoization in Reselect</h4><p>Reselect’s source code has only 108 lines so it’s not too difficult to understand.</p><h4>Memoizing one function</h4><figure><img alt="Default memoization in Reselect" src="https://cdn-images-1.medium.com/max/1024/0*UXjVOHCaQSA807H7.png" /><figcaption>Default memoization in Reselect</figcaption></figure><p>The code above is an implementation of memoizing a function. It’s taken from the Reselect library. Upon receiving the same set of arguments, a memoized function will return the previously computed value without re-computation.</p><p>In line 6, areArgumentsShallowEqual checks whether the same arguments occur again. If so, the function simply returns the cached result. If not, the function will re-compute and cache the updated value.</p><p>The code makes use of an important Javascript concept to achieve memoization — closure.</p><h4>Closure</h4><p>The key to memorization is storing the last inputs and output. This is done by closure. If you‘re not familiar with closure, I recommend reading this article:</p><p><a href="https://medium.com/@PurpleGreenLemon/understanding-closures-in-javascript-in-3-minutes-557ebb8a215b">Understanding Closures in JavaScript</a></p><p>If all you need is a quick refresher, here’s the story. A closure is the combination of a function and its surrounding lexical scopes. A closure is created whenever a function is created. If there is a function enclosed by another, the outer function will return an instance of the inner function. The returned function will be given access to all the variables of the outer function. The closure will keep references to the outer function’s variables. This makes closures particularly useful because we can use them to preserve data after a function call.</p><p>In the case of Reselect, defaultMemoize is a higher-order function that has two variables set up: lastArgs and lastResult. The variables serve as caches with a limit of one. A closure is created when defaultMemoize returns an instance of the inner function. Through closure, the inner function keeps a reference to the scope of defaultMemoize so that it can make use of lastArgs and lastResult for shallow comparison.</p><h4>Memoization in Reselect</h4><p>Recall that createSelector takes in an array of input selectors and a transform function, selectors compare the values return from input selectors and determine whether to update the derived value with the transform function.</p><figure><img alt="createSelector - the out-of-box API of Reselect" src="https://cdn-images-1.medium.com/max/1024/0*HTksezWAVJXg7dGT.png" /><figcaption>createSelector — the out-of-box API of Reselect</figcaption></figure><p>The code above is the implementation of createSelector. This default API is created by invoking createSelectorCreator with defaultMemoize we examine earlier.createSelectorCreator lets us customize and create our own version of createSelector. For example, we can write a new memoize function that uses deep equality check instead of a shallow one.</p><p>Let’s take a closer look at createSelector, the returned function of createSelectorCreator.</p><p>In lines 4 and 5, the arguments are separated into resultFunc and dependencies by popping the stack. resultFunc is the transform function while dependencies are the input selectors. getDependencies checks the types of input selectors, making sure they are functions.</p><p>createSelector memoizes two functions internally.</p><p>The first memoized function is resultFunc as seen from line 7 to 14. The input arguments of resultFunc are the returned values of input selectors. With this layer of optimization, resultFunc a.k.a the transform function returns the previously computed value if and only if the return values of input selectors have changed.</p><p>From line 17 to 28, there is a second memoized function: selector, the function returned from createSelector and re-used throughout our application. The input arguments of selector are state or props. If a selector is called with the same state or props, we don’t want to traverse input selectors and invoke the transform function again. This offers another layer of optimization.</p><h4>That’s it!</h4><p>Hope you have a better understanding of memoization, closure, and Reselect.</p><p>If you found this article helpful, I’d appreciate if you hold down the clap button 👏 for a bit. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d12139cb756" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudboost/reselect-source-code-seeing-closure-and-memoization-in-practice-8d12139cb756">Reselect source code — seeing closure and memoization in practice</a> was originally published in <a href="https://medium.com/cloudboost">CloudBoost</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/@tctammychu/%E5%AD%B8%E7%A8%8B%E5%BC%8F%E9%80%99%E4%BB%B6%E4%BA%8B-%E5%88%9D%E5%AD%B8-%E4%B8%8A%E5%AD%B8-%E5%86%8D%E8%87%AA%E5%AD%B8-d79af4f63e62?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d79af4f63e62</guid>
            <category><![CDATA[心得]]></category>
            <category><![CDATA[學習]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[程式設計]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Wed, 31 Jul 2019 04:59:08 GMT</pubDate>
            <atom:updated>2019-07-31T07:54:58.171Z</atom:updated>
            <content:encoded><![CDATA[<h4>軟體工程師回顧自己怎麼開始學程式好像是種流行。</h4><p>我現在就職於紐約的一家軟體公司，自己選擇在台北遠距工作。我是非本科出身的，但在國外上過私立程式學店（bootcamp），這一篇是分享與回顧自己的程式之路，希望可以鼓勵到大家，讓想學程式的人有一點頭緒。</p><figure><img alt="學程式這件事 — 初學、上學、再自學" src="https://cdn-images-1.medium.com/max/1024/0*sVYwPPVlJy_UBUtE.jpg" /><figcaption>Photographer: <a href="https://unsplash.com/@emilep">Émile Perron</a> | Source: <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>我大學唸的是醫療工程主攻電機，碩士轉念電機系。從小到大自認喜歡研究和創造，所以選擇了理工科。上大學後這份熱情慢慢地消耗殆盡，我意識到生技業產品的週期動輒好幾年，未來如果投入這個產業不是當業務、顧問，就是泡在實驗室裏。這時我對程式的認知來自 C 語言和學界常用的數學軟體 MATLAB，而寫程式的目的就是做資料分析、視覺化或模擬。MATLAB 用起來還蠻上手的，至於 C 只在一堂電機系的計算方法課碰過，寫過幾個數學的小程式，那時候覺得寫程式也太無聊了吧。</p><h4><strong>學程式初嚐成果</strong></h4><p>剛好大三拿了一堂關於計算機組織（Computer Organization And Architecture）的課，期末作品和一個資訊科學系的同學一組，用硬體描述語言 Verilog 寫了一個小遊戲。我寫程式的目的開始改變，我想要做出有趣的東西，遊戲、app、網站這種看得見摸得著的成品。我開始自己摸索，學了一點 HTML、CSS、jQuery 和 Javascript。電腦打一打瀏覽器馬上看到的成果，我覺得頗有成就感，後來就用學校的資源通過 FTP 發布了自己的網站，內容就是美化過的履歷，還考慮到網站的 responsiveness。網站上線後我還蠻得意的，拿手機、iPad、筆電到處秀給別人看，但現在回顧其實整個網站都是 Photoshop 排版完成的圖片，一點技術都沒有。</p><h4><strong>撞牆期</strong></h4><p>當我想要繼續寫下去，面對五花八門的資源，卻沒有頭緒。我開始效仿資訊科學系的朋友，學 Java、Python，練習資料結構和演算法，但怎麼好像離我想做的東西越來越遠。tuts+和Udemy 上買了一堆各式各樣的課程，有時候在環境配置時因為版本變更就跟不上了，課程跟上了想要自己實作還是什麼都做不出來。我甚至開始在程式語言上鑽牛角尖，找到了 Learn Python the hard way 這本書，從頭到尾做了一遍還是覺得什麼收穫都沒有。</p><h4><strong>決定加入 Bootcamp</strong></h4><p>好加在這樣亂衝亂撞也沒消磨我想成為碼農的熱情 XD</p><p>我在念碩士時，身邊一些念設計的朋友早就畢業有些工作經驗，工作之餘開始接案，甚至有些直接在家裡自己接案。我很羨慕他們，心想如果做得出自己的作品，有寫程式這個一技之長，有天我也能達到這樣的工作型態。</p><p>這大概是三、四年前的事了，Programming bootcamp 那時候在美國正值炒作週期的頂端，業界大家都還在爭 bootcamp 到底有沒有用，但可以確定的是有不少頂尖 bootcamp 的學生進入了矽谷的 Big Five。因為畢業在即有點焦慮，我報名了幾家比較有聲望的 bootcamp，為了學程式橫跨北美，從西岸搬到東岸。我進了紐約的 Fullstack Academy of Code，前端使用 AngularJS（2016年中，我上到了最後一期 AngularJS，之後都是教 React ），後端使用Node.js和Express，資料庫學 PostgreSQL 和 ORM。除此之外，學校也會加資訊科學的基礎，像資料結構、演算法、Big-O 等等。每個禮拜六更是空出來學一些資訊科學的應用，還會通過 javascript 的 workshop 來演示，例如學 git 的原理時，我們便用 javascript 寫了一個簡單的 git 程式。</p><p>我每天早上八點出門，五點回家，回家後繼續盯著電腦，一個禮拜上六天的課。身旁是各式各樣的人，有健身房業務、大公司的顧問、法務秘書、行銷人、金融分析師。我這一班因為是暑期開課，還夾雜著參加 Summer of Code 的學生，他們都是資訊科學系的學生，學校教理論與架構，趁暑假特別來這裡學習實作。每個人都很有熱誠和目標，不少人五點下課後還繼續待在教室自學，當下我覺得自己這輩子再也不會被這麼多聰明人環繞了。</p><h4><strong>衝刺期</strong></h4><p>Bootcamp 的好處是課綱有系統地由簡單到難，還可以累積自己的 Portfolio。由老師上課點題，接者鼓勵學生自己解決問題，我自己認為這成長的過程本身就是一個迴圈：</p><ul><li>了解概念</li><li>實作解題，包括google、嘗試、debug</li><li>歸納整理</li><li>重新來過</li></ul><p>每次學到的東西會一點一點納入自己的工具箱，下一次遇到問題時雖然還是要經歷一樣的過程，但可能有個頭緒、知道怎麼切入這個問題。Bootcamp 提供了老師和助教這層安全網，讓你不至於在這個迴圈裡卡住。當你卡關時，他們會用引導的方式，把你導到可行的路上。每次聽完學生發問，老師跟助教的反應幾乎都是反問：「你可以告訴我，帶入數值，你的函數會怎麼執行？」程式腦就是在這樣一次又一次的自言自語累積下來的，久而久之會變成一種直覺。</p><p>好的課程安排不只讓學生學會使用各種套件框架，還會讓學生理解為什麼是這麼做的。我們在學完前端基礎和 ajax 原理的時候曾做過一個小作業，用HTML、CSS、Javascript、jQuery 和 Google Map 的 API 做一個安排行程的 web app（<a href="https://trip-planner-nyc.herokuapp.com/">原作品還留在這丟臉</a>）。這不是什麼了不起的 app 卻讓所有人都叫苦連天，還是新手的我們怎麼會知道如何有效地維持 application state，結果所有人寫出來的都是 spaghetti code，還在納悶這麼小的 app 都寫的亂七八糟，大型專案到底是怎麼做成的。</p><p>當神人老師向大家展示他運用Javascript 物件的解法，並解釋這樣的組織怎麼有效率，又怎麼樣可以演變成一個框架，我們才恍然大悟。物件大家都有學，怎麼就沒想到這樣的應用。要自己經歷過，才會留下深刻的印象，關於這點我最近一直在關注的教學者Huli在他<a href="https://medium.com/hulis-blog/there-is-no-magic-in-my-classroom-4926b67c06f5">這篇文章</a>中說到：</p><blockquote><em>為什麼會有那麼多套件出現？就是因為有一大堆前輩經歷過種種磨難以後，決定造福世人也造福自己，才產生了這些方便又好用的套件。</em></blockquote><blockquote><em>那為什麼前輩都決定要造福世人了，我卻一再提倡大家繼續受苦？</em></blockquote><blockquote><em>因為這是成長必經的過程。</em></blockquote><p>經過了一個半月的密集學習網頁前後端的知識，後一個半月便是開始做 project，藉此整合所學到的知識。</p><ul><li>電商網站</li><li>週末黑客松</li><li>Final Project</li></ul><p>第一個 project 是四人一組架構一個電商網站，就讓我們徹底地複習了全端的運作。從資料庫到 API，從前端套 AngularJS 到 Digital Ocean 的部署，全部包辦。經過一個半月的修煉，大家不再是無頭蒼蠅，可以做出一個有前端有後端的網頁。更重要的是，我學會了遇到問題時怎麼找答案。</p><figure><img alt="保可夢的電商網站" src="https://cdn-images-1.medium.com/max/1024/0*_KEq-uFd5uFe-mzw.png" /><figcaption>因為Pokemon Go正紅所以決定賣Pokemon</figcaption></figure><h4><strong>放手去做才會開竅</strong></h4><p>週末黑客松是最讓我印象深刻，發覺自己真的開竅了的一個 project。我發現自己可以：</p><ul><li>從無到有架起全端網站</li><li>透過教學和官方文件學習，使用新的工具</li><li>調適身為初學者的心態</li></ul><p>黑客松這個 project 是以兩人一組，用三天的時間做出一個<a href="https://threed-shaft.herokuapp.com/">成品</a>。我看了一個 three.js 小遊戲的<a href="https://tympanus.net/codrops/2016/04/26/the-aviator-animating-basic-3d-scene-threejs/">教學</a>，正躍躍欲試，便和組員決定要用 three.js 還原小時候的經典遊戲 — 小朋友下樓梯。</p><figure><img alt="小朋友下樓梯" src="https://cdn-images-1.medium.com/max/651/0*7MdYm9t5oq4JVWQw.png" /><figcaption>經典的小朋友下樓梯</figcaption></figure><p>面對空白的視窗，我們也沒有多想，只是想先做出方塊試試看。做出來了，那不如把方塊當作玩家，那要怎麼移動方塊呢？既然方塊做得出，做長方形的平台的也沒問題。</p><p>當下沒有意識到，但其實我們不斷的定義問題，然後再嘗試著解決問題，最後就做出了一個遊戲。</p><p>這段經歷算是肯定自己自學的能力。學新的事物沒有捷徑，做就對了。</p><h4>小結</h4><p>其實還有很多可以寫的，像是Bootcamp值不值得、後來面試的經驗（當頭棒喝的經驗）、工作時犯下的大錯等等，這些還是留到以後再說，這篇流水帳還是在這裡先做個小結。</p><p>我曾經覺得自己寫程式這條路走得很曲折，其實我在大一選系時就曾經想選資訊科學，看著我科班出身的朋友走在直直的路上，大二、大三實習，大四開始面試，畢業後不是進 Big Five 就是讓人嚮往的新創公司，而我還在原地繞圈圈。</p><p>我沒有選資訊科學系是因為有大人跟我分析軟體業的日新月異，和其他行業不一樣，經驗累積不易。因為這樣就打退堂鼓，也許我那時也還不適合走上這條路。現在來回顧，我很珍惜自己的經驗，深刻的體會到走這條路永遠都會是初學者。既然是永遠的初學者，不如習慣這未知和不安。我說的是習慣而不是克服，因為我深知這很難，<a href="https://medium.com/as-a-product-designer/%E7%82%BA%E4%BB%80%E9%BA%BC%E6%88%91%E7%84%A1%E6%B3%95%E5%9D%A6%E7%8E%87%E5%9C%B0%E6%93%81%E6%8A%B1%E6%88%90%E5%8A%9F-%E5%86%92%E7%89%8C%E8%80%85%E7%97%87%E5%80%99%E7%BE%A4-2c8520a2c710">冒牌者症候群</a>在科技圈也是很常見的。寫程式也有三年了，對此我還是沒有個解法，但大家都一樣，與其質疑自己，不如繼續走下去。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d79af4f63e62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s guide to react/redux —painting a mental model]]></title>
            <link>https://medium.com/cloudboost/beginners-guide-to-react-redux-painting-a-mental-model-ed0279d55836?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed0279d55836</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 17:37:01 GMT</pubDate>
            <atom:updated>2017-08-31T14:31:39.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*XgB-Sjd4ZuwQgvxLijnnDw.gif" /><figcaption>Source: <a href="http://gph.is/1GhDD0S">http://gph.is/1GhDD0S</a></figcaption></figure><p><em>Disclaimer: This article is written by a beginner trying to comb through new concepts she just learned.</em></p><p>React/Redux is the hottest frontend frameworks these day. If you google the term Redux diagram, and this is what you get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*weRO6TiS7NPHaFv76nq9iA.png" /><figcaption>Google Search Results</figcaption></figure><p>As someone who just finished reading up on React and wanted to learn more about Redux, this was how I felt when I saw the search results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*xa3m__kOc7L3nRU5O1Csfg.gif" /><figcaption>Source: <a href="http://gph.is/1aEPqjq">http://gph.is/1aEPqjq</a></figcaption></figure><p>I think one of the obstacles with understanding Redux is the terms like reducers, actions, and thunks. I highly recommend anyone starting out with Redux to read the core concepts outlined in the official documentation.</p><p><a href="http://redux.js.org/docs/introduction/CoreConcepts.html">Core Concepts · Redux</a></p><p>Long story short, Redux application has <strong>a plain object</strong>, known as store, which serves as data model for your app. This object can be composed by a series of smaller object, known as state. For example, for a list of articles, I can have an article state that looks like this:</p><pre>state = {<br>  articles: [{<br>      &quot;id&quot;: 314,<br>      &quot;title&quot;: &quot;6 innovative apps utilizing the ethereum network&quot;,<br>      &quot;source&quot;: &quot;Investopedia‎&quot;,<br>      &quot;link&quot;: &quot;<a href="http://www.investopedia.com/news/6-innovative-apps-utilizing-ethereum-network/">http://www.investopedia.com/news/6-innovative.</a>..&quot;,<br>      &quot;date&quot;: &quot;1500523200&quot;,<br>      &quot;type&quot;: &quot;msm&quot;<br>    },<br>    {<br>      &quot;id&quot;: 893,<br>      &quot;title&quot;: &quot;what is plasma and how will it strengthen...&quot;,<br>      &quot;source&quot;: &quot;Investopedia‎&quot;,<br>      &quot;link&quot;: &quot;<a href="http://www.investopedia.com/news/what-plasma-and-how-will-it-strengthen-ethereum-blockchain/">http://www.investopedia.com/news/what-plasma-and.</a>..&quot;,<br>      &quot;date&quot;: &quot;1502856000&quot;,<br>      &quot;type&quot;: &quot;msm&quot;<br>    },..]<br>}</pre><p>The store is going to be the same since there’s only one state at this point. If we add more states to our application, the store object will have more key value pairs.</p><p>We have our store object. Unlike objects you encounter in Object Oriented Programming, the store has no setter. This is by design so that different parts of code can not change the store arbitrarily. The store is the single source of truth in our application so we guard it carefully.</p><p>To change the state and store, we dispatch actions. Actions are really just plain objects. In our article example, fetching articles is an action that looks that this:</p><pre>{ type: &#39;ARTICLES_FETCHED&#39;, <br>  payload: [{<br>      &quot;id&quot;: 314,<br>      &quot;title&quot;: &quot;6 innovative apps utilizing the ethereum network&quot;,<br>      &quot;source&quot;: &quot;Investopedia‎&quot;,<br>      &quot;link&quot;: &quot;<a href="http://www.investopedia.com/news/6-innovative-apps-utilizing-ethereum-network/">http://www.investopedia.com/news/6-innovative.</a>..&quot;,<br>      &quot;date&quot;: &quot;1500523200&quot;,<br>      &quot;type&quot;: &quot;msm&quot;<br>    },<br>    {<br>      &quot;id&quot;: 893,<br>      &quot;title&quot;: &quot;what is plasma and how will it strengthen...&quot;,<br>      &quot;source&quot;: &quot;Investopedia‎&quot;,<br>      &quot;link&quot;: &quot;<a href="http://www.investopedia.com/news/what-plasma-and-how-will-it-strengthen-ethereum-blockchain/">http://www.investopedia.com/news/what-plasma-and.</a>..&quot;,<br>      &quot;date&quot;: &quot;1502856000&quot;,<br>      &quot;type&quot;: &quot;msm&quot;<br>    },..] <br>}</pre><p>Action usually has these two properties: type and payload. A typical pattern in Redux application is dispatching an action with fetched data after an asynchronous call to the server.</p><p>And last but not least, reducers tie states and actions to together. It’s just a pure function with a switch statement that checks the action type and return new state of the app. In our article example, the reducer looks like this:</p><pre>const initialState = {<br>  articlesById: null,<br>}</pre><pre>export default function(state = initialState, action) {<br>  switch (action.type) {<br>    case types.ARTICLES_FETCHED:<br>      return {<br>        ...state,<br>        articlesById: action.articlesById<br>      }<br>    default:<br>      return initialState<br>  }<br>}</pre><p>To summarize the basic ideas of Redux:</p><ul><li>it describes state as plain objects, and store (global state) by merging all the states in your app.</li><li>it describes changes to the app as plain objects.</li><li>it uses pure functions to handle changes.</li></ul><p>The redux API then bridges your redux logics with react views while providing some utilities to compose states.</p><p>Say we send a request to a remote server and fetch some articles. We dispatch ARTICLE_FETCHED action. The reducer evaluates the action and store the payload articles in the state. What now?</p><p>After the state changes, we need to render the view. We need to somehow <strong><em>connect</em></strong> the store to the component. This is done with a function provided by react-redux library called connect.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70754d66c21140dd2aba2951c13580e1/href">https://medium.com/media/70754d66c21140dd2aba2951c13580e1/href</a></iframe><p>Consider the code above, the connect function takes in a function called mapStateToProps that returns an object with keys. The keys is going to be mapped to the props of the component. Now let’s bring back some diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rh5Mc8-xWkrEascbRs8JUw.png" /></figure><p>The connect function takes in two functions called mapStateToProps and mapDispatchToProps. mapStateToProps and mapDispatchToProps in the connect closure are granted access to Redux state and dispatch. The connect function acts as an API between Redux and React. The data flow under React/Redux architecture looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*PQpPe5iqvTsTsKByIB-0Uw.png" /></figure><p>I just introduced the essential concepts that helped me building my first React/Redux app. There are much more to the Redux architecture, like middleware, thunks and selectors. I encourage you to read about them in the Redux documentation.</p><p>If you want a walk through of these concepts with a real life implementation, check out my step-by-step tutorial here:</p><p><a href="https://medium.com/@tctammychu/beginners-guide-to-react-redux-how-to-start-learning-and-not-be-overwhelmed-af04353101e">Beginner’s guide to react/redux — how to start learning and not be overwhelmed</a></p><p>Thank you for reading!</p><p>If you’re on Steemit, the blockchain social media (kind of like the love child of Reddit and Medium), drop by here:</p><p><a href="https://steemit.com/technology/@ytienchu/web-dev-beginner-s-guide-to-react-redux-painting-a-mental-model">[Web dev] Beginner&#39;s guide to react/redux -  painting a mental model - Steemit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed0279d55836" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudboost/beginners-guide-to-react-redux-painting-a-mental-model-ed0279d55836">Beginner’s guide to react/redux —painting a mental model</a> was originally published in <a href="https://medium.com/cloudboost">CloudBoost</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s guide to react/redux — how to start learning and not be overwhelmed]]></title>
            <link>https://medium.com/netscape/beginners-guide-to-react-redux-how-to-start-learning-and-not-be-overwhelmed-af04353101e?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/af04353101e</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 17:35:56 GMT</pubDate>
            <atom:updated>2017-08-31T16:13:33.683Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x2gUD6BhNjkF7ac4UEwg5Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/5mZ_M06Fc9g?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Roman Mager</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><em>Disclaimer: This is a beginner’s guide written by a React/Redux beginner.</em></p><p>Learning a new Javascript framework in 2017 can be a daunting task. Say you finally caught up with Angular, but everyone has moved on to this shiny new thing called React. You read a couple of tutorials and can’t wait to configure your new React project. Wait, there’s another article saying that your should use Redux to manage state for your new app. Beginners can all relate to this article. I consider myself an intermediate dev and I still feel this way.</p><p><a href="https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f">How it feels to learn JavaScript in 2016</a></p><p>When I tried to start my React/Redux project, I browse through countless articles about how to structure my file directory: files grouped by type, grouped by components, grouped by domain…etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*d7IbMGQ69JCCtmC7tD_KGg.gif" /><figcaption>source: <a href="http://gph.is/2k9DFT4">http://gph.is/2k9DFT4</a></figcaption></figure><p>I realized that I had to start somewhere. The aha moment would come later. In the process, I would understand the pros and cons of each approach. It may be followed by a painful refactoring, but it’s going to be a valuable lesson learned. And I was building to learn anyways.</p><h4>Step 1: Pick an opinionated approach and stick with it</h4><p>I followed this tutorial.</p><p><a href="https://hackernoon.com/redux-step-by-step-a-simple-and-robust-workflow-for-real-life-apps-1fdf7df46092">Redux Step by Step: A Simple and Robust Workflow for Real Life Apps</a></p><p>My learning approach was to start coding up my own app by following the author’s thought process. I find the article to be one of the most helpful tutorials out there. It can still be too much for someone starting out in React/Redux so I documented my journey and made it into a trimmed-down version of the tutorial.</p><h4>Step 2: Start small</h4><p>My goal was really simple at the beginning: render a list of articles I’ve been collecting with a news aggregator app. The response from the news database is going be a collection of articles with the following data structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B93Y7PL1RJ_mj5qyqeV2NA.jpeg" /><figcaption>Render a list of articles about Ethereum</figcaption></figure><h4>Step 3: Pick a boilerplate</h4><p>I used the boilerplate created by my lovely instructors at Fullstack Academy.(I didn’t catch the React/Redux train there. My cohort is the last one learning AngularJS) I chose this boilerplate because it uses fullstack javascript: React/Redux for the front end and Express/Sequelize/PostgreSQL for the backend. For the purpose of this exercise, I’ve cleaned up the boilerplate a little bit for people without Express/Sequelize/PostgreSQL to follow along. We’ll only be working with React/Redux from now on.</p><p>Here’s the repo containing the starting point and finished code for this exercise.</p><p><a href="https://github.com/penmon/react-workshop">penmon/react-workshop</a></p><p>This is the file structure.</p><pre>src/<br>  components/    <br>    ListView.js<br>    ListRow.js<br>  containers/<br>    ArticlesIndex.js<br>  services/<br>    articles.js<br>  store/<br>    articles/<br>      actions.js<br>      actionTypes.js<br>      reducer.js<br>    index.js</pre><p>Before you follow along this tutorial, if terms like action and reducer don’t ring any bell, I highly recommend you read through the core concept in the official Redux documentation or the article I wrote:</p><p><a href="https://medium.com/@tctammychu/beginners-guide-to-react-redux-painting-a-mental-model-ed0279d55836">Beginner’s guide to react/redux —painting a mental model</a></p><h4>Step 4: Start with Redux state</h4><p>What state does our app have? We’re talking about a simple one-page app with a list of articles. We need to store the list of articles retrieved from the server. If you take a look at the <em>articles.js</em> in <em>src/services/articles, </em>you’ll see an array populated with articles. Since the purpose of this exercise is to get familiar with the data flow of React/Redux architecture, the <em>getAllArticles() </em>function directly returns the articles we need. In the real world, this function is going to be a asynchronous call to some remote API.</p><p>Now the question is how to structure our state. The response from server (or in this case, the <em>getAllArticles</em> function) is an array of objects. We can put it in our state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1cf6cfde9ddfbb3120009d38d72e62b/href">https://medium.com/media/c1cf6cfde9ddfbb3120009d38d72e62b/href</a></iframe><p>But is this the best way to model state? Consider the scenario where to you have to update an article entry, the app is going to iterate through the array to find the news you’re looking for. What if the array size is really big? This approach is not going to be very performant.</p><p>If we structure our state with an object, accessing an article becomes a lookup. To render articles, we can store an additional array of ids.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f37ea40727ddda8aa0242be77b83d63/href">https://medium.com/media/4f37ea40727ddda8aa0242be77b83d63/href</a></iframe><h4>Step 5: Implement the data flow for your state from start to finish</h4><p>How do we update this state? This is where action and reducer come in. Consider this flow chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*PQpPe5iqvTsTsKByIB-0Uw.png" /></figure><p>What’s our <em>user interaction</em>? We want to render the list of articles upon page load so it’s not much of an interaction. To do this, we start with <em>componentDidMount</em> in React view. We can dispatch an action to retrieve articles and notify the reducer. The reducer will evaluate the action and update the state. The updated state will trigger the component to render.</p><p>Let’s start by defining the type of actions our app has. It’s a simple constant definition for fetching articles. Later on we can always add more definitions, like updating an entry or deleting an entry.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6eca98c488cb9f0b673eef72e9308093/href">https://medium.com/media/6eca98c488cb9f0b673eef72e9308093/href</a></iframe><p>Now let’s get to the action. Remember that the response we get from the backend is an array of object, we turn it into an object using the lodash function <em>keyBy</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b857f85218e9d19d013ad07a1b4fa0a/href">https://medium.com/media/1b857f85218e9d19d013ad07a1b4fa0a/href</a></iframe><p>The reducer evaluates the plain object containing the type of action and its payload. It then store the data in the state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/855b55a37000c07811a77924077cdd10/href">https://medium.com/media/855b55a37000c07811a77924077cdd10/href</a></iframe><h4>Step 6: Render</h4><p>We are going to connect a container called <em>ArticleIndex</em> to the article state. <em>AritcleIndex</em> is a smart container that can communicate with the Redux store. Inside ArticleIndex, there is a dumb component called <em>ListView</em>, written by Tal Kol, the author of the Redux tutorial I followed. You can checkout the implementation in the <em>components</em> folder.</p><p><em>ListView</em> takes the <em>articlesById</em>, an array of article ids and a render function. It then renders the list of articles.</p><p>How do we get articlesById and an array of article ids to view? Here’s a review of Redux core concept. React view is connected to Redux state through the <em>connect</em> function provided by <em>react-redux </em>library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rh5Mc8-xWkrEascbRs8JUw.png" /></figure><p>Here’s the code that does what this diagram describes. At the bottom of it, we map Redux state and dispatch to React <em>props. </em>In componentDidMount, we invoke the <em>loadArticles</em>, which dispatches the <em>fetchAllArticles</em> action. After the state is updated with articles, <em>articlesById </em>is passed to React view by <em>mapStateToProps.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b11914857746a5c98b5d08dc938660e/href">https://medium.com/media/1b11914857746a5c98b5d08dc938660e/href</a></iframe><p>And that’s it! We have a list of articles in our browser!</p><h4>Step 7: Anti-pattern somewhere in the code?</h4><p>For the sake of learning data flow in React/Redux, we’ve overlooked another Redux concept so far. React component should access Redux state through selectors. Selectors are usually located in <em>reducer.js </em>files. They are pure functions that access Redux state and return some state properties. With selectors in place, if you alter one of your Redux state that affects more than one component, you only need to update the selector.</p><p>Here’s our getArticles selector:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11eb099f711ecc1b153a4e9606e22803/href">https://medium.com/media/11eb099f711ecc1b153a4e9606e22803/href</a></iframe><p>The <em>mapStateToProps</em> function in ArticleIndex.js becomes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1234928e6194431c0eed90dca67d7ea/href">https://medium.com/media/b1234928e6194431c0eed90dca67d7ea/href</a></iframe><h4>Bonus: Follow the same thought process and build a filter</h4><p>With a list of articles, we can add a bunch of different operations. For example, the articles are all news about Ethereum. They are categorized into two type: news from cryptocurrency community and news from mainstream media. After rendering the list of articles, I added a type filter using the same thought process.</p><h4><strong>Rinse, Repeat, Refactor</strong></h4><p>Learning React/Redux is like jumping into a rabbit hole, but it has changed me from a skeptic into a believer. I hope this article will jumpstart your learning.</p><p>From the initial baby step, my learning project has turned into a news aggregator and trends tracking app!</p><p><a href="http://www.cryptocurrent.co/eth">CryptoCurrent - google trends meet cryptocurrencies</a></p><p>Thank you for reading!</p><p>If you’re on Steemit, the blockchain social media (kind of like the love child of Reddit and Medium), drop by here:</p><p><a href="https://steemit.com/technology/@ytienchu/web-dev-beginner-s-guide-to-react-redux-how-to-start-learning-and-not-be-overwhelmed">[Web dev] Beginner&#39;s guide to react/redux -  how to start learning and not be overwhelmed - Steemit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af04353101e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/netscape/beginners-guide-to-react-redux-how-to-start-learning-and-not-be-overwhelmed-af04353101e">Beginner’s guide to react/redux — how to start learning and not be overwhelmed</a> was originally published in <a href="https://medium.com/netscape">Netscape</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping out managerial social networks in shipping industry]]></title>
            <link>https://medium.com/@tctammychu/mapping-out-managerial-social-networks-in-shipping-industry-3dcfcdeb5c2e?source=rss-d22f7961d3dc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dcfcdeb5c2e</guid>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[prototyping]]></category>
            <dc:creator><![CDATA[Tammy Chu]]></dc:creator>
            <pubDate>Tue, 13 Jun 2017 17:27:29 GMT</pubDate>
            <atom:updated>2017-06-13T17:27:29.200Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mapping social networks in the shipping industry</h3><p>Iterative prototyping with the power of Javascript and D3.js</p><p><a href="https://www.penmon.com/">Penmon</a> recently partnered with Wells Fargo on a <a href="http://webcache.googleusercontent.com/search?q=cache:r07m7JbtYh0J:www.tradewindsnews.com/finance/1261666/webber-shines-searchlight-into-shippings-boardrooms+&amp;cd=1&amp;hl=en&amp;ct=clnk&amp;gl=us">report</a> about the maritime shipping industry. At the center of the report is a “corporate governance scorecard” for 52 companies, ranking how well or poorly companies are directed and controlled. <a href="https://ssrn.com/abstract=278920">Academic research</a> has established a link between corporate governance and the long-term performance of companies. One corporate governance factor that stirs up a lot of controversy is the <strong>interlocking directorate.</strong> A <a href="https://ssrn.com/abstract=1651407">Stanford study</a> shows that companies with a well-connected board have greater future operating performance and higher future stock price returns than companies whose boards are less connected. An interlocking directorate occurs when:</p><blockquote>“An executive of Firm A sits on the board of Firm B while an executive of Firm B sits on the board of Firm A. ”</blockquote><p>This practice is widespread, enabling information to be shared between boards via insiders. In many industries, these connections form organically based on a manager’s social network. Advantages of this social network includes the exchange of industry practices, knowledge and relationships. Network effects can be an important avenue for client and supplier referrals, talent sourcing, capital, and political connections, but <strong>the downside of having highly connected directors is the increased risk of conflicts of interests</strong>. By serving two companies at the same time (sometimes competitors), a director may have loyalties that clash.</p><p>We have always been interested in the implications of such a network on the corporate governance of companies, and have prototyped a few visualization features for extracting insights from connections. The partnership with Wells Fargo gave us a chance to continue our work and map out connections on a larger scale. I’m going to share with you the process of iterative prototyping to reach our final product.</p><h3>Director Connections</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gUwoQebbfIUxc1A_to_i2w.gif" /></figure><p>We started last year by visualizing individual director’s connections. Here we have a force-directed chart (built using the d3 javascript library) to visualize Bill Gates’ board memberships. <strong>A node represents director, and a link represents a company that connects two directors.</strong> In the above example, the red node represents Gates. The green nodes represent directors who have served on the same board as him (Microsoft and Berkshire Hathaway). We call these directors Gates’ <strong>first-degree connections</strong>. The light green nodes represent directors who have been on the same board with Gates’ first degree connected directors. These directors are typically referred to as <strong>second-degree connections</strong>. You’re probably already familiar with these definitions if you have ever used LinkedIn. Bill Gates could be introduced to his second degree connections through his colleagues on the board.</p><p>On the left of the graph, there’s the board of Berkshire Hathaway; On the end, there’s the board of Microsoft. The visualization certainly contains useful and interesting information about directors, but it becomes difficult to navigate once we add more interlocking connections, let alone generating insights.</p><h3>Company connections</h3><p>In the second iteration, we made the visualization easier to navigate. <em>By combining the power of D3.js and Javascript, you can do wonders.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NdP3zfpt7R03_xPU3uYZ0g.jpeg" /><figcaption>Company network of US fast food restaurants</figcaption></figure><p><strong>We flipped the definitions of a link and a node. Node represents company, and link represents director that bridges two companies.</strong> User can narrow down search with a list of companies of interest (shown on the left hand side). Blue nodes are the companies of interest and grey nodes are connected companies. Let’s take a closer look at the network of US fast food restaurants. McDonald’s and Yum! Brand are connected via Robert Walter and Enrique Hernandez. Both of them are directors at Nordstrom. This means that on one day, they are colleagues at Nordstrom, but on another day, they are competitors in restaurant industry.</p><p>We’ve used this visualization to investigate connections in many industries, and it worked. When we started mapping out connections in shipping industry, we thought we could just feed data into our existing codebase.</p><p>And this happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4d_yKl9pJZpmAALI5r56Q.png" /><figcaption>Shipping industry connections</figcaption></figure><h3>Industry connections</h3><p>Mapping an entire industry is a different matter. Our dataset consists of directors from 52 shipping companies. The amount of data is too much to fit into browser window and to navigate. At Penmon, we use open-source technology to power our app. We scoured stack overflow and d3 gallery looking for examples that would form a sensible graph. In the end, we came across a<a href="http://bl.ocks.org/christophermanning/4208494"> spherical force directed graph</a>. We liked the idea of projecting data points to a globe, a shipping universe with tightly knitted networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGLoXfC9fc95wTSPAXte5A.jpeg" /><figcaption>Data sketches of shipping industry connections</figcaption></figure><p>We didn’t know what kind of visualization the data was going to give, so we prototyped with code. The sphere on the left was the first result. A <strong>node represents a director, and a link represents the company that connects two directors. </strong>As you can see, there’s no significant signal in the network besides some tangled clusters. We played with d3 scaleLinear() function to add signals over noises. The sphere on the right hand side was our second visualization attempt. <strong>The blue gradient of node tells how connected a director is and the grey gradient of link signals how many first degree connections two directors share.</strong></p><p>Now you can spot groups of connected directors. For example, the highlighted network below are directors from Teekay Lng Partners LP, Teekay Offshore Partners LP, and Teekay Tankers LTD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*aPBTKZCrNx2iiOPMFl5WyA.jpeg" /><figcaption>Network of Teekay Partners</figcaption></figure><p>At this point, we liked the potential of this visualization so much that we decided to carry on with it. <strong>We added some contexts to the visualization, and made it interactive by taking the following steps:</strong></p><h4>Drag to rotate</h4><p>We implemented a drag-to-rotate function. Wikipedia has detailed page about rotation in three dimensions, but we didn’t need to reinvent the wheel. We adjusted<a href="http://bl.ocks.org/ivyywang/7c94cb5a3accd9913263"> a script on d3 gallery</a> to our needs.</p><h4>Highlight connections</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gTSVKIM9bvZUypA-3bo_wA.gif" /><figcaption>Connections of George Economou</figcaption></figure><p>We highlight connections of a director on mouse click or search, and then color code first and second degree connections. The board membership display on the right acts as a filter for the visualization. Users can use this feature to analyze the connections of a director. For instance, George Economou shown in this screenshot is the CEO of dry bulk shipping company DryShips Inc, who has been<a href="https://www.smarteranalyst.com/2017/02/02/dryships-inc-drys-everyone-angry-ceo-george-economou/"> attracting lots of media attention for some controversial strategies</a>. From our app, users can identify other companies under his influence. For example, he also sits on the board of another shipping company Danaos Corporation. Both Dryships and Danaos have a lower corporate governance score based on our analysis published in the Wells Fargo report.</p><h4>Search</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*YdxL-TJHOKh29LDZTZ_OMw.gif" /></figure><p>Users can search for connectedness of director or company in our dataset directly. The example of George Economou is the result of a director search. The screenshot on the left is the result of company search. Based on the number of connections, we scale a company’s connectedness relative to industry standard. For instance, Teekay Tankers LTD has a connected score of 87 out of 100.</p><p>We also have a path search feature for checking whether two directors are connected and showing their path of connections. We implemented the Dijkstra algorithm for finding the shortest path between two nodes in a graph. Again, we looked around for<a href="https://github.com/julianbrowne/dijkstra"> existing solutions</a> and adjusted it to our needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ym5etO7Jy62Iy1kTeUjgQ.png" /></figure><h4>Rank the most connected directors/companies</h4><p>We ranked the connectedness of directors and companies. Users can easily identify influencers and analyze relationship dynamics using highlight and search features.</p><h3>What to build next</h3><p>So far, we have laid the foundation for visualizing managerial social network and extracting basic insights. We believe the underlying insights of business relationships are rich and prevalent in every industry. We hope our interactive visualization can empower investors and regulators. Later on, we would like to incorporate more data to further enrich the application:</p><ul><li>directors/companies currently in negative news</li><li>directors with bad track records.</li><li>directors with political connections</li></ul><p>to alert or inform users about possible risks or opportunities.</p><p><strong><em>Check out the </em></strong><a href="https://shipping.penmon.com/"><strong><em>visualization</em></strong></a><strong><em> and let us know what you think.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dcfcdeb5c2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>