<?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>Forem: Hyesung Lee</title>
    <description>The latest articles on Forem by Hyesung Lee (@hyesunglee).</description>
    <link>https://forem.com/hyesunglee</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%2F796182%2F08821e0c-ff55-4ce5-a0a3-a0340dcce13c.png</url>
      <title>Forem: Hyesung Lee</title>
      <link>https://forem.com/hyesunglee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hyesunglee"/>
    <language>en</language>
    <item>
      <title>Introducing Hit Counter for Your GitHub or Any Kind of Websites You Want</title>
      <dc:creator>Hyesung Lee</dc:creator>
      <pubDate>Mon, 21 Feb 2022 01:37:06 +0000</pubDate>
      <link>https://forem.com/hyesunglee/introducing-hit-counter-for-your-github-or-any-kind-of-websites-you-want-1681</link>
      <guid>https://forem.com/hyesunglee/introducing-hit-counter-for-your-github-or-any-kind-of-websites-you-want-1681</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwaij8wthlz6n721udgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwaij8wthlz6n721udgh.png" alt="Hits.sh"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Hits?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Hits&lt;/code&gt; is a simple and easy to use web application that counts the number of hits on your website.&lt;/p&gt;

&lt;p&gt;If you're familiar with GitHub, you've probably already seen hit counter in the documentation on the GitHub repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hits.sh/github.com/silentsoft/hits/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fhits.sh%2Fgithub.com%2Fsilentsoft%2Fhits.svg" alt="Hits"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Hits&lt;/code&gt; supports the following three of the most common use cases: &lt;code&gt;Markdown&lt;/code&gt;, &lt;code&gt;HTML&lt;/code&gt; and &lt;code&gt;Image Link&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, to get a hits badge for &lt;code&gt;https://github.com/silentsoft/hits&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Markdown
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;![Hits&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://hits.sh/github.com/silentsoft/hits.svg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;](https://hits.sh/github.com/silentsoft/hits/)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;HTML
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://hits.sh/github.com/silentsoft/hits/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Hits"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://hits.sh/github.com/silentsoft/hits.svg"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Image Link
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  https://hits.sh/github.com/silentsoft/hits.svg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Features in Query String
&lt;/h2&gt;
&lt;h3&gt;
  
  
  view
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;total&lt;/code&gt; (default)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;today-total&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  style
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;flat&lt;/code&gt; (default)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flat-square&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;for-the-badge&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;plastic&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  label
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;For setting the label text instead of the default &lt;code&gt;hits&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  extraCount
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This is useful if you want to add an extra count to your badge. For example, if you want to add a count of &lt;code&gt;1000&lt;/code&gt; to your badge, you can set &lt;code&gt;extraCount=1000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When Do I Need This?&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If the hit counter service you used previously has end-of-service, you can start with any number instead of starting from 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  color, labelColor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Named color by &lt;a href="https://shields.io/" rel="noopener noreferrer"&gt;shields.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Any valid &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" rel="noopener noreferrer"&gt;CSS color&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;named color&lt;/li&gt;
&lt;li&gt;hexadecimal numbers&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rgb[a](red, green, blue[, opacity])&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cmyk[a](cyan, magenta, yellow, black[, opacity])&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hsl[a](hue, saturation, lightness[, opacity])&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  logo
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/simple-icons/simple-icons/blob/develop/slugs.md" rel="noopener noreferrer"&gt;simple-icons slug&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;or data:image/svg+xml;base64,..&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Statistics
&lt;/h2&gt;

&lt;p&gt;You can see the statistics of your website by replacing the &lt;code&gt;.svg&lt;/code&gt; with &lt;code&gt;/&lt;/code&gt; in the URL you used to get the badge.&lt;/p&gt;

&lt;p&gt;For example, to get a statistics for &lt;code&gt;https://github.com/silentsoft/hits&lt;/code&gt; then visit &lt;a href="https://hits.sh/github.com/silentsoft/hits/" rel="noopener noreferrer"&gt;https://hits.sh/github.com/silentsoft/hits/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97l2lcm4u7g8ynsaro9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F97l2lcm4u7g8ynsaro9v.png" alt="Hits Statistics"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Hits&lt;/code&gt; is a simple, easy to use, and free to use hit counter badge for your website.&lt;/p&gt;

&lt;p&gt;Thank you for reading this article. If you like &lt;code&gt;Hits&lt;/code&gt;, give it a 🌟 on &lt;a href="https://github.com/silentsoft/hits" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/silentsoft" rel="noopener noreferrer"&gt;
        silentsoft
      &lt;/a&gt; / &lt;a href="https://github.com/silentsoft/hits" rel="noopener noreferrer"&gt;
        hits
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      📈 Hit Counter for Your GitHub or Any Kind of Websites You Want.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;
  Hits&lt;br&gt;
  &lt;a href="https://status.hits.sh" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Uptime Robot status" src="https://camo.githubusercontent.com/1ae04bbeda60ecb7c5c89b86894fafa5754b06be12cb470defc30298894d74fa/68747470733a2f2f696d672e736869656c64732e696f2f757074696d65726f626f742f7374617475732f6d3738383639313436392d366362356536613163653834346539663634613462303436"&gt;&lt;/a&gt;
  &lt;a href="https://status.hits.sh" rel="nofollow noopener noreferrer"&gt;&lt;img alt="Uptime Robot ratio (30 days)" src="https://camo.githubusercontent.com/a35fe0b10e301df418ba62cbf11da72e592746d4d0f2da0cd8df429c2cb0d518/68747470733a2f2f696d672e736869656c64732e696f2f757074696d65726f626f742f726174696f2f6d3738383639313436392d366362356536613163653834346539663634613462303436"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;
  &lt;a href="https://hits.sh" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fsilentsoft%2Fhits.images%2Fhits-readme.png"&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Hits&lt;/code&gt; supports the following three of the most common use cases: &lt;code&gt;Markdown&lt;/code&gt;, &lt;code&gt;HTML&lt;/code&gt; and &lt;code&gt;Image Link&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, to get a hits badge for &lt;code&gt;https://github.com/silentsoft/hits&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hits.sh/github.com/silentsoft/hits/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5dd2e3e502dfb6791e012bcaa872cc755de95ca56b7c0d078b8bafea6074d55c/68747470733a2f2f686974732e73682f6769746875622e636f6d2f73696c656e74736f66742f686974732e737667" alt="Hits"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Markdown
&lt;div class="highlight highlight-text-md notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-s"&gt;[&lt;/span&gt;&lt;span class="pl-s"&gt;![&lt;/span&gt;Hits&lt;span class="pl-s"&gt;]&lt;/span&gt;&lt;span class="pl-s"&gt;(&lt;/span&gt;&lt;span class="pl-corl"&gt;https://hits.sh/github.com/silentsoft/hits.svg&lt;/span&gt;&lt;span class="pl-s"&gt;)]&lt;/span&gt;&lt;span class="pl-s"&gt;(&lt;/span&gt;&lt;span class="pl-corl"&gt;https://hits.sh/github.com/silentsoft/hits/&lt;/span&gt;&lt;span class="pl-s"&gt;)&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;HTML
&lt;div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-kos"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pl-ent"&gt;a&lt;/span&gt; &lt;span class="pl-c1"&gt;href&lt;/span&gt;="&lt;span class="pl-s"&gt;https://hits.sh/github.com/silentsoft/hits/&lt;/span&gt;"&lt;span class="pl-kos"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pl-kos"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pl-ent"&gt;img&lt;/span&gt; &lt;span class="pl-c1"&gt;alt&lt;/span&gt;="&lt;span class="pl-s"&gt;Hits&lt;/span&gt;" &lt;span class="pl-c1"&gt;src&lt;/span&gt;="&lt;span class="pl-s"&gt;https://hits.sh/github.com/silentsoft/hits.svg&lt;/span&gt;"/&amp;gt;&lt;span class="pl-kos"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="pl-ent"&gt;a&lt;/span&gt;&lt;span class="pl-kos"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Image Link
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;https://hits.sh/github.com/silentsoft/hits.svg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features in Query String&lt;/h2&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;view&lt;/h3&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;total&lt;/code&gt; (default)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;today-total&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;style&lt;/h3&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;flat&lt;/code&gt; (default)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flat-square&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;for-the-badge&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;plastic&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;label&lt;/h3&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;For setting the label text instead of the default &lt;code&gt;hits&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;extraCount&lt;/h3&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;This is useful if you want to add an extra count to your badge. For example, if you want to add a count of &lt;code&gt;1000&lt;/code&gt; to your badge, you can set &lt;code&gt;extraCount=1000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When Do I Need This?&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;If the hit counter service you used previously has end-of-service, you can start with any number instead of starting…&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/silentsoft/hits" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


</description>
      <category>github</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>What Kind of Tool Do You Use to Control Spring Batch Jobs?</title>
      <dc:creator>Hyesung Lee</dc:creator>
      <pubDate>Thu, 27 Jan 2022 00:40:16 +0000</pubDate>
      <link>https://forem.com/hyesunglee/what-kind-of-tool-do-you-use-to-control-spring-batch-jobs-2a16</link>
      <guid>https://forem.com/hyesunglee/what-kind-of-tool-do-you-use-to-control-spring-batch-jobs-2a16</guid>
      <description>&lt;p&gt;Are there any open source tools you are using or know of to do something like below?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Perform Jobs&lt;/li&gt;
&lt;li&gt;Monitoring Jobs (stats, log, ..)&lt;/li&gt;
&lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>opensource</category>
      <category>spring</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Measuring Code Execution Time Using Stopwatch</title>
      <dc:creator>Hyesung Lee</dc:creator>
      <pubDate>Wed, 26 Jan 2022 02:36:33 +0000</pubDate>
      <link>https://forem.com/hyesunglee/measuring-code-execution-time-using-stopwatch-3kg3</link>
      <guid>https://forem.com/hyesunglee/measuring-code-execution-time-using-stopwatch-3kg3</guid>
      <description>&lt;p&gt;You might have used the &lt;code&gt;System.out.println(end - start + "ms elapsed")&lt;/code&gt; through &lt;code&gt;System.currentTimeMillis()&lt;/code&gt; to measure the execution time of a piece of code.&lt;/p&gt;

&lt;p&gt;If you have a small number of code points to measure, it can be quite appropriate to do this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But when we have a lot of code points to measure, this makes us difficult.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bXJ5ivyz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/dTP4cRnO9bEAAAAC/sweating-nervous.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bXJ5ivyz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/dTP4cRnO9bEAAAAC/sweating-nervous.gif" alt="" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to see the result with a meaningful name and how much of the total time it takes, you have to add cumbersome code to do it. like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;initStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// initialization&lt;/span&gt;
&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;initEnd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;processingStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// processing&lt;/span&gt;
&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;processingEnd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentTimeMillis&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"initialization: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;initEnd&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;initStart&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"ms"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"processing: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;processingEnd&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;processingStart&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"ms"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"total: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"ms"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5vSdZgff--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/Rv1xH5kdMu8AAAAC/endgame-now.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5vSdZgff--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/Rv1xH5kdMu8AAAAC/endgame-now.gif" alt="" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  It's Time to Use Stopwatch
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/silentsoft/stopwatch"&gt;Stopwatch&lt;/a&gt; is a library that helps you measure the execution time of a piece of code with a meaningful name and how much of the total time it takes.&lt;/p&gt;

&lt;p&gt;We can simply use it like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Stopwatch&lt;/span&gt; &lt;span class="n"&gt;stopwatch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Stopwatch&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"initialization"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"processing"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rendering"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;print&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;stopwatch.print()&lt;/code&gt; will give you the result like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|           name |     % |      ms |      s |
|----------------|-------|---------|--------|
| initialization | 59.5% | 1,234ms | 1.234s |
|     processing | 40.0% |   830ms | 0.830s |
|      rendering |  0.5% |    10ms | 0.010s |
|                |       |         |        |
|          total |  100% | 2,074ms | 2.074s |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  One More Thing
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7asLTBmf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/kPoUqVlwGg0AAAAC/benedict-cumberbatch-endgame.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7asLTBmf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://c.tenor.com/kPoUqVlwGg0AAAAC/benedict-cumberbatch-endgame.gif" alt="" width="498" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Stopwatch can be paused and resumed to remove the time between code points where you do not want to measure. like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"rendering"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// prepare rendering&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pause&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// load font stuff&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// render&lt;/span&gt;
&lt;span class="n"&gt;stopwatch&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stop&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Stopwatch can remove chores from your code. If you have a lot of code points to measure, or you want to see the result with a meaningful name and how much of the total time it takes, you can use it.&lt;/p&gt;

&lt;p&gt;Thank you for reading this article. If you like Stopwatch, give it a 🌟 on &lt;a href="https://github.com/silentsoft/stopwatch"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/silentsoft"&gt;
        silentsoft
      &lt;/a&gt; / &lt;a href="https://github.com/silentsoft/stopwatch"&gt;
        stopwatch
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      ⚡ Stopwatch for get rid of chore in your code.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Stopwatch&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://search.maven.org/artifact/org.silentsoft/stopwatch" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/bc12206c568398c7ac03268037aea8b58aaf9404c41b07efc3f88a672baf4a21/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6f72672e73696c656e74736f66742f73746f707761746368" alt="Maven Central"&gt;&lt;/a&gt;
&lt;a href="https://app.travis-ci.com/silentsoft/stopwatch" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/537a037939c3166f38f20edc19485ca89a49e9eae9d263ac23072ba43c00ff2d/68747470733a2f2f6170702e7472617669732d63692e636f6d2f73696c656e74736f66742f73746f7077617463682e7376673f6272616e63683d6d61696e" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://sonarcloud.io/dashboard?id=silentsoft_stopwatch" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/622f177180c4f98dce677268b50d3dfb8c2f9a9eeed626502e2b957e4ac1c304/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d73696c656e74736f66745f73746f707761746368266d65747269633d616c6572745f737461747573" alt="Quality Gate Status"&gt;&lt;/a&gt;
&lt;a href="https://sonarcloud.io/dashboard?id=silentsoft_stopwatch" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/6430670d0ae88d4d0815338643566f27ada2bc45d568234bf181a156d6673e50/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d73696c656e74736f66745f73746f707761746368266d65747269633d636f766572616765" alt="Coverage"&gt;&lt;/a&gt;
&lt;a href="https://hits.sh" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/35995d451bfd96256ba2467c33f681ca4d7bd60d2cd96247145fc9024a0470da/68747470733a2f2f686974732e73682f6769746875622e636f6d2f73696c656e74736f66742f73746f7077617463682e737667" alt="Hits"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Stopwatch&lt;/code&gt; for get rid of chore in your code.&lt;/p&gt;
&lt;h2&gt;
Usage&lt;/h2&gt;
&lt;div class="highlight highlight-source-java position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-smi"&gt;Stopwatch&lt;/span&gt; stopwatch &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;new&lt;/span&gt; &lt;span class="pl-smi"&gt;Stopwatch&lt;/span&gt;();

stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;start(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;initialization&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;);
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;//&lt;/span&gt; ...&lt;/span&gt;
stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;stop();

stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;start(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;processing&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;);
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;//&lt;/span&gt; ...&lt;/span&gt;
stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;stop();

stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;start(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;rendering&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;);
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;//&lt;/span&gt; ...&lt;/span&gt;
stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;stop();

stopwatch&lt;span class="pl-k"&gt;.&lt;/span&gt;print();&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Result&lt;/h2&gt;
&lt;div class="snippet-clipboard-content position-relative overflow-auto"&gt;&lt;pre&gt;&lt;code&gt;|           name |     % |      ms |      s |
|----------------|-------|---------|--------|
| initialization | 59.5% | 1,234ms | 1.234s |
|     processing | 40.0% |   830ms | 0.830s |
|      rendering |  0.5% |    10ms | 0.010s |
|                |       |         |        |
|          total |  100% | 2,074ms | 2.074s |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;
Maven Central&lt;/h2&gt;
&lt;div class="highlight highlight-text-xml position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&amp;lt;&lt;span class="pl-ent"&gt;dependency&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class="pl-ent"&gt;groupId&lt;/span&gt;&amp;gt;org.silentsoft&amp;lt;/&lt;span class="pl-ent"&gt;groupId&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class="pl-ent"&gt;artifactId&lt;/span&gt;&amp;gt;stopwatch&amp;lt;/&lt;span class="pl-ent"&gt;artifactId&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class="pl-ent"&gt;version&lt;/span&gt;&amp;gt;2.2.1&amp;lt;/&lt;span class="pl-ent"&gt;version&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="pl-ent"&gt;dependency&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
Contributing&lt;/h2&gt;
&lt;p&gt;Pull requests are welcome. For major changes, please open an issue first to discuss what you would like…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/silentsoft/stopwatch"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>java</category>
      <category>opensource</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>5 Things You Should Remember When You Are Getting Code Review</title>
      <dc:creator>Hyesung Lee</dc:creator>
      <pubDate>Mon, 24 Jan 2022 17:00:34 +0000</pubDate>
      <link>https://forem.com/hyesunglee/5-things-you-should-remember-when-you-are-getting-code-review-1536</link>
      <guid>https://forem.com/hyesunglee/5-things-you-should-remember-when-you-are-getting-code-review-1536</guid>
      <description>&lt;p&gt;Code review is an essential part of creating high quality software.&lt;/p&gt;

&lt;p&gt;One of the things that I disappointed while reviewing co-workers code at work a few years ago was the attitude. In a code review conducted with several people, if one of them speaks emotionally, the person who is receiving the review is likely to be tired and upset. No matter how code review to make better software, but who would like it if they heard sadistic words when they did their best?&lt;/p&gt;

&lt;p&gt;So I'm going to summarize the 5 things that I think would be fine if we knew each other.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Avoid Aggressive Questions
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why did you write it like this?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This kind of question makes the listener feel uncomfortable. And it embarrasses people who are watching the code review. Remember the purpose of code review. We are doing this not to criticize other people's code and/or to imprint that who is more superior but to find bugs in advance and make better software.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How about this one?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's start to talk like this. However, we should make it clear that it is not a personal taste by giving a proper explanation or reason.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Listen First and Speak Last
&lt;/h2&gt;

&lt;p&gt;If the reviewer keeps making comments while he/she is explaining the code and intention, the flow will break repeatedly. And not only who are receiving code review but also those who are watching the code review are getting tired. Taking notes or remembering rather than immediately discussing improvements or questions about code is much more effective at avoiding emotional comments. Because it makes you think again.&lt;/p&gt;

&lt;p&gt;At this moment, the person who wrote the code will need the trick of cutting it off properly so that it will not be taken too long like in terms of class file or small business unit.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Praise and Encourage Immediately
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"I think this code is very good."&lt;/p&gt;

&lt;p&gt;"Looking at the code you wrote, you must have had a hard time..."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What more needs to be said?&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Avoid Unnecessary Arguments
&lt;/h2&gt;

&lt;p&gt;There is no worse code review than discussing "Declaring variables across multiple lines v.s. Declaring variables side-by-side with commas". Of course, that wasn't the main issue of the code review but let's respect other people's tastes. Nevertheless, if it is bothering you, defining code conventions after gaining majority consent can be a good way to avoid unnecessary arguments.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Give Direction for Good Code, but Don’t Force It
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"You have to change this line like this."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Is it an industry standard? Then accept it. Is it a ground rule on your team? Accept it too. Is there a potential possibility of an error if you don't change it? Fix it right away.&lt;/p&gt;

&lt;p&gt;What I mean is don't force changes to code that works regardless of the changes. If it is not a violation of an industry standard or ground rule, then it should be their choice whether to change it or not. If the reviewer forces such a code so that members receives a negative result such as &lt;strong&gt;Failed&lt;/strong&gt; or &lt;strong&gt;Rejected&lt;/strong&gt;, then the team members will blame themselves. Furthermore, the morale of the entire team will drop at some point. These threats should be eliminated whenever possible.&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Semantic Emptiness of Objects in the If Statement</title>
      <dc:creator>Hyesung Lee</dc:creator>
      <pubDate>Wed, 19 Jan 2022 03:11:10 +0000</pubDate>
      <link>https://forem.com/hyesunglee/the-semantic-emptiness-of-objects-in-the-if-statement-do1</link>
      <guid>https://forem.com/hyesunglee/the-semantic-emptiness-of-objects-in-the-if-statement-do1</guid>
      <description>&lt;h2&gt;
  
  
  Philosophy
&lt;/h2&gt;

&lt;p&gt;A semantic emptiness is a key concept used to indicate the absence of a value. Even if an object is not actually referenced as &lt;code&gt;null&lt;/code&gt;, it can be considered &lt;code&gt;null&lt;/code&gt; if it is semantically filled with empty values.&lt;/p&gt;

&lt;h3&gt;
  
  
  In the beginning there was...
&lt;/h3&gt;

&lt;p&gt;You had to convert an empty value to &lt;code&gt;null&lt;/code&gt; to persist it in a database. Also you had to convert &lt;code&gt;null&lt;/code&gt; to an empty string to display it in a GUI or something elsewhere like Stream or Writer. If you don't want to use &lt;code&gt;null&lt;/code&gt; at all, you had to write a code to getting default value/object. like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;entity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;entity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;entity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Okay, That's totally fine. But how about this?
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;entity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Nullify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;in some cases, you might want to use empty string(&lt;code&gt;""&lt;/code&gt;) instead of &lt;code&gt;null&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Nullify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Further, checking for semantically empty
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;collection&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;collection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;asList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"default_value"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;isSemanticallyEmpty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;isSemanticallyEmpty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isSemanticallyEmpty&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;collection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;asList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"default_value"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;above code can also be replaced with:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Nullify&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;collection&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Arrays&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;asList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"default_value"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're tired of writing code that checks whether a value is semantically empty or not, you can use &lt;a href="https://github.com/silentsoft/nullify"&gt;Nullify&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/silentsoft"&gt;
        silentsoft
      &lt;/a&gt; / &lt;a href="https://github.com/silentsoft/nullify"&gt;
        nullify
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Nullify for null representations and assertions of objects.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Nullify&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://search.maven.org/artifact/org.silentsoft/nullify" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/1044197b5ffebef02cc3e36454eb10479e2aabb1afcdf9ca71967879102ef4ca/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6f72672e73696c656e74736f66742f6e756c6c696679" alt="Maven Central"&gt;&lt;/a&gt;
&lt;a href="https://app.travis-ci.com/silentsoft/nullify" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/26e9abf7cc788fd5b033237682b0e639e314d3329010beb0691c6ab950dc7969/68747470733a2f2f6170702e7472617669732d63692e636f6d2f73696c656e74736f66742f6e756c6c6966792e7376673f6272616e63683d6d61696e" alt="Build Status"&gt;&lt;/a&gt;
&lt;a href="https://sonarcloud.io/dashboard?id=silentsoft_nullify" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/65c40e65048f2974b6b5041d5417e32afb84cf1c4e1cafcf6e1dd1fe4c3e5207/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d73696c656e74736f66745f6e756c6c696679266d65747269633d616c6572745f737461747573" alt="Quality Gate Status"&gt;&lt;/a&gt;
&lt;a href="https://sonarcloud.io/dashboard?id=silentsoft_nullify" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/77461774339f0eed87dedc09cde0852e414beaa63ecacefda41df2a9f04dcb48/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d73696c656e74736f66745f6e756c6c696679266d65747269633d636f766572616765" alt="Coverage"&gt;&lt;/a&gt;
&lt;a href="https://hits.sh" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/77033579831923776d4a74e0d5a8a34326a42cd87c153b7dc59adc016fb03e3c/68747470733a2f2f686974732e73682f6769746875622e636f6d2f73696c656e74736f66742f6e756c6c6966792e737667" alt="Hits"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Nullify&lt;/code&gt; for null representations and assertions of objects.&lt;/p&gt;
&lt;h2&gt;
Philosophy&lt;/h2&gt;
&lt;p&gt;A semantic emptiness is a key concept used to indicate the absence of a value
Even if an object is not actually referenced as &lt;code&gt;null&lt;/code&gt;, it can be considered &lt;code&gt;null&lt;/code&gt; if it is semantically filled with empty values.&lt;/p&gt;
&lt;h3&gt;
In the beginning there was...&lt;/h3&gt;
&lt;p&gt;You had to convert an empty value to &lt;code&gt;null&lt;/code&gt; to persist it in a database
Also you had to convert &lt;code&gt;null&lt;/code&gt; to an empty string to display it in a GUI or something elsewhere like Stream or Writer
If you don't want to use &lt;code&gt;null&lt;/code&gt; at all, you had to write a code to getting default value/object. like this:&lt;/p&gt;
&lt;div class="highlight highlight-source-java position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;if&lt;/span&gt; (value &lt;span class="pl-k"&gt;!=&lt;/span&gt; &lt;span class="pl-c1"&gt;null&lt;/span&gt; &lt;span class="pl-k"&gt;&amp;amp;&amp;amp;&lt;/span&gt; value&lt;span class="pl-k"&gt;.&lt;/span&gt;length() &lt;span class="pl-k"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;0&lt;/span&gt;) {
    entity&lt;span class="pl-k"&gt;.&lt;/span&gt;setValue(&lt;span class="pl-c1"&gt;null&lt;/span&gt;);
} &lt;span class="pl-k"&gt;else&lt;/span&gt; {
    entity&lt;span class="pl-k"&gt;.&lt;/span&gt;setValue(value);
}&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;div class="highlight highlight-source-java position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;entity&lt;span class="pl-k"&gt;.&lt;/span&gt;setValue(value &lt;span class="pl-k"&gt;==&lt;/span&gt; &lt;span class="pl-c1"&gt;null&lt;/span&gt; &lt;span class="pl-k"&gt;||&lt;/span&gt; value&lt;span class="pl-k"&gt;.&lt;/span&gt;length() &lt;span class="pl-k"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;0&lt;/span&gt; &lt;span class="pl-k"&gt;?&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/silentsoft/nullify"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>java</category>
      <category>opensource</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
