<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Noboru Ishikura</title>
    <description>The latest articles on DEV Community by Noboru Ishikura (@noboru_i).</description>
    <link>https://dev.to/noboru_i</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F703299%2Fc550991e-1983-4340-9603-718faec985c6.JPG</url>
      <title>DEV Community: Noboru Ishikura</title>
      <link>https://dev.to/noboru_i</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/noboru_i"/>
    <language>en</language>
    <item>
      <title>Point of code review (Basic)</title>
      <dc:creator>Noboru Ishikura</dc:creator>
      <pubDate>Sun, 12 Sep 2021 01:42:29 +0000</pubDate>
      <link>https://dev.to/noboru_i/point-of-code-review-basic-41oe</link>
      <guid>https://dev.to/noboru_i/point-of-code-review-basic-41oe</guid>
      <description>&lt;h2&gt;
  
  
  overview
&lt;/h2&gt;

&lt;p&gt;When I review the code at work, I follow the flow below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Develop locally by the implementer.&lt;/li&gt;
&lt;li&gt;Push the code to GitHub.&lt;/li&gt;
&lt;li&gt;Create a Pull Request (PR).&lt;/li&gt;
&lt;li&gt;Assign to the reviewer.&lt;/li&gt;
&lt;li&gt;Review and add some comments.&lt;/li&gt;
&lt;li&gt;The implementer replies with a comment or pushes modified code.&lt;/li&gt;
&lt;li&gt;4. Return to&lt;/li&gt;
&lt;li&gt;When there are no comments in the review, it is merged and the work is completed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I wrote a basic "code review point" in this article.&lt;br&gt;
Because I want the implementer to check it myself before requesting a review.&lt;br&gt;
That makes improving the accuracy of the code review.&lt;/p&gt;

&lt;p&gt;For more details, please read O'Reilly's "The Art of Readable Code".&lt;/p&gt;
&lt;h2&gt;
  
  
  Write PR description
&lt;/h2&gt;

&lt;p&gt;Describe the reason for code changes and overview in the "Summary" of the PR.&lt;br&gt;
At a minimum, issues and ticket links that triggered the change are required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's a pain to read through the code without knowing any overview of what the changes are.&lt;br&gt;
By reading the "Summary", the reviewer can imagine the code difference and easy to review.&lt;/p&gt;
&lt;h2&gt;
  
  
  TODO comment
&lt;/h2&gt;

&lt;p&gt;Leave "TODO comments" if you have uncompleted tasks in the PR.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ideally, one PR should complete one "task".&lt;/p&gt;

&lt;p&gt;However, for various reasons during development, there will be situations like "I want you to review it in the middle".&lt;br&gt;
At that time, it is difficult for the reviewer to read while understanding "what is done and what is not done".&lt;br&gt;
TODO comments in the code help it.&lt;/p&gt;

&lt;p&gt;In addition, the editor or IDE has a function that lists "TODO comments", which is also effective for organizing remaining issues later.&lt;/p&gt;

&lt;p&gt;good&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// TODO: foo API is not implemented. So I return dummy data.&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Delete comment out
&lt;/h2&gt;

&lt;p&gt;Delete physically the code that is temporarily written for debugging or that is to be deleted. (unless there is a special reason.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are developing with history management on GitHub.&lt;br&gt;
We can search deletion history by PR search and git blame.&lt;br&gt;
So you should remove any code you no longer need.&lt;/p&gt;

&lt;p&gt;If a lot of useless code remains as a comment, it will be noisy when searching for the code, and the code will be difficult to read.&lt;/p&gt;
&lt;h2&gt;
  
  
  Early return
&lt;/h2&gt;

&lt;p&gt;Make good use of the return statement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When reading the code, we basically read from top to bottom.&lt;br&gt;
However, if there is an if statement, we may read the contents after knowing "whether else-if continues, and what we are doing after they are finished".&lt;br&gt;
If "actually, the content of the function was only an if statement", it would be a waste of time on the reviewer.&lt;/p&gt;

&lt;p&gt;It will be easier to read if the code has a return statement and shows it clearly to exit the function.&lt;/p&gt;

&lt;p&gt;bad&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;some_long_method&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;                &lt;span class="c1"&gt;// 1. find if block. search end of the block.&lt;/span&gt;
    &lt;span class="c1"&gt;// some long process    // 4. read inside the block.&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;                         &lt;span class="c1"&gt;// 2. find end block. read next line.&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;              &lt;span class="c1"&gt;// 3. find "return". So I know "if !foo, return null only". So scroll up to read inside the block.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;good&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;some_long_method&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;           &lt;span class="c1"&gt;// 1. find if block. Also find next "return" line.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="c1"&gt;// some long process  // 2. read the process.&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;baz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  boolean variable naming
&lt;/h2&gt;

&lt;p&gt;Name the boolean variable name as &lt;code&gt;isXXX&lt;/code&gt; so that it can be read like an English sentence such as &lt;code&gt;{class name} is XXX&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, if the variable name is &lt;code&gt;isUplaod&lt;/code&gt;, it is "be verb + verb".&lt;br&gt;
So it cannot be read like an English sentence.&lt;br&gt;
If it is &lt;code&gt;isUplaoding&lt;/code&gt;, it can be read as English like "{The class} is uploading".&lt;/p&gt;

&lt;p&gt;However, boolean types do not necessarily have to be in the form &lt;code&gt;isXXX&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;canUpload&lt;/code&gt; and &lt;code&gt;hasChildren&lt;/code&gt; are good names because you can understand "when the value is &lt;code&gt;true&lt;/code&gt;".&lt;/p&gt;
&lt;h2&gt;
  
  
  Commonization
&lt;/h2&gt;

&lt;p&gt;Extract methods that are likely to be used on other screens of the system, so that they can be used in common.&lt;br&gt;
Such as tax-excluded / tax-included amount calculation and special date formats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some calculations (such as the amount excluding tax) don't change for each process.&lt;br&gt;
And, the same calculation should be performed the same work through the system.&lt;br&gt;
If such calculations are scattered throughout the code, it is difficult to find and correct when the calculation is wrong or when the requirements change.&lt;br&gt;
Therefore, the same process should be cut out into a single function and shared.&lt;/p&gt;

&lt;p&gt;However, there are some cautions.&lt;br&gt;
Don't be commonize the processes that are "accidentally" matched.&lt;br&gt;
For example, the calculation of "the game score multiplied by 1.1" and "the calculation of the tax-included price with a tax rate of 10%" should not be commonized even at the same 1.1 times.&lt;/p&gt;
&lt;h2&gt;
  
  
  Reduce "state"
&lt;/h2&gt;

&lt;p&gt;Reduce "states" as much as possible.&lt;br&gt;
Calculate values that can be calculated from other "states".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can give a class a "state" just by writing &lt;code&gt;let foo;&lt;/code&gt;.&lt;br&gt;
However, if you have it as a "state", you have to think about various things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When will it be initialized?&lt;/li&gt;
&lt;li&gt;When will it be updated?&lt;/li&gt;
&lt;li&gt;What is the value when this function is called?&lt;/li&gt;
&lt;li&gt;What value can be taken when another "state" is a specific value?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more "states" you manage, the harder it is to read the code and the more causes to bug.&lt;br&gt;
Calculate the value that can be calculated from other "states" by calculation.&lt;/p&gt;

&lt;p&gt;bad&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;hasError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newMessage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;hasError&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newMessage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;printError&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;hasError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message is &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;errorMessage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;good&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;hasError&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;setError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newMessage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;newMessage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;printError&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;hasError&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message is &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;errorMessage&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Manage const values (even if the values havn't been determined)
&lt;/h2&gt;

&lt;p&gt;Even if the information is not determined at the time of implementation, make constant according to the meaning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;bad&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;method1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: Change value if tems URL is fixed.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;method2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// TODO: Change value if tems URL is fixed.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;good&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// TODO: Change value if tems URL is fixed.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;TERMS_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;method1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;TERMS_URL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;method2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;TERMS_URL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Make visibility as low as possible
&lt;/h2&gt;

&lt;p&gt;Keep unnecessary things out of sight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If unnecessary functions/values have "export", it will be difficult to understand "where is it used" and "what is the range of side effects if the contents are changed".&lt;br&gt;
Don't "export" it now even if it "may be used in the future".&lt;/p&gt;

&lt;p&gt;Similarly, when declaring variables, try to reduce the number of lines that can be accessible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read your changes again
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;detail&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Read the diffs again before requesting a PR review.&lt;br&gt;
If you look at GitHub in your browser, you'll see a tab called "Files changed" that makes it easy to see the differences that are included in the PR.&lt;/p&gt;

&lt;p&gt;In particular, check the following points.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are not there any changes you didn't intend? (e.g. Accidentally touched the keyboard. Changes that are not related to PR.)&lt;/li&gt;
&lt;li&gt;Are there all changes you intended?&lt;/li&gt;
&lt;li&gt;Does the difference match what you wrote in the PR overview?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Finally
&lt;/h2&gt;

&lt;p&gt;It is tiring to point out small details or point out a simple mistake.&lt;br&gt;
Let's make our code review meaningful by being careful at the time of implementation and before review.&lt;/p&gt;

</description>
      <category>codereview</category>
    </item>
  </channel>
</rss>
