<?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 Jeff Chan on Medium]]></title>
        <description><![CDATA[Stories by Jeff Chan on Medium]]></description>
        <link>https://medium.com/@chanjeff520?source=rss-ec3e6fa732ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SFronwEhhJ9OPBqz</url>
            <title>Stories by Jeff Chan on Medium</title>
            <link>https://medium.com/@chanjeff520?source=rss-ec3e6fa732ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 03:33:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chanjeff520/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[Preventing Merge Conflicts]]></title>
            <link>https://medium.com/@chanjeff520/preventing-merge-conflicts-2cc5bbab7af?source=rss-ec3e6fa732ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cc5bbab7af</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[vscode]]></category>
            <dc:creator><![CDATA[Jeff Chan]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 00:57:22 GMT</pubDate>
            <atom:updated>2022-11-17T00:57:22.934Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*vymv00r0uxoQI2BXRmiUsQ.png" /></figure><p>It&#39;s the final stretch of a large project. All you need to do is to push the rest of your work onto the team repo. But as you do, you are faced with the dreaded merge conflict. All the files have been slightly changed. Some of the files that you worked on before have suddenly disappeared. You slowly drift into despair, as you frantically try to contact your team member to resolve this problem. However, they also have no idea how to fix this jumbo mess pile. The damage has been done, but here are some tips and tricks for preventing Merge Conflicts next time.</p><p>In order to prevent merge conflict, we need to learn how a merge conflict occurs. It happens when one person changes, deletes, and/or edits a line of code that another team member had pushed up to the repo already. Another way to make a merge conflict is if a file that a team member was working on was deleted from the repo by another group member. These are the most common way of making a merge conflict.</p><p>We need to know that merge conflict is almost inevitable, but with proper practices and communication, you can reduce the size and the number of conflicts you encounter.</p><p><strong>Communication: </strong>Be verbal about the functions and work that you going to do. Keep your teammates up to date with the functions you wrote and new code that you would like to add to the program. Doing so will prevent your teammates from working on work that was assigned to you and will also prevent you from touching work that is assigned to others. Also, try to standardize format rules to prevent ambiguity on how code should look within your program. On Vscode, ESLint is a very useful tool to standardize code. This Vscode extension will add rules to coding to prevent nonstandardized code from ever reaching the light of day.</p><p><strong>Make commits often and keep them small: </strong>By making git commits small, the likelihood of having a large merge conflict will decrease.</p><p><strong>Plan out your program: </strong>Plan all the necessary functions and files beforehand with your group. This will prevent group members from jumping around files. Pseudocode your approach and commit everything a function needs before starting to code anything out.</p><p><strong>Practice on your own: </strong>build good habits by incorporating everything discuss above into your personal project. Make sure to branch whenever you create new features, make pull requests, commit often, and follow your own formatting rules.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cc5bbab7af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fetch]]></title>
            <link>https://medium.com/@chanjeff520/fetch-911355fcced7?source=rss-ec3e6fa732ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/911355fcced7</guid>
            <dc:creator><![CDATA[Jeff Chan]]></dc:creator>
            <pubDate>Wed, 19 Oct 2022 04:23:44 GMT</pubDate>
            <atom:updated>2022-10-19T04:23:44.067Z</atom:updated>
            <content:encoded><![CDATA[<p>AJAX, also known as “Asynchronous JavaScript and XML”, helped pave the wave for the next evolution of web experiences. Many companies transitioned to AJAX in the 2000s and made their website design more utility with the XMLHttpRequest. Not like before, XMLHttpRequest has the ability to fetch data from a web API and update the DOM without refreshing the page. However, Fetch, the modern successor of the XMLHttpRequest, was made and applied many upgrades to the aging AJAX system.</p><p>Unlike AJAX’s XMLHttpRequest, Fetch is a promise-based fetching for requests and responses. This means that Fetch can only fail when there is no connection to the web. Even a wrong URL link inputted into the Fetch function would make it break. The promise is a response object that has the property ‘okay’ that contains a number. Any number 400 or more means there was an error retrieving the data from that URL. The response object is also simplified, making Fetch API calling faster and more efficient than AJAX.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*qY6GVCcjkKkURoPjiW18FA.png" /><figcaption>Example of a Fetch request</figcaption></figure><p>The structure of a Fetch request always starts with <em>fetch(‘&lt;URL&gt;’)</em>. Then the fetch needs <em>.then</em> statements that tell the computer, after the fetching of the URL, what to do next. These next statements require a callback function within the parameters to be used. We usually need that data from the response so we use <em>response.json()</em> to get the data. We can string the <em>.then</em> statement until the desired outcome.</p><p>Another important function that was not in the example above is the await() function. Sometimes problems may arise from the response not being loaded before moving forward. The await() function helps with this by getting the response to completely load before moving on. To use this function, we would wrap the fetch function within the await function like so, <em>await(fetch(…))</em>.</p><p>However, there are some limitations to Fetch. It is currently not possible for Fetch to calculate the total amount of data collected/loaded and the total amount of data. Also, all the legacy browsers do not support Fetch. So something like XMLHttpRequest is able to compute the length of work done and the total amount.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=911355fcced7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>