<?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 Thammarith on Medium]]></title>
        <description><![CDATA[Stories by Thammarith on Medium]]></description>
        <link>https://medium.com/@thammarith?source=rss-6fe44f5c4c74------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*p7E5FgFXmNuVVtvuA8OATg.jpeg</url>
            <title>Stories by Thammarith on Medium</title>
            <link>https://medium.com/@thammarith?source=rss-6fe44f5c4c74------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 14 Apr 2026 23:57:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thammarith/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[Managing and scaling different white label development and testing environments]]></title>
            <link>https://medium.com/agoda-engineering/managing-and-scaling-different-white-label-development-and-testing-environments-4e90748fcb3b?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e90748fcb3b</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[website-design]]></category>
            <category><![CDATA[ecommerce-web-development]]></category>
            <category><![CDATA[white-label]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Sun, 06 Mar 2022 23:32:47 GMT</pubDate>
            <atom:updated>2022-03-06T23:32:47.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_-rNlW022HhVOArnFuXDrQ.jpeg" /></figure><h4>White-labelling (Part 2): how Agoda manages development environments for white labels</h4><p>In the previous part, I explained Agoda’s white label architecture, what they are, and how we manage the differences between white labels. If you haven’t read the first part, you can read it here — <a href="https://medium.com/agoda-engineering/building-and-scaling-different-travel-websites-with-one-codebase-fc6f0202c2e1">Building and scaling different travel websites with one codebase</a></p><p>To briefly recap: a white label is another travel website that uses Agoda’s code. We maintain the differences between websites by using a combination of White Label Service and Behaviour Management.</p><p>In this article, I will share how we address a challenge of multiple environments for multiple white labels: Development, QA, Pre-Live, Live/Production.</p><h3>Multiple Environments for Multiple White Labels</h3><p>At Agoda, we have different environments for development stages. We have URLs for each environment, development.agoda.com, testing.agoda.com, pre-live.agoda.com, and agoda.com, respectively. For each stage, there is a URL for every active pull request. For example, pull1234.pre-live.agoda.com is the pre-live URL for <em>pull request #1234</em>.</p><p>The challenge is that when we have created a pull request, developers have to check the website for other white labels. There must be a way for developers to access those white-label websites. Also, the system has to be able to present the website in different stages of the development process.</p><h4>Using domain names for white labels</h4><p>Our initial solution was to create a new domain for every white label. For example, for <em>white label 42</em>, assuming the name is <em>Adoga</em>, we would register a domain called notyetadoga.com for this white label.</p><p>We would then use the following approach for building a domain name:</p><ul><li>a subdomain for each stage of the development process, e.g., development.notyetadoga.com to indicate the development stage</li><li>a sub-sub domain to represent a pull request, e.g., pull1234.pre-live.notyetadoga.com for <em>pull request #1234</em>.</li></ul><p>As you can guess, the domain name solution works fine for the first few white labels. We eventually ran into multiple scalability problems, for example:</p><ul><li>The costs of creating and renewing the domain names and certificates</li><li>Cross-Origin Resource Sharing (CORS) issues when forcing API endpoints on other domain names, etc.</li></ul><p>In the end, we decided to move on from this high-cost and unscalable approach.</p><h4>Using a header for white labels</h4><p>Essentially, to differentiate white labels, we need to find a way to tell our server which white label ID we are trying to access. We then came up with <em>the header solution</em>.</p><p>Instead of using domain names, we can just send a custom header to our server-side to select what white label we want to get. For example, if we want to get <em>white label 42</em>, we can send the header x-agoda-whitelabel-id = 42 along with the requests using a browser extension, for example, ModHeader, etc.</p><p>When the reverse proxy receives the x-agoda-whitelabel-id header, it passes on that header downstream to the web server and other services. Those services use the header to get the configuration from White Label Service and compute the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32pJiL0jGSZysuSPOUDvuA.jpeg" /></figure><p>This is a simple and scalable solution but does not work as expected on mobile devices. Furthermore, we cannot detect brand leakage (an accident that a white label shows images, links, or strings from another white label) with this approach because every white label still points to agoda.com. We can never know which URL/link points incorrectly.</p><p>In a typical development process, developers use mobile view in the browser’s dev tools to simulate viewing the website on mobile devices which work fine 99% of the time. However, in some cases, we found a bug that can only be reproduced on real mobile devices. Forcing the header on mobile devices is highly inconvenient and challenging. Also, it is difficult for our partners to look at the website since they might not have the technical background to know about headers and how to force them, which is a bad experience.</p><p>Even though the white label header is a much better approach than creating individual domain names, it is not very practical to do testing on mobile devices and troublesome for our partners and our automation test systems to test. We, again, had to find a new solution.</p><h4>Back to domain names, but this time, it’s better!</h4><p>We have observed a few problems with the previous solutions that we have faced:</p><ul><li>Overheads in preparing for a new white label</li><li>No consolidated system for end-to-end (E2E) tests for white-labels</li><li>Difficulties for the partners to access the website for user acceptance test (UAT)</li></ul><p>The white-label team has designed a solution that combined both the header and domain name solutions with those problems in mind. We created another layer of a reverse proxy that works as follows:</p><ul><li>We created a unified white label domain name, agoda-whitelabel.com</li><li>We added another layer, white-label proxy, to resolve the new white label URL scheme</li><li>The white label reverse proxy tokenises the URL and maps back to the corresponding pull request, white-label, and environment</li><li>The white label proxy then passes the mapped information to the reverse proxy to prepare information for the downstream systems</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C7BXTGgYBl_4zxFPEWeDww.jpeg" /></figure><p>The URL scheme works as follows: for each environment, we use a subdomain to specify the white label, e.g., wl999.agoda-whitelabel.com for <em>white label 999. </em>We use the sub-sub domain name to target a pull request and environment, e.g., pull1234-pl.wl999.agoda-whitelabel.com for <em>pull request #1234</em> on the <em>pre-live</em> environment for <em>white label 999.</em></p><p>Initially, we considered having only one level of subdomain name, e.g. pull1234-pl-wl999.agoda-whitelabel.com to simplify the SSL certification management, but we realised the complexity and headache of cookie management that would follow. So, we decided to add one more level of subdomain name.</p><p>The current solution allows the system to be more flexible and extensible. We could add more environments easily. For example, uat.wl999.agoda-whitelabel.com can be used for user acceptance tests. This is much simpler for our partners and us to test the website.</p><h3>Final Thoughts</h3><p>To look back, we have learned a lot along the way. We combined the knowledge of two previous solutions, domain names and headers, to create the best solution so far. Of course, in software development, this is not the perfect and final solution. We are improving the domain name systems to support other environments, such as origins and different testing environments.</p><p>Next time you book a hotel or flight, you might be booking on Agoda’s partner websites unknowingly. Look out! It might be one of Agoda’s white labels if it is full of features!</p><p><em>Thanks to </em><a href="https://www.linkedin.com/in/vladbatushkov"><em>Vlad Batushkov</em></a><em>, </em><a href="https://www.linkedin.com/in/kevin-kenny-78b21a105/"><em>Kevin Kenny</em></a>,<em> </em><a href="https://www.linkedin.com/in/brindakrishnan"><em>Brinda Krishnan</em></a><em>, </em><a href="https://www.linkedin.com/in/patthaphol-kulthawaiporn-325158a2"><em>Patthaphol Kulthawaiporn</em></a><em> </em>for their help improving this series<em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e90748fcb3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/agoda-engineering/managing-and-scaling-different-white-label-development-and-testing-environments-4e90748fcb3b">Managing and scaling different white label development and testing environments</a> was originally published in <a href="https://medium.com/agoda-engineering">Agoda Engineering &amp; Design</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and scaling different travel websites with one codebase]]></title>
            <link>https://medium.com/agoda-engineering/building-and-scaling-different-travel-websites-with-one-codebase-fc6f0202c2e1?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc6f0202c2e1</guid>
            <category><![CDATA[white-label]]></category>
            <category><![CDATA[travel-web-development]]></category>
            <category><![CDATA[travel-technology]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 03:39:57 GMT</pubDate>
            <atom:updated>2023-10-13T10:16:35.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgH2ihe1uzOUXsSfYEMivQ.jpeg" /></figure><h4>White-labelling (Part 1): the secret tool that enables Agoda to build multiple travel websites for our partners</h4><p>Did you know that Agoda uses its code to create websites for other online travel agencies as well? We do this by using a process called white-labelling. When Agoda decided to white-label our website, we faced numerous challenges like — maintaining differences between websites, creating environments for different development stages, and more.</p><p>I have been working as a full-stack engineer at Agoda for around two years working on several white label projects on the accommodation, YCS, and flight funnels. I take the opportunity to share my experience in this two-part series of Agoda&#39;s successful model of white-labelling. By the end of this blog, you will have a clear understanding of how white-label looks from the inside, how it works on the code level, application, and different environments. I will do this by taking real-life examples of Agoda’s challenges with white-label and how we tackled them. Feel free to adapt the techniques I share with your team and organization.</p><h3><strong>What is White-Labelling?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CIF0K8Y81F72EYnqBOHwxg.jpeg" /><figcaption>Not only does white-labelling exist in the software world, but the hardware world also has the approach as well. Some phones have surprisingly similar designs and specifications because they use the same model.</figcaption></figure><p>While shopping online, have you noticed that some products are surprisingly similar? The similarities might be in terms of features or looks and feel. One of the most straightforward examples is mobile phones. Remove the labels, and the products look the same! Some brands use the same model of devices from the same assembly line but customize the User Interface to fit their branding. This process is called white-labelling.</p><p>In the software world, white-labelling is common. It is born from the idea that you make a product once and help your partners build their products by sharing your existing code with them and adjusting your product’s characteristics such as features, themes, etc., to suit their needs.<strong> </strong>Agoda saw this as an opportunity and decided to make our website a white-label ready brand.</p><p>Now that we understand white labelling and its importance let me show you how we implement it.</p><h3><strong>Agoda&#39;s Architecture Simplified</strong></h3><p>The first step is understanding Agoda&#39;s architecture. When a user lands on agoda.com, the reverse proxy resolves and maps the URL to determine the downstream systems or services to direct the request. For example, if a user requests agoda.com from their mobile device, it determines that the phone web server responsible for downstream service should receive this request.</p><p>After the request has reached either the desktop or mobile webserver, the webserver takes the information from the request to build and render the client-side. The webservers also connect to the white label service, which we are going to look into the details later on, and other backend APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*itBAQPA94FWph61aA3WTqQ.jpeg" /><figcaption>A simplified diagram of Agoda&#39;s frontend architecture</figcaption></figure><h3>Resolving a White Label from a URL</h3><p>Our white labels (partner websites) use the same infrastructure and codebase as Agoda. How can our system figure out which white label it is when a user visits one of the white labels?</p><p>The reverse proxy spearheads the responsibility after the DNS points the website to one of our servers. When a user visits <a href="http://www.whitelabel42.com,">whitelabel42.com,</a> the request hits the reverse proxy, and it checks WhiteLabelConfiguration which contains an array of the list of our websites. Once it finds the matching white label information from WhiteLabelConfiguration, it passes the white label ID and other information downstream to the webserver and other downstream APIs and services with a white label header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ASol0fQ7RCqpkp9X8Q239A.jpeg" /><figcaption>The reverse proxy matches the request URL with the array that contains the list of our websites.</figcaption></figure><h3>Managing Feature Configurations</h3><p>Each white label has a set of features. The feature can be coupons, sign-up/log-in, or some regulatory requirements, such as the prices on the search page inclusive or exclusive of tax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WCtC45Mn3GZ5AHoe6l4yQ.png" /><figcaption>Agoda (top) doesn&#39;t have the prefecture map which is present on our Japanese partner&#39;s website (bottom). In contrast, the language and currency menus, which are on Agoda, are disabled on this partner&#39;s website.</figcaption></figure><p>The above images are white labels. Notice the Japanese partner&#39;s website has a map of Japan&#39;s prefectures, which people can use to search for accommodations in the user-selected region. However, on Agoda, we do not have that map. Another example would be on the top navigation bar. On Agoda, we have language (shown as the flag of Japan) and currency (shown as $) settings which our Japanese partner disabled.</p><p>There are two types of features, boolean and configurable. The Japan prefecture map is an example of a boolean feature. We can either turn it on or off. On the other hand, we can configure the list of supported currencies for a white label. Which makes currencies a configurable feature. When there is no configuration for this type of feature, it means that it is disabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9dbn1uq4USW_qSRedsf0w.png" /><figcaption>The differences in the header for Agoda (top) and the Japanese counterpart (bottom). The language and currency options are not enabled on the Japanese partner&#39;s website.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGxea4dEP7XsOwsFxTuOyg.png" /><figcaption>Apart from boolean (on/off) features, we can also have configurable features as well. In this example, Agoda (top) offers over 30 languages but a white label (bottom) can limit supported languages as well.</figcaption></figure><p>On the scale at which we are growing, Agoda has around 300 of these features. Each of these features may contain sub-configurations. This brings the total possible configurations to over 500 compositions and are growing by the day! Our challenge is how can we manage the configurations?</p><p>Let&#39;s explore some of the options we have tried.</p><h4>Hardcoding</h4><p>The most straightforward way to check if a feature is enabled or not is hardcoding. Something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb76f6a1eb8222840a4b4ee05cf470df/href">https://medium.com/media/eb76f6a1eb8222840a4b4ee05cf470df/href</a></iframe><p>However, this is neither scalable nor maintainable. Imagine having 100+, let alone 10+ white labels to manage. There will be 100+ if-else statements, enums everywhere, and another 100+ bugs as a result. We need to do better.</p><h4>White Label Service: the Single Source of Truth</h4><p>To have synchronized configurations across the system, we wanted to have a single source of truth for services from which to read. It should be easy to toggle and control the setting values.</p><p>As a result, we created a core service called White Label Service. This service serves the feature configurations for each white label. Most services in Agoda connect to and read the configurations from White Label Service.</p><p>Let&#39;s say a user visits a partner&#39;s website that has the same features as Agoda&#39;s, except sign-up/log-in. After the reverse proxy has resolved the URL and known that it is <em>white label 42</em>, it passes the information to the webserver. The web server reads the configuration from White Label Service and instructs the client-side that this white-label does not have log-in/sign-up. The client-side takes the parameters given by the webserver, realizing that it should hide all log-in/sign-up related features and renders the components accordingly.</p><p>Below is an example of our white label configuration:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db1be703fe4473be657172d12e9da72d/href">https://medium.com/media/db1be703fe4473be657172d12e9da72d/href</a></iframe><p>which compiles to</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c76e907b8d909c355e516f05cb574eb1/href">https://medium.com/media/c76e907b8d909c355e516f05cb574eb1/href</a></iframe><p>This approach works well initially but is challenging to scale for more than ten partners. The more partners we have, the more configurations we have to take care of. We cannot rely on it to be the single source of every truth because it is hard to maintain, and some features are only helpful for the front-end. For example, the backend system ignores the links on the menu bar or the footer on the website. So, we came up with &quot;client-side Behaviour Management&quot;.</p><h4>Behaviour Management: the Client side&#39;s Source of Truth</h4><p>Apart from the issues mentioned earlier, we found some challenges with making White Label Service the single source of truth. For example, it takes time to add and deploy a feature; it is difficult to have robust testing for a feature, etc.</p><p>We solved these challenges by introducing Behaviour Management which concerns client-side logic alone. With Behaviour Management, we define a behaviour, e.g., visibility of a button, the links in the footer, etc., in the client-side code itself.</p><p>A behaviour can be defined using a combination of conditions such as White Label ID, experiment ID, origin, etc. For example, we can create the HideFooterLinksBehaviour by checking if the White Label ID equals Agoda or is on the B side of an A/B experiment.</p><p>Below are examples of the behaviour:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fac929e9e797c2d254b827057ab3af8/href">https://medium.com/media/2fac929e9e797c2d254b827057ab3af8/href</a></iframe><p>Behaviour Management is not limited to just React, we can expand to other client sides as well. Our webserver, which is the client-side of the White Label Service and written in C#, can use Behaviour Management too.</p><p>In fact, Behaviour Management is a concept that can be adopted in any language as long as the necessary information such as White Label ID, origin, etc. can be resolved.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fcdd17aec404bbcb24a6378a6a909d75/href">https://medium.com/media/fcdd17aec404bbcb24a6378a6a909d75/href</a></iframe><p>Some benefits of Behaviour Management are that we can use a code analyser and do unit testing; behaviour names are more related to the code itself, which is easier to identify, and we can create nested behaviours.</p><h4>Two is Better than One</h4><p>There are some situations that we want to take the configuration from the White Label Service to build a client-side specific behaviour. For example, we want to see if a White Label has Flights enabled, we can use the Flights configuration from the White Label Service to be a condition in a behaviour.</p><p>With the combination of the White Label Service, hosting the configurations for multiple services, and Behaviour Management, hosting the configurations for a single service, we have created a maintainable, extensible, and configurable system to build websites for our partners.</p><p>The combination can be visualized in the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AViVabPDpsSjMvr7Q_ihgw.jpeg" /><figcaption>visualization of data flow for white label information</figcaption></figure><h3>What did we learn from our approach?</h3><p>To look back, we have come a long way and learnt a lot from the earlier easy-to-implement but hard-to-scale system to more sustainable and scalable architecture. We will test our solutions against new and unexpected requirements that adapt to support unique needs. We are confident that our solution is scalable and extensible when those changes are required.</p><h3>Next Part: Development &amp; Testing Environments</h3><p>Now that white-label features and configurations are manageable, how about identifying solutions for each environment for various development stages? Buckle up to explore the last step before the deployment!</p><p><strong>Read it now: </strong><a href="https://medium.com/agoda-engineering/managing-and-scaling-different-white-label-development-and-testing-environments-4e90748fcb3b">Managing and scaling different white label development and testing environments</a>.</p><p>Special thanks to <a href="https://www.linkedin.com/in/vladbatushkov">Vlad Batushkov</a>, <a href="https://www.linkedin.com/in/brindakrishnan">Brinda Krishnan</a> and <a href="https://www.linkedin.com/in/patthaphol-kulthawaiporn-325158a2">Patthaphol Kulthawaiporn</a> for their support and guidance.</p><figure><a href="https://careersatagoda.com/department/technology/?utm_source=medium&amp;utm_medium=blog&amp;utm_campaign=rith&amp;utm_term=whitelabel_part_1&amp;utm_content=feb2022"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RERfVJOwf_W_F6_8NlALeQ.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc6f0202c2e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/agoda-engineering/building-and-scaling-different-travel-websites-with-one-codebase-fc6f0202c2e1">Building and scaling different travel websites with one codebase</a> was originally published in <a href="https://medium.com/agoda-engineering">Agoda Engineering &amp; Design</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working at Agoda]]></title>
            <link>https://thammarith.medium.com/working-at-agoda-a2aecd71eeef?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2aecd71eeef</guid>
            <category><![CDATA[work]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[agoda]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Thu, 01 Apr 2021 06:58:25 GMT</pubDate>
            <atom:updated>2021-04-26T16:52:15.615Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXQFXXPcxe3SC3_7AgCwJg.jpeg" /></figure><h3>Working at Agoda as a Software Engineer</h3><blockquote>There are two ways to write error-free programs; only the third one works.<br> — Alan J. Perlis</blockquote><p>About a year ago, I made an important decision of my life. I moved from my previous start-up company to Agoda.</p><p>In this article, I’m going to share about my experience working here, how we work, what our daily routines look like. Even though my position is <strong>Full-stack Engineer</strong>, I believe this will be applicable for other tech positions as well.</p><h3><strong>How did I join Agoda?</strong></h3><p>I was working with my previous company, <em>ViaBus</em>, for some time. ViaBus was a start-up that creates a tracking app for the Thai public transport systems used by hundreds of thousands if not a million. It was great working there.</p><p>However, I have always wanted to try something new, working in a multicultural enterprise. It would be fun working with people from different backgrounds and learn different ways to work, wouldn’t it?</p><p>An opportunity approached me. There was a programming competition held by Agoda in late-2019. I instantly joined, just for fun. The competition saw around 5–7 questions. Some of them are algorithmic, some are problem-solving challenges. I finished at the 50th-ish place.</p><p>A few months later, there was a call from Agoda’s recruitment team. They gave me a list and asked me if I was interested in an opening position. I responded that I was interested in the client-side engineer, and full-stack engineer positions.</p><p>After a few more calls, I found myself in the Agoda office at the Offices at Central World, located in the heart of Bangkok. I was there to do interviews.</p><h3>Interviews</h3><p>For me, I had three rounds of interviews in a day. The first one was with two senior engineers. We discussed about my projects at the previous place. They asked me to solve a development scenario and try to optimise my solution.</p><p>The second one was with a data-team manager. He gave me a number of functions and asked me to use only these functions to find a solution to the challenge.</p><p>Finally, I did my last interview with a full-stack development manager. He asked my in-depth questions about JavaScript and asked me to solve some problems.</p><p>All interviews were conducted in English and there was a take-home development question that asked me to write a program in my language of choice.</p><p>I think this approach is a good approach since not only does it checks your computer science knowledge, but it was designed to ensure that you can actually write a program. Some people may find it stressful during the face-to-face interviews so they have not done very well but there is homework to help them prove themselves.</p><p>By the way, I asked a couple of colleagues, some said they had done only one round of interviews, the others said they had done up to five interviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bG1KWtsnrj5hUSciGrAnOw.jpeg" /></figure><h3>First Day at Agoda</h3><p>After the interview, about a week later, I got a call that landed me a position at Agoda. I delightedly accepted the offer and was asked to pick up equipment at the office.</p><p>I went to collect accessories at the offices a couple of weeks before my first day. I got a performant DELL laptop along with a laptop docking station, a set of welcome kit, and other necessary equipment. For other projects that require Mac, or you happen to need it, you will get a MacBook.</p><p>My first day at Agoda was in late-March. The infamous Coronavirus forced companies to embrace working from home. Agoda started working from home about a week before I joined. So, I began my first day at home.</p><h3>Working from Home</h3><p>Although I am an introvert and always try my best to avoid the presence of other human beings, working from home was not the best experience I have had, especially as a new joiner during the probation period.</p><p>Fortunately, I was placed in a team with a great, friendly, caring lead engineer. There was a coding scenario for new joiners to work with to get used to the technologies we are using. He helped and guided me through difficult parts and explained concepts I had never heard before. Props to him.</p><p>After the COVID-19 situation got better, we came back to our lovely office again. Now, we are working in the office.</p><h3>The Teams</h3><p>At Agoda, you will have great opportunities to rotate amongst exciting projects and teams.</p><p>My first team was the white-label team. We have been working with our Japanese partner, JTB, for a while. We are helping them build their new websites based on Agoda’s website and features. After a couple of quarters, I moved to a new team which is vastly different from the former.</p><p>The second team that I joined was YCS. Not only do we focus on hotel customers, but we also have a property management system for hotels to manage their bookings, properties. In this team, I got a great opportunity to design and implement a new feature which keeps track of external data of properties.</p><p>After the project has finished, I moved on to another team, SEO. Most of us search for hotels on search engines and book from one of the top results. The responsibility of this team is to make sure that we are at the top when a user search for a place to stay. Undoubtedly, SEO is one of the critical parts of Agoda. In this team, I was working on a project to migrate our indexation system from SQL to Hadoop, and create a new sitemap generator system.</p><p>All of these happen in just about a year! I have been rotated through teams which have enabled me to learn and acquire new knowledge and skills, and my journey will continue.</p><h3>Technologies</h3><p>On the client-side, we are using React + TypeScript. On the server-side, we are using C# (.NET Core) as the web server. These three pieces of technologies are the ones that all full-stack engineers have to touch.</p><p>If you are a a back-end developer, we are using a lot of cool technologies. The main tools are Scala, Docker, Hadoop, Spark. For databases, we are using Microsoft SQL, Couchbase.</p><p>How about tests? We write extensive tests for almost every project. We use Jest for testing our React code, NUnit/xUnit for C#, etc. We do all kind of tests, unit tests, integration tests, end-to-end tests, Selenium tests. We have a global site test system that catch production errors as well. Every time you encounter an error, we know and will fix it!</p><p>Apart from publicly available technologies, we build our own in-house tools as well. We have our excellent experiment system that does A/B testing and measure the success. Another example would be our BuildFlow system which handle our CI/CD process since we have over a half a hundred pull requests a day.</p><p>We have made some of our internal tools open-source which are available on our <a href="https://github.com/agoda-com">agoda-com GitHub</a>.</p><p>Like other big enterprises, we still have some (ready for the scary words?) <em>legacy code</em>. Fortunately, it appears in few places and we are working to get rid of them. 😎</p><h3>Daily Routine</h3><p>We work using the Agile methodology. Most teams are using Scrum with 2-week sprint.</p><p>As a cool company, our start time is very flexible. On the paper, work starts at 9:00 but we can come whenever we want (just try to arrive before the stand-up meeting).</p><p>We begin our day with a stand-up meeting at around 10:30 and try to keep it short so we can spend our time on the thing that matters, coding.</p><p>Lunch is at around 12:00 but, again, you can have it whenever you want. Most people leave the office around 18:00–19:00. If you finish your work early, again, there is no need to stay late (or you can if you want to 😉).</p><p>How about meetings? We try to have as fewest meetings as possible and keep it short.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D8yZly52BWfetkUSI4hvXA.jpeg" /></figure><h3>Working Cultures</h3><p>As a diverse company, we have talented people from around the world. At Agoda, we commit to make the workplace inclusive for everyone no matter of one’s skin colour nor race.</p><p>We use English as the main language. Still, you should be able to speak Thai <em>Dai Nid Noi </em>(= a little bit) after a few months in.</p><p>Sometimes you may find it difficult when you disagree with your boss but, here at Agoda, you should be comfortable challenging your boss, your manager, your co-worker, or even the CEO (I have seen him got asked many challenging questions), as long as you’re challenging objectively, professionally, and respectfully. Why? Because everyone can be wrong, and anyone can be right. We should try to avoid going down the wrong track before it is too late.</p><p>Of course, there will be times when there is something in the way of getting your tasks done. If there is a blocker or anything that hinders your working velocity, you can always escalate to your or your team manager to solve the issue as timely as possible.</p><p>Speaking of managers, they are really easy to catch. You can always walk and talk to them to express any of your concerns, or just to have a chit-chat! You can also request a one-on-one meeting with your manager whenever you feel like one.</p><h3>Agoda’s Tech Cultures</h3><p>Another working culture at Agoda that really shapes the way the company has been is <em>experiments</em>. If you have an idea that might improve the website, why not experiment it? If the experiment results look promising, we will integrate as a feature. We have our own A-B testing experiment platform that we use to measure the success of a feature/implementation.</p><p>This is all possible with our data-driven approach. <em>We trust data.</em> Decisions are made based on the data that we have.</p><p>But how do we get the data? <em>We measure.</em> We measure (almost) everything, from the number of bookings increased with an experiment, to the clicks that a user makes. Thanks to this, we can deliver what users need.</p><blockquote>Fun fact: we even measure the number of messages sent, meeting held, etc. during the WFH period and compared them with our time in the office.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEWuA02OuWvZ6UGxN0KNvg.jpeg" /></figure><h3>Perks and Environments</h3><p>On every floor, there is a pantry room for everyone to get some coffee or tea, grab some snacks, and have your lunch.</p><p>There is a coffee machine for you to have your essential cup before or during work. There are also cereals, bananas, and apples for you would you be hungry (but be quick! Bananas run out <em>really</em> fast!).</p><p>If you happen to be bored of the office’s snacks and drinks, you can always go down and pop into a café or restaurant in the shopping centre. There are hundreds of them to choose from! Don’t worry, there will always new shops to get you excited.</p><p>How about lunch? Many restaurants offer 10–20% exclusive discount when you show your Agoda badge!</p><p>What if you are tired of sitting? You can request a standing desk to improve your posture. If you experience back pains, there are massaging sessions on every Friday by people with visual impairments.</p><p>Also, there is a programme called Agoda Choice which allows you to choose between Fitness First’s subscription or 20,000 Baht to spend on well-being <em>every year</em>.</p><h3>Activities</h3><p>We have many kinds of activities here at Agoda. After work, we play board games, FIFA, Nintendo Switch, etc. If you are into physical sports, we have badminton, football, diving groups, etc. Sometimes we gather a group of people and do some CSR activities for communities and charities as well.</p><p>If you think working here has to be serious, I am sorry to tell you that we even have a Slack channel called <em>#random</em>. It is the place for great memes and everything else. On our internal Facebook Workplace, we have a group call <em>‘Cats Cats Cats’</em> which we share images of our cats at home or around our offices. It is one of the best groups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*JuARhSkHdlHhOpvrP0fGRA.png" /><figcaption>A peak of what’s inside the ‘Cats cats cats’ group. I turned the notification on specifically for this group (Photo: Sarah Chew)</figcaption></figure><p>If you want to expand your knowledge, we have Slack channels such as <em>#dev-knowledge-share</em>, <em>#mastering-scala</em>, etc. where you can learn and ask questions about development.</p><p>Every month, there often are internal tech talks where we share our knowledge, experiment results, or cool stuff. Some tech talks were really cool, for example, one explained how we are setting up our system so that it can handle a <em>really</em> huge number of data requested in a second, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLzon7R07xm6XCxUWN4XPw.jpeg" /></figure><h3>I’m Interested! What Should I Do?</h3><p>If you’re interested and want to join this amazing company, you can visit <a href="https://careersatagoda.com"><strong>https://careersatagoda.com</strong></a> and apply for your desired positions. <strong>Everyone <em>from new grads to veterans</em> are welcomed!</strong></p><p>We hope to see you here!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2aecd71eeef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trying Out New GitHub’s Codespaces]]></title>
            <link>https://medium.com/thammarith/trying-out-new-githubs-codespaces-9c70f7a6cb2a?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c70f7a6cb2a</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[review]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Sat, 05 Sep 2020 16:22:44 GMT</pubDate>
            <atom:updated>2020-09-05T16:22:44.319Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pdjvVy5sFGCXnqaXewaBQw.png" /><figcaption>No, it’s not a screenshot of VS Code being run on desktop. It’s on the cloud!</figcaption></figure><p>A couple months ago, GitHub announced that they were rolling out Codespaces, but what is Codespaces?</p><p>Codespaces is an online IDE (Integrated Development Environment), a program used to write code. It&#39;s powered by Visual Studio Code (VS Code) which is a really popular IDE. If you&#39;re reading this, you must have heard of it. Why VS Code you may ask? Well, VS Code is Electron-based, was created by Microsoft and GitHub is a part of Microsoft. So that&#39;s that.</p><p>Let&#39;s move on to other topics.</p><h3>Why?</h3><p>The question might be <em>why not?</em></p><p>It&#39;s on the cloud meaning that <strong>you don&#39;t have to install anything.</strong> If you can connect to the Internet, you can code anytime, anywhere. Setting Codespaces up is quite simple. I&#39;ll show later in the next section.</p><p>Also, <strong>it saves your storage spaces!</strong> If you&#39;re a web developer like me, you must have been suffering from the sheer size of the node_modules/ directory. In a project, it&#39;s fine. Many project combined? I&#39;ll let you do the maths.</p><p>Another great thing about Codespaces is that it&#39;s <strong>equipped</strong>. You can open any GitHub repository as you like (currently limited to non-organisation owned repositories). Making and committing changes can never be easier. Running Unix command lines? Installing some npm packages? Committing some changes? Boom! You can do it in the terminal easily. No installation needed.</p><h3>How?</h3><p>In order to create a codespace, head to your cool repository, (optional) create a branch, then click on the green button that says <strong>Code</strong>. A dropdown menu will be shown, select <strong>Open with Codespaces</strong>. Now, if you have created one before, you can choose the existing one. If you haven&#39;t or you want to create a new one, click the <strong>New codespace</strong> button.</p><p>You&#39;ll be greeted with a bright, light-themed VS Code. My eyes! Being good developers, the first thing we all do is changing to a dark theme (it&#39;s 2020 and dark themes aren&#39;t default, wtf?). I personally prefer <strong>Atom One Dark Theme </strong>(akamud.vscode-theme-onedark) I know that it&#39;s a matter of taste and I don&#39;t want to start a war on themes. I just want you to know that I respect all of your preferences and I won&#39;t judge but if you&#39;re using other themes (especially light themes), you&#39;re simply wrong.</p><p>That’s pretty much it. You can now enjoy the glory of Codespaces.</p><h3>Let’s try it out!</h3><p>I’m going to initiate a simple create-react-app and run to see if it works for this article and see if there’s any hussle.</p><p>I began by creating a repository to host the files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0jbu-dBwwpQ4xnUuImM1vQ.png" /><figcaption>When clicking the <strong>Code</strong> button, there’s an option to <strong>Open with Codespaces</strong></figcaption></figure><p>As I mentioned, npm and node has been pre-installed. I can simply run npx create-react-app to install React.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeArSi6HD3C8KPi2pOTMXw.png" /><figcaption>Creating a React app in the current directory</figcaption></figure><p>And… we have it! A React app installed on Codespaces. (Excuse my tabs)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxwXx8RZ3jAavMLqoLkPzg.png" /></figure><h3>How about localhost?</h3><p>When I tried creating a React app, my first question was <em>how could I run the localhost?</em></p><p>Of course, GitHub developers thought about this. When clicking on the <a href="http://localhost:3000">http://localhost:3000</a> link in the terminal, it opens a new tab forwarded to https://[random-string]-[port].apps.codespaces.githubusercontent.com and I can browse the newly-created React website easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pzdaeO4UMkBxRzQmrml0-w.png" /><figcaption>This is not localhost</figcaption></figure><p>By the way, you can also connect to your lovely locally installed VS Code using the <a href="https://marketplace.visualstudio.com/items?itemName=ms-vsonline.vsonline#">Visual Studio Codespaces</a> extension. It’s in preview and I haven’t tried it.</p><h3>Costs</h3><p>On the <a href="https://github.com/features/codespaces">Codespaces page,</a> it says</p><blockquote>Pricing for Codespaces has not yet been finalized. Code-editing functionality in GitHub will always be free. We plan to offer simple pay-as-you-go pricing for Codespaces cloud environments. Codespaces is free during the limited beta.</blockquote><p>So it looks like we’re going to have to pay for it but everything costs and nothing is free right? If the pricing is reasonable (hopefully it is), this could be a game changer.</p><h3>What I LOVE about it</h3><ul><li><strong>Ease</strong>: It’s simple to get it run and you can code anywhere, anytime. No need to worry about storage spaces. (I’m thinking about using an iPad Pro 2020 (12.9&quot;) + Magic Keyboard as a laptop-replacement. If I go with this, I’ll write a review.)</li><li><strong>Continuity</strong>: I hadn’t committed the changes to git yet and closed the browser. After reopening the Codespace, the files are there as they should be.</li></ul><h3>Things that could be improved</h3><ul><li><strong>Bugs</strong>: With a few days of using Codespaces, I found a number of bugs. Some are fatal; some are dismissable. But hey, it’s a beta right?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*OiQhnGrnS5bbl4PlU0tL1Q.png" /><figcaption>I can’t get it running and have to try a couple of times.</figcaption></figure><ul><li><strong>Shortcuts</strong>: When I pressed [Ctrl + W], I expected the current tab <em>in Codespace </em>to be closed, but instead, the <em>browser tab</em> was closed. It happens with [Ctrl + P] as well. This is really annoying since it happens on and off.</li><li><strong>Speed</strong>: It’s not that slow but it’s slow enough to feel and get annoyed. Being optimistic, it’s a good place to improve our patience.</li></ul><p>All in all, I really love GitHub Codespaces. It’s convenient, cloud-based, and equipped. There are still some issues to be fixed before releasing to the public but they aren’t critical. This is something we should eye on.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c70f7a6cb2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thammarith/trying-out-new-githubs-codespaces-9c70f7a6cb2a">Trying Out New GitHub’s Codespaces</a> was originally published in <a href="https://medium.com/thammarith">thammarith</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a custom component and communicate with the parent through `v-model` in Vue.js]]></title>
            <link>https://thammarith.medium.com/how-to-create-a-custom-component-and-communicate-with-the-parent-through-v-model-in-vue-js-e3244c52adcb?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3244c52adcb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Fri, 01 Feb 2019 07:41:54 GMT</pubDate>
            <atom:updated>2019-02-01T07:41:54.190Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Right now I have lines of code to make a select box which looks like this</p><pre>&lt;select v-model=&quot;somethingSomething&quot;&gt;<br>  &lt;option disabled selected&gt;Select me&lt;/option&gt;<br>  &lt;option v-for=&quot;...&quot; :value=&quot;...&quot; :key=&quot;...&quot;&gt;...&lt;/option&gt;<br>&lt;/select&gt;</pre><p>However, I have this on many pages and it would be tedious to repeat myself.</p><p>So I went with creating a custom component and use that in every page I need. It looks like this</p><pre>&lt;template&gt;<br>  &lt;select <a href="http://twitter.com/input">@input</a>=&quot;handleInput&quot;&gt;<br>    &lt;option v-for=&quot;item in collection&quot; :key=&quot;item.id&quot;&gt;...&lt;/option&gt;<br>  &lt;/select&gt;<br>&lt;/template&gt;</pre><pre>&lt;script&gt;<br>export default {<br>  name: &#39;OptionSelectComponent&#39;,<br>  data() {<br>    return {<br>      collection: [...],<br>    }<br>  },<br>  methods: {<br>    handleInput(e) {<br>      this.$emit(&#39;input&#39;, e.target.value)<br>    }<br>  },<br>  mounted() {<br>    this.gettAllIconSizes();<br>  }<br>}<br>&lt;/script&gt;</pre><p>On the page you want to use, use</p><pre>&lt;OptionSelectComponentv-model=&quot;somethingSomething&quot;&gt;&lt;/OptionSelectComponent&gt;</pre><p>and don’t forget to import</p><pre>import OptionSelectComponent from &#39;@/components/OptionSelectComponent.vue&#39;</pre><p>and export the component</p><pre>export default {<br>  components: {<br>    OptionSelectComponent,<br>  },<br>  ...<br>}</pre><p>Annnnd… Bob’s your uncle!</p><h3>Explanation</h3><p>Since it’s &lt;select&gt;&lt;/select&gt;, we have to check using @input which fires when an &lt;option&gt;&lt;/option&gt;is selected.</p><p>We handle the event using handleInput(e)with e (stands for <em>event</em>) as its argument. Then we emit the event along with e.target.value (how I got this? well, just console.log(e) and see which one is the one you you — it’s stupid and it works duh)</p><p>And that’s it. You can modify the code to get the result you want.</p><h3>Reference</h3><ul><li><strong>Add `v-model` Support to Custom Vue.js Component</strong> by <em>Samuel Oloruntoba </em>retrieved from <a href="https://scotch.io/tutorials/add-v-model-support-to-custom-vuejs-component"><em>https://scotch.io/tutorials/add-v-model-support-to-custom-vuejs-component</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3244c52adcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ประชาธิปไตย! มาใช้วิธีโหวตทางเลือกกันเถอะ]]></title>
            <link>https://thammarith.medium.com/lets-use-alternative-voting-81e967d2d589?source=rss-6fe44f5c4c74------2</link>
            <guid isPermaLink="false">https://medium.com/p/81e967d2d589</guid>
            <category><![CDATA[alternative-voiting]]></category>
            <category><![CDATA[การโหวตทางเลือก]]></category>
            <category><![CDATA[แนวคิด]]></category>
            <category><![CDATA[การเลือกตั้ง]]></category>
            <dc:creator><![CDATA[Thammarith]]></dc:creator>
            <pubDate>Sun, 19 Nov 2017 13:31:00 GMT</pubDate>
            <atom:updated>2017-11-19T13:31:00.989Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<blockquote>ก: เที่ยงแล้ว จะกินอะไรดี<br>ทุกคน: อะไรก็ได้<br>ก: งั้นโหวตกัน ใครชอบอันไหน โหวตอันนั้นนะ<br>ทุกคน: อื้ม</blockquote><blockquote>ตู้ม! ผลลัพธ์ <br>- 5คนเลือกข้าวแกงหน้าปากซอย <br>- 4คนเลือกเซเว่น <br>- 3 คนเลือกไม่กินเลย</blockquote><blockquote>สรุปว่าไปกินข้าวแกงหน้าปากซอยนะ</blockquote><p>เห็นปัญหากับการโหวตแบบนี้ไหมครับ?</p><p>5 คนจาก 12 คน (41.66%) เป็นฝ่ายชนะ ทั้ง ๆ ที่อีก 7 คน (58.33%) เลือกอย่างอื่น อย่างนี้เรียกว่า ‘เสียงข้างมาก’ ได้ไหม?</p><p>การโหวตแบบนี้มีชื่อเรียกว่า <strong>First Past the Post </strong>(FPtP) ซึ่งหมายความว่า ใครที่ได้<em>เสียงมากที่สุด</em> ไปก็ชนะ ซึ่งเป็นการโหวตที่พวกเราใช้กันประจำ ไม่ว่าจะเรื่องเล็กเรื่องน้อย เราก็ใช้ระบบการโหวตแบบนี้</p><p>แต่ก็อย่างที่เห็นไปแล้วว่า การโหวตแบบนี้ไม่ได้ตอบโจทย์ทุกคน เพราะในตัวอย่างด้านบน คนเกินครึ่ง (7 คน) กลับแพ้ให้กับคน 5 คน</p><p>ถึงแล้วแล้วหรือยังที่เราจะมาใช้การโหวตแบบ <em>ทางเลือก</em> กัน?</p><h3>การโหวตแบบทางเลือก</h3><p>การโหวตแบบทางเลือกนั้นเกิดจากแนวคิดที่ให้ 1 คนโหวตได้มากกว่า 1 ครั้ง ซึ่งถ้ามองเป็นการเลือกตั้งจะสามารถยกตัวอย่างได้ดังนี้</p><blockquote>มีผู้สมัครจาก 4 พรรคได้แก่ <br>1. พรรค กขค.<br>2. พรรค ฅมฌ.<br>3. พรรค ฅษฌ.<br>4. พรรค ครม.</blockquote><p>ถ้าหากเป็นการโหวตแบบทั่วไป เราก็คงให้กาแค่ 1 พรรคที่ชอบ</p><p>แต่การโหวตแบบทางเลือกนั้น จะให้เลือกว่า <em>ชอบพรรคไหน ตามลำดับ</em></p><p>สมมติผลชอบพรรค กขค. &gt; ครม. &gt; ฅมฌ. &gt; ฅษฌ. เวลาไปเลือก ก็ใส่ตัวเลข 1 – 4 ไปตามลำดับ ซึ่งก็จะเป็น (1) กขค. &gt; (2) ครม. &gt; (3) ฅมฌ. &gt; (4) ฅษฌ. <em>(ซึ่งในความเป็นจริงแล้ว ตัวเลข 1 – 3 ก็น่าจะเพียงพอแล้ว)</em></p><p>หลังจากนั้นเวลานับคะแนน ก็นับว่าใครที่คนใส่หมายเลข 1 ไปมากที่สุด ถ้าคนนั้นคะแนนยังไม่เกินครึ่ง ก็ให้ดูว่าคนที่ใส่หมายเลข 1 ให้พรรคที่ได้หมายเลข 1 น้อยที่สุด (พรรคท้ายตาราง) เลือกพรรคไหนเป็นพรรคที่ 2 แล้วนำคะแนนส่วนนั้นไปทดให้พรรคที่เลือกเป็นหมายเลข 2 ทำแบบนี้ไปเรื่อย ๆ จนกระทั่งได้พรรคที่ได้เกิน 50%</p><p>อาจจะฟังดูซับซ้อน และมันก็เป็นอย่างนั้นจริง ๆ ที่สำคัญ การเลือกแบบนี้ก็ยังมีปัญหาที่ว่าผลลัพธ์ที่ได้ก็ยังไม่ได้บอกสัดส่วนที่ชัดเจนของคนเลือก (ยังเกิดปัญหาแบบในตัวอย่างบนสุดได้) แต่ก็ยังดีกว่าการเลือกแบบที่เราใช้อยู่กันในปัจจุบัน (FPtP)</p><h4>ในเมื่อยังมีปัญหา แล้วจะมาชวนให้ใช้แบบนี้ทำไม!?</h4><p>ก็เพราะว่า มันเป็นทางเลือกที่ดีกว่า FPtP ครับ การเลือกแบบนี้ถึงจะไม่ได้แสดงถึงสัดส่วนของคนโหวตที่ชัดเจน แต่ก็จะได้ตัวเลือกที่คนส่วนมาก <em>ยอมรับ</em></p><h4>แต่ฟังดูงงจังเลยอะ ขอแบบง่าย ๆ ไม่ต้องมาไล่ลำดับได้ไหม?</h4><p>ได้สิครับ!</p><p>เพียงแค่ครั้งต่อไปที่คุณจะทำการโหวต แทนที่จะขอให้ทุกคนเลือก <strong>ตัวเลือกที่ชอบมากที่สุด</strong> ก็ขอให้ทุกคนเลือก <strong>ตัวเลือกที่โอเค</strong> แทน</p><p><strong>ซึ่งนั่นแปลว่า ทุกคนจะโหวตได้มากกว่า 1 ครั้ง</strong></p><p>แล้วแบบนี้มันจะดีหรอ</p><p>ดีสิครับ ลองมาดูตัวอย่างแรกใหม่กัน แต่ครั้งนี้เราจะใช้ระบบโหวตแบบทางเลือกกัน</p><blockquote>- a, b, c, d, e, <strong>f </strong>โอเคกับข้าวแกงหน้าปากซอย <br>- <strong>f</strong>, <strong>g</strong>, h, i, <strong>j </strong>โอเคกับเซเว่น <br>- <strong>a, b, c, g, j</strong>, k, l โอเคกับการไม่กินอะไรเลย</blockquote><p>เห็นไหมครับ? คราวนี้จากที่ทุกคนต้องไปกินข้าวแกงหน้าปากซอย กลับกลายเป็นว่า ทุกคนโอเคกับการที่ไม่ต้องกินอะไรเลย ซึ่งทั้ง ๆ ที่เมื่อกี้มีคนเลือกแค่ 3 คน แต่ตอนนี้กลับมีคนโอเคด้วยถึง 7 คน ซึ่งก็เกินครึ่ง</p><p>ดังนั้น แบบนี้น่าจะดีกว่า</p><h4>แล้วแบบไหนดีสุด</h4><p>การโหวตแบบที่น่าจะดีที่สุด ก็คงเป็น Mixed-Member Proportional Representation (MMPR) ซึ่งให้เลือก 2 ครั้ง เหมือนการเลือกตั้งในไทยที่มีสส.แบบเขต (เพื่อการให้เสียงกับคนพื้นที่) และแบบบัญชีรายชื่อ (เพื่อให้เกิดสัดส่วนที่ถูกต้อง)</p><p>แต่จะกลายเป็นเรื่องที่ยากไป และไม่สะดวกกับการใช้ในชีวิตประจำวันสักเท่าไหร่</p><p>สำหรับคนที่สนใจ ก็สามารถเข้าไปดูได้ที่นี่ครับ <a href="https://www.youtube.com/watch?v=QT0I-sdoSXU">https://www.youtube.com/watch?v=QT0I-sdoSXU</a> (ภาษาอังกฤษ มีซับไตเติล)</p><h3>สรุป</h3><p>โหวตครั้งต่อไป แทนที่จะโหวตให้ตัวเลือกที่ชอบมากที่สุด <strong>ให้โหวตตัวเลือกที่รับได้</strong>แทน ตัวเลือกไหนที่คนรับได้มากที่สุด ก็จะชนะไป</p><p>รู้งี้แล้ว มาใช้การโหวตแบบทางเลือกกันดีกว่า เพราะนอกจากจะเป็นประชาธิปไตยแล้ว ทุกคนก็แฮปปี้ด้วย</p><p><em>เนื้อเรื่องนี้ได้แรงบันดาลใจจากวิดีโอของ CGP Grey (</em><a href="https://youtu.be/orybDrUj4vA"><em>https://youtu.be/orybDrUj4vA</em></a><em>)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81e967d2d589" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>