<?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: Ayobami Ogundiran</title>
    <description>The latest articles on DEV Community by Ayobami Ogundiran (@codingnninja).</description>
    <link>https://dev.to/codingnninja</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%2F77816%2F4b30c7ea-b2c2-467e-9356-04ac7f94e127.jpg</url>
      <title>DEV Community: Ayobami Ogundiran</title>
      <link>https://dev.to/codingnninja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codingnninja"/>
    <language>en</language>
    <item>
      <title>Clients care about the stack you use.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Mon, 01 Dec 2025 09:10:39 +0000</pubDate>
      <link>https://dev.to/codingnninja/clients-care-about-the-stack-you-use-g2g</link>
      <guid>https://dev.to/codingnninja/clients-care-about-the-stack-you-use-g2g</guid>
      <description>&lt;p&gt;It is a common saying that "clients don't care about the stack you use for them" but I disagree.&lt;/p&gt;

&lt;p&gt;I think most devs don't know how to tell their clients to realise they care.&lt;/p&gt;

&lt;p&gt;You have a clear advantage if your clients are technical and you're able to communicate the benefits they will gain as a result of your skills in the stack and the general advantage of the stack in as much as you understand your clients.&lt;/p&gt;

&lt;p&gt;Being able to communicate your stack to your clients with the language they understand gives you advantages over someone who doesn't tell their clients the stack they use because they think clients don't care.&lt;/p&gt;

&lt;p&gt;For example, you can tell your client you're going to use React.js, GCP or AWS by saying:&lt;/p&gt;

&lt;p&gt;"We will build your app with the same technologies that power great companies like Google and Facebook so that you can sleep well at night."&lt;/p&gt;

&lt;p&gt;Saying this makes them realise you're trying to make sure they have stable apps like Google and Facebook.&lt;/p&gt;

&lt;p&gt;Wait! I strongly believe it is unethical to make this kind of claim when you're not skillful, willing and able to deliver.&lt;/p&gt;

&lt;p&gt;Above all, the point I am trying to make is that clients care about the stack you use for them if you know how to tell them.&lt;/p&gt;

&lt;p&gt;What do you think? If you agree, please give more insights on how to gain more advantages by telling you clients the stack you use but if you disagree, feel free to raise your case.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>career</category>
      <category>discuss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Recursion is not a function calling itself!</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Fri, 14 Feb 2025 19:09:44 +0000</pubDate>
      <link>https://dev.to/codingnninja/recursion-is-not-a-function-calling-itself-e0</link>
      <guid>https://dev.to/codingnninja/recursion-is-not-a-function-calling-itself-e0</guid>
      <description>&lt;p&gt;I noticed the common definition of recursion that "It is a function calling itself" is wrong.&lt;/p&gt;

&lt;p&gt;Wait! Don't react yet. Hear me out first; is the function below a loop or recursion?&lt;/p&gt;

&lt;p&gt;Note: If you want a video version of this explanation, watch &lt;a href="https://youtu.be/Ic67BgbMwqI?si=gHkYu3khC_Bjy5UQ" rel="noopener noreferrer"&gt;What is recursion&lt;/a&gt;.&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="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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;count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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="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="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// access function&lt;/span&gt;
&lt;span class="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know you're probably going to say it is recursion because of the common definition but it is not — it is a loop.&lt;/p&gt;

&lt;p&gt;If you check the console, nothing will be repeated but the output of recursion must be a repetition of a structure.&lt;/p&gt;

&lt;p&gt;Is recursion really a case of a function calling itself? I don't think so.&lt;/p&gt;

&lt;p&gt;I came to this realization when I was building &lt;a href="//coding%20ninja.github.io/koras"&gt;koras.jsx&lt;/a&gt; that uses &lt;em&gt;Constant Reactivity&lt;/em&gt; and it is implemented in a way that looks like it is recursive but it is not.&lt;/p&gt;

&lt;p&gt;I will get back to that later but let's focus on recursion first. Then, what is recursion if it is not a function calling itself?&lt;/p&gt;

&lt;p&gt;Before I define what recursion is, it is important I define what a loop is for clarification.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a loop?
&lt;/h2&gt;

&lt;p&gt;A loop is an operation that applies a process to a series or sequence of elements once until the last element (if any) or continue till infinity.&lt;/p&gt;

&lt;p&gt;That means a loop doesn't go back to reapply the same process to already processed elements.&lt;/p&gt;

&lt;p&gt;Now, let's go back to the previous function so that you realize it is a loop:&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="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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;count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&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="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="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// access function&lt;/span&gt;
&lt;span class="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will notice that, even though the function calls itself to move to the next line of action, it doesn't reapply the same process to the same element(s).&lt;/p&gt;

&lt;p&gt;If you log the count in the console, nothing will be recursive, that is, repeat the same index, structure or item(s).&lt;/p&gt;

&lt;p&gt;That means, you can implement a loop with a function. So a function calling itself is not &lt;strong&gt;&lt;em&gt;a criterion to determine a recursion&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's compare the function above with a while loop for clarification.&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;depth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;depth&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="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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&gt;depth&lt;/span&gt;&lt;span class="o"&gt;--&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;The countdown &lt;code&gt;function&lt;/code&gt; is very similar to the above while loop because they get similar results with similar structures. Can you see it is a loop? Okay.&lt;/p&gt;

&lt;p&gt;Did you say "How do you define and identify a recursion?"? Keep on reading.&lt;/p&gt;

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

&lt;p&gt;It is a repetition of an operation on the same element(s) by always starting from the beginning to the end and then starting again, again and again until the stopping point (if any); if not, it continues till infinity.&lt;/p&gt;

&lt;p&gt;Recursion always repeats the same process on the same elements several times until the stopping point is reached or it continues till infinity.&lt;/p&gt;

&lt;p&gt;We have some examples of recursion in the real world. A good example are the days of the week or February 14.&lt;/p&gt;

&lt;p&gt;A week always starts from Monday; continues to Sunday and goes backs to Monday again, again and again.&lt;/p&gt;

&lt;p&gt;Here we are again; it is VAL🥰. Isn't VAL recursive? Yes, it is.&lt;/p&gt;

&lt;p&gt;That is recursion.&lt;/p&gt;

&lt;p&gt;If you write a function to achieve weeks in continuity, it will automatically be recursive because you will always reapply the same process to the same elements again and again.&lt;/p&gt;

&lt;p&gt;And if you log it to the console, you will see that items will be repeated in a certain structure, if not, it is not recursion.&lt;/p&gt;

&lt;p&gt;You can achieve recursion with a loop or a function. So, instead of saying a recursion is defined as a function calling itself, you had better say it is a repeated process reapplied to or within the same element(s).&lt;/p&gt;

&lt;p&gt;Now, let's write true recursion with a loop and a function.&lt;/p&gt;

&lt;p&gt;We're going to turn the previous &lt;code&gt;countdown&lt;/code&gt; function to recursion by backtracking it.&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="nf"&gt;startCountdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;backtrackCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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;backtrackCount&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Countdown stopped after 5 backtracks.&lt;/span&gt;&lt;span class="dl"&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&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;n&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Restarting countdown!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;startCountdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;backtrackCount&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&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="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;startCountdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;backtrackCount&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="nf"&gt;startCountdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is true recursion. If you check the console, you will see that a structure is repeated.&lt;/p&gt;

&lt;p&gt;We can achieve the same with a while loop as in below:&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="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&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;backtrackCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;backtrackCount&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&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;n&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Restarting countdown!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;backtrackCount&lt;/span&gt;&lt;span class="o"&gt;++&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Countdown stopped after 5 backtracks.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;countdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We get the same results despite the second function doesn't call itself. &lt;/p&gt;

&lt;p&gt;If it achieves recursive effects without calling itself, isn't it wrong or incomplete to say recursion is a function calling itself? Yes it is wrong!&lt;/p&gt;

&lt;p&gt;That is an obvious explanation to claim a function calling itself is not a correct definition of recursion and so it is misrepresenting what recursion is.&lt;/p&gt;

</description>
      <category>concept</category>
      <category>recursion</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Why I won't use querySelector again.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Tue, 14 Jan 2025 05:59:14 +0000</pubDate>
      <link>https://dev.to/codingnninja/why-i-wont-use-queryselector-again-3mod</link>
      <guid>https://dev.to/codingnninja/why-i-wont-use-queryselector-again-3mod</guid>
      <description>&lt;p&gt;The JavaScript ecosystem is always evolving and it is time for another wave of the future.&lt;/p&gt;

&lt;p&gt;We all loved it when jQuery was baked into browsers as &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt;. The DOM methods make accessing the DOM a lot better.&lt;/p&gt;

&lt;p&gt;Recently, I had some experience that practically proved to me that using both &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt; is sticking to the distant past while missing many juicy features in Javascript.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt; means you can't destructure the DOM, access the DOM consistently, simplify multiple selections and reduce typing difficulties. Now, let's dive deeper so that you can realize all you're missing already.&lt;/p&gt;

&lt;p&gt;But wait! If you don't really understand what querySelector() and querySelectorAll() are, and you want to learn more about them; check out the video tutorial below: &lt;a href="https://youtu.be/3u5jCwdFU4s?si=5WVD0qOQKVtx-U_H" rel="noopener noreferrer"&gt;JavaScript DOM manipulation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inconsistent methods
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt; are not consistent in selecting the DOM. One selects the first instance of the target selector while the other selects all instances of the target selector. That means one is used to select an individual element while the other is used to select a group of elements.&lt;/p&gt;

&lt;p&gt;So you can't use both interchangeably. You have to keep on switching from one to another depending on what you want to select.&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;// Select the first element of the class .post&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;post&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Select all elements of the class .post&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let me show you a better way to do it. I just built a UI library called &lt;a href="//codingnninja.github.io/koras"&gt;koras.jsx&lt;/a&gt; that comes with &lt;code&gt;$select()&lt;/code&gt; &lt;br&gt;
which can be used in place of both &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt; in JavaScript and below is how to use it.&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;//select all instances of class .post&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//select the first instance of class post&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[0]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Doing the same with querySelector&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How cool is that? And it just works for the use cases of both &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selection by index
&lt;/h2&gt;

&lt;p&gt;You can select an element among grouped elements at any position.&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;//select 6th instance of class post&lt;/span&gt;
&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[5]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;//select 7th instance of div elements&lt;/span&gt;
&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;div[6]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deleting elements
&lt;/h2&gt;

&lt;p&gt;You can delete elements with &lt;code&gt;$select()&lt;/code&gt; like:&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;//Delete only the instance of .post with index is equal to 2&lt;/span&gt;
&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[delete|i=2]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//delete all instances of .post with index greater than 2 &lt;/span&gt;
&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[delete|i&amp;gt;2]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Adding attributes
&lt;/h2&gt;

&lt;p&gt;You can add attributes to elements with &lt;code&gt;$select()&lt;/code&gt;like:&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="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[add|class=hidden]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[add|style=1px solid red]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[add|id=2]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[add|class=flex bold]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can remove attributes from elements with &lt;code&gt;$select()&lt;/code&gt;like:&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="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[remove|class=hidden]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[remove|id]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[remove|class=flex bold]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post[remove|style]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//multiple constraints&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.post[filterIn|id=3, toggle|class=hidden]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sorting DOM elements
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;shuffledPosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.post[sort|order=shuffle]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  $select and search with constraints
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//usage as an event handler.&lt;/span&gt;
&lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tr[search|textContent=*&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&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;//usage in a component&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;matchedRows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`.row[search|textContent=*&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;searchTerm&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;]`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  DOM destructuring
&lt;/h2&gt;

&lt;p&gt;DOM destructuring is one of the features shipped in es6 but you would be surprised you can't destructure the elements selected with &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Not working:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post, .comment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Solution:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post, .comment&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can you see that? &lt;code&gt;document.querySelectAll()&lt;/code&gt; doesn't support DOM destructuring. That means you're missing out on destructuring the DOM. No! That is not cool at all so you have to start using &lt;code&gt;$select()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repetitive methods
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;document.querySelect()&lt;/code&gt; or &lt;code&gt;document.querySelectorAll()&lt;/code&gt; forces you to repeat themselves unnecessarily because they don't support DOM destructuring and that makes it a bit messy to maintain JavaScript code.&lt;/p&gt;

&lt;h5&gt;
  
  
  Won't work
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.audio, .post, .comment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  So you have to do:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;audio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#audio&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.comment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can you see how repetitive that is and how it will make it a bit messy to maintain your codebase at scale?&lt;/p&gt;

&lt;p&gt;See, you can do the same using &lt;code&gt;$select()&lt;/code&gt; like below with ease:&lt;/p&gt;

&lt;h5&gt;
  
  
  Solution
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#audio, .post, .comment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Difficulties in debugging DOM selections:
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;document.querySelector()&lt;/code&gt; tends to create more surface area for bugs to hide compared to &lt;code&gt;$select()&lt;/code&gt; because of its support for DOM destructuring and multiple selections.&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;const&lt;/span&gt; &lt;span class="nx"&gt;audio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#audio&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.comment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// OR&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;comments&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#audio, .post, .comment&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;$select()&lt;/code&gt; reduces the number of lines of code to write to select elements and so reduces the surface area for bugs to hide. That means bugs are more likely to be discovered comparatively faster while using &lt;code&gt;$select()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ability to use all array methods.
&lt;/h2&gt;

&lt;p&gt;Elements selected with &lt;code&gt;querySelector&lt;/code&gt; can only work with &lt;code&gt;forEach&lt;/code&gt; but not &lt;code&gt;map()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt; and co.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$select()&lt;/code&gt;works with all array methods by default unlike &lt;code&gt;document.querySelectorAll()&lt;/code&gt; which requires some workarounds that may lead to unnecessary repetition and complexity at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintainability
&lt;/h2&gt;

&lt;p&gt;Maintainability is always revolving around ease of use, brevity and consistency. Any codebase that is concise, consistent or easy to use tends to be maintainable. It is messy to maintain repetitive, and verbose code because you have more surface area to look at especially while fixing a bug or building a feature. &lt;/p&gt;

&lt;h2&gt;
  
  
  Shipping Less JavaScript
&lt;/h2&gt;

&lt;p&gt;It is a rule of thumb to ship less JavaScript where possible and &lt;code&gt;$select()&lt;/code&gt; makes it feasible while dealing with DOM selection. &lt;code&gt;$select()&lt;/code&gt; is preferable to &lt;code&gt;document.querySelector()&lt;/code&gt; and &lt;code&gt;document.querySelectorAll()&lt;/code&gt; at scale because it is more concise and less repetitive. The more elements you select, the less you repeat selection with &lt;code&gt;$select()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appending or prepending array of elements.
&lt;/h2&gt;

&lt;p&gt;You can't append an array of elements generated by &lt;code&gt;$select()&lt;/code&gt; to another element like &lt;code&gt;element.append(arrayGeneratedBy$Select)&lt;/code&gt; because the DOM expects NodeList.&lt;/p&gt;

&lt;p&gt;Still, you can tell &lt;code&gt;$select()&lt;/code&gt; to disable all of its superpowers by passing false as a second parameter to it.&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;//superpowers are on by default but you can pass false to off it.&lt;/span&gt;

 &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;offSuperpowers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

 &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.post&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, it will return a normal &lt;code&gt;DOM NodeList[]&lt;/code&gt; that is appendable and prependable.&lt;/p&gt;

&lt;h2&gt;
  
  
  $select() can do that
&lt;/h2&gt;

&lt;p&gt;You maybe curious if &lt;code&gt;$select()&lt;/code&gt; can do everything &lt;code&gt;document.querySelect()&lt;/code&gt; or &lt;code&gt;document.querySelectorAll()&lt;/code&gt; can do. Yes! It can do whatever they do. &lt;code&gt;$select()&lt;/code&gt; can do it all. It can use &lt;code&gt;tag&lt;/code&gt;or &lt;code&gt;css&lt;/code&gt; selectors and do every other things &lt;code&gt;query.querySelector()&lt;/code&gt;can do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is document.querySelector() any better?
&lt;/h2&gt;

&lt;p&gt;It is possible to claim that &lt;code&gt;querySelector() or querySelectorAll()&lt;/code&gt; is faster than &lt;code&gt;$select()&lt;/code&gt;with about &lt;strong&gt;&lt;em&gt;one millisecond&lt;/em&gt;&lt;/strong&gt; on average but &lt;code&gt;$select()&lt;/code&gt; wins it back with interests at scale.&lt;/p&gt;

&lt;p&gt;You still need to learn to use querySelector because understanding how to use it gives you a chance to build something useful on it just like $select(). I am able to build $select() because I truly understand how it works.&lt;/p&gt;

&lt;p&gt;I have made a tutorial on it. Check it out below: &lt;a href="https://youtu.be/3u5jCwdFU4s?si=5WVD0qOQKVtx-U_H" rel="noopener noreferrer"&gt;JavaScript DOM manipulation&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I won't use querySelector ever again
&lt;/h2&gt;

&lt;p&gt;By supporting DOM destructuring and enabling array-based selections, $select() proves to be a valuable addition to my toolkit. It not only improves the readability of my code but also minimizes the surface area for bugs, making debugging a more straightforward process. &lt;/p&gt;

&lt;p&gt;In the search of maintainability, brevity, and consistency, $select() is a good choice for DOM selection, showing a step forward in the evolution of JavaScript development.&lt;/p&gt;

&lt;p&gt;As we continue to adapt to the evolving JavaScript ecosystem, using tools like &lt;code&gt;$select()&lt;/code&gt; ensures that we keep making our code more concise, readable, and maintainable.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>library</category>
      <category>webdev</category>
      <category>dom</category>
    </item>
    <item>
      <title>Build a note app with JavaScript component.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Wed, 11 Dec 2024 15:54:01 +0000</pubDate>
      <link>https://dev.to/codingnninja/build-a-note-app-with-javascript-component-2b01</link>
      <guid>https://dev.to/codingnninja/build-a-note-app-with-javascript-component-2b01</guid>
      <description>&lt;p&gt;Sure, you have learned about web and React components but today, I will show you JavaScript components as introduced by koras.js.&lt;/p&gt;

&lt;p&gt;You might be wondering “What is a JavaScript component?”. They're no-build reusable UI components that work in browsers and servers without a virtual &lt;code&gt;DOM&lt;/code&gt; or tagged templates.&lt;/p&gt;

&lt;p&gt;It is similar to React components but with some interesting twists. You can learn more about it from &lt;a href="//codingnninja.github.io/koras"&gt;koras.js docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Seeing is believing. Let’s build a note app with it. The image below shows the look of what we’re going to build and you can use it in real time without any building process at &lt;a href="//4kr45h.csb.app"&gt;Noteapp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Foz5z8c4s47drzw3uh0y8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Foz5z8c4s47drzw3uh0y8.gif" alt="note app image" width="1353" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s write the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;HTML + CSS&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"styles.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="c1"&gt;//Note app code goes here.&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above shows the &lt;code&gt;HTML&lt;/code&gt; structure of the app. The code below is for the main operations.&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;$render&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;$register&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://cdn.jsdelivr.net/npm/@codingnninja/koras/dist/esm/koras.min.js&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="nf"&gt;Notes&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="nf"&gt;getNotes&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;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&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="p"&gt;}&lt;/span&gt;


  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;saveNote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.note[delete|textContent=write note...]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&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="s2"&gt;`
    &amp;lt;div id="container"&amp;gt;
      &amp;lt;div id="notes" data-append="#notes"&amp;gt;
        &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;getNotes&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;
          &amp;lt;div
            class="note"
            onblur="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nf"&gt;saveNote&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;"
            contenteditable=""
          &amp;gt;write note...&amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;button
        class="add-note-btn"
        onclick="$render(Notes)"
      &amp;gt; + &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  `&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;$register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Notes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="nf"&gt;$render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Notes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Though the code is self explanatory, let’s explain it a bit. We import &lt;code&gt;$render&lt;/code&gt; and &lt;code&gt;$register&lt;/code&gt; from koras.js to render our note app without any build process.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$register&lt;/code&gt; is used to prepare JavaScript components for rendering with &lt;code&gt;$render&lt;/code&gt;. That means we need to register a component before rendering it.&lt;/p&gt;

&lt;p&gt;Notes component contains two local functions named &lt;code&gt;getNotes&lt;/code&gt; and &lt;code&gt;saveNotes&lt;/code&gt;.&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="nf"&gt;getNotes&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;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;getNotes&lt;/code&gt; gets notes from the &lt;code&gt;localstorage&lt;/code&gt; or returns an empty string if nothing is found.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;saveNote&lt;/code&gt; grabs all the children of the tag containing all notes and stores them in the &lt;code&gt;localstorage&lt;/code&gt; in form of an &lt;code&gt;HTML&lt;/code&gt; string.&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="nf"&gt;saveNote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.note[delete|textContent=write note...]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;notes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;notes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&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;&lt;code&gt;$select&lt;/code&gt; is another utility provided by koras.js to access and manipulate the &lt;code&gt;DOM&lt;/code&gt; with ease.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$select&lt;/code&gt; is used, in this case, to delete any note containing “write note…” to avoid storing them alongside the real notes.&lt;/p&gt;

&lt;p&gt;The return section of Notes component is what appears in the DOM and it is pure &lt;code&gt;HTML&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;return `
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"notes"&lt;/span&gt; &lt;span class="na"&gt;data-append=&lt;/span&gt;&lt;span class="s"&gt;"#notes"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      ${getNotes()}
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
        &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"note"&lt;/span&gt;
        &lt;span class="na"&gt;onblur=&lt;/span&gt;&lt;span class="s"&gt;"${saveNote()}"&lt;/span&gt;
        &lt;span class="na"&gt;contenteditable=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;write note...&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt;
      &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"add-note-btn"&lt;/span&gt;
      &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"$render(Notes)"&lt;/span&gt;
     &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; + &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
 `;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notes tag that represents the component is identified with &lt;code&gt;id=“notes”&lt;/code&gt; and &lt;code&gt;data-append&lt;/code&gt; informs the component to add a new child whenever it is rendered.&lt;/p&gt;

&lt;p&gt;So, the component is designed to add a new note whenever the add note button (+) is clicked.&lt;/p&gt;

&lt;p&gt;Everything works together to make a note app with the minimal and most concise code snippet ever possible to create a note app in JavaScript whether you use a framework or vanilla JavaScript.&lt;/p&gt;

&lt;p&gt;You might be wondering how and why this works? If you want to know more about that, check &lt;a href="//codingnninja.github.io/koras"&gt;koras.js&lt;/a&gt; docs and don’t forget to star the project on GitHub at &lt;a href="//github.com/codingnninja/koras"&gt;koras.js&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>component</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>Yoko: Live coding without really coding.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Mon, 29 Jul 2024 13:14:29 +0000</pubDate>
      <link>https://dev.to/codingnninja/yoko-live-coding-without-really-coding-33ni</link>
      <guid>https://dev.to/codingnninja/yoko-live-coding-without-really-coding-33ni</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2cbdm2px19tdd1qy4lw6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2cbdm2px19tdd1qy4lw6.gif" alt="An animated example of using Yoko to simulate real live coding" width="1343" height="693"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Yoko
&lt;/h2&gt;

&lt;p&gt;Yoko is a VSCode extension designed to enhance your live coding sessions, programming tutorials, and teaching experiences.&lt;/p&gt;

&lt;p&gt;It allows you to simulate live coding without actually typing any character, making your presentations smoother and more engaging. You only need to focus on audio recording.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simulated Live Coding&lt;/strong&gt;: Copy and paste code while the extension controls the pace of text appearance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pause and Resume&lt;/strong&gt;: &lt;br&gt;
Easily pause the simulated typing when you need to explain concepts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Undo/Redo Integration&lt;/strong&gt;: Seamlessly works with VSCode's built-in undo and redo features.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multi-language Support&lt;/strong&gt;: Compatible with all programming languages and text files supported by VSCode.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also use &lt;code&gt;backspace&lt;/code&gt; to delete characters by the last line of your documents but use &lt;code&gt;delete&lt;/code&gt; anywhere else to create some effects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Support modifier keys&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yoko doesn’t allow you to press alphabets or numbers but you can still use modifier keys like &lt;code&gt;ctrl&lt;/code&gt;, &lt;code&gt;cmd&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;alt&lt;/code&gt; etc., to uncomment, comment, delete, highlight and so on to simulate real experience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Support the filter pan&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use the filter pan as usual.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl+P&lt;/code&gt; to open the Quick Open dialog.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;ext install
codingnninja.yoko&lt;/code&gt; to find the extension.&lt;/li&gt;
&lt;li&gt;Click Install.&lt;/li&gt;
&lt;li&gt;Or search for &lt;code&gt;Yoko&lt;/code&gt; in VSCode extensions navigation pan.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open a file you want to use for your live coding session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Activate Yoko by pressing &lt;code&gt;Ctrl+Shift+P&lt;/code&gt; (or &lt;code&gt;Cmd+Shift+P&lt;/code&gt; on macOS) then find and click “Yoko: Teach programming like a PRO”. Alternatively, simply press &lt;code&gt;Ctrl+Shift+c&lt;/code&gt; (or &lt;code&gt;Cmd+Shift+c&lt;/code&gt; on macOS).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the content of your editor has disappeared, press &lt;code&gt;spacebar&lt;/code&gt; to simulate typing. Yoko will control the pace at which the text appears.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use &lt;code&gt;backspace&lt;/code&gt; to simulate deleting.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We welcome your feedback and suggestions for future improvements!&lt;/p&gt;

&lt;p&gt;Thanks for reading 👍🏻.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>$render.js: Unleashing JSX in both browsers and servers without a virtual DOM.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Sat, 06 Jan 2024 12:10:46 +0000</pubDate>
      <link>https://dev.to/codingnninja/renderjs-unleashing-jsx-in-both-browsers-and-servers-without-a-virtual-dom-ief</link>
      <guid>https://dev.to/codingnninja/renderjs-unleashing-jsx-in-both-browsers-and-servers-without-a-virtual-dom-ief</guid>
      <description>&lt;p&gt;&lt;a href="//codingnninja.github.io/lovePlay"&gt;LovePlay Music Player&lt;/a&gt;(Built with $render)&lt;br&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%2Ftsgsee99tbz07hug03vm.gif" 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%2Ftsgsee99tbz07hug03vm.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introducing $render.js, a powerful tool that opens up new possibilities for JSX and more in-browser functionalities without the need for a virtual DOM or tagged templates.&lt;/p&gt;

&lt;p&gt;$render.js is designed to scale up and scale down to cater to individual and business needs. And it takes everything you know about the front-end starting from JSX to htmx to the next level.&lt;/p&gt;

&lt;p&gt;This release brings numerous features to enhance your development experience:&lt;/p&gt;
&lt;h4&gt;
  
  
  JSX Components:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;$render enables the use of JSX in the browser just like React but without a virtual DOM. No bullsh*t!&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Macro Rendering:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;All components are rendered during the initial rendering process. No React &lt;em&gt;hydration&lt;/em&gt; please.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/yq4sn7?module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  Micro Re-rendering:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Enjoy efficient re-rendering, impacting only the triggering component and its related components. No need to get all the jungle because of a piece of banana.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/ggjrqp?view=preview&amp;amp;module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  DOM Destructuring:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Easily select single and multiple DOM elements using destructuring. Move faster!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/zktczg?module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Note: click the console.&lt;/p&gt;

&lt;h4&gt;
  
  
  Utility-First Functions:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Access a pre-baked utilities and components suite for swift and efficient development. No pressure!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/qnmlc4?module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  Micro-Frontend:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Build front-end applications with independent and modularized parts. Build at scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Hypermedia:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Make requests to single or multiple servers to obtain component strings dynamically without the limit of htmx. Unlimited!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/666k9k?module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  Learn React without React:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Customize $render to behave like React, facilitating learning and educational purposes. Education is the best legacy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  State Management Tools:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Utilize custom tools for effective state management. It comes with a customizable state management tool. Easy pizzy!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Server-Side Rendering:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Render your application UI directly from servers and $render will display it to your audience. Wow!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Multi-Server Requests:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Enable multiple-server requests with a moderation-enforced approach. Let's be guided.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/hwdm3g?module=%2Findex.html"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h4&gt;
  
  
  Stability
&lt;/h4&gt;

&lt;p&gt;$render is bringing back stability to the web so that your applications can still work after 50+ years of their creation.&lt;/p&gt;

&lt;p&gt;Wow! That is cool. &lt;/p&gt;

&lt;p&gt;$render empowers you with these advanced features in browsers, eliminating unnecessary overhead. Now, you can focus on delivering value to your users effortlessly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://render-docs.vercel.app/" rel="noopener noreferrer"&gt;Click to get started with $render&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//twitter.com/tryRender"&gt;Follow $render on Twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//github.com/codingnninja/render"&gt;Contribute to $render on Github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>$render — write React with pure JavaScript.</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Tue, 05 Sep 2023 11:21:21 +0000</pubDate>
      <link>https://dev.to/codingnninja/render-write-react-with-pure-javascript-49cc</link>
      <guid>https://dev.to/codingnninja/render-write-react-with-pure-javascript-49cc</guid>
      <description>&lt;p&gt;I have been building a JavaScript UI library I believe is the future of React and I am excited 🤩 to tell you about it before it is released soon.&lt;/p&gt;

&lt;p&gt;Yeah: I recreated a fully functioning online music player with $render.js: &lt;a href="//codingnninja.github.io/lovePlay"&gt;lovePlay&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is the source code: &lt;a href="//github.com/codingnninja/lovePlay"&gt;Love Play source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything is completely written in a script tag and I am currently working on its modularized version.&lt;/p&gt;

&lt;p&gt;Check it out and let me know know what you think.&lt;/p&gt;

&lt;p&gt;Finally, you can stay connected by watching render release &lt;a href="https://github.com/codingnninja/render"&gt;$render release&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.togithub"&gt;credit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>framework</category>
    </item>
    <item>
      <title>DevRel is not a big deal: How to do it like a PRO?</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Thu, 10 Aug 2023 05:26:13 +0000</pubDate>
      <link>https://dev.to/codingnninja/devrel-is-not-a-big-deal-how-to-do-it-like-a-pro-16e7</link>
      <guid>https://dev.to/codingnninja/devrel-is-not-a-big-deal-how-to-do-it-like-a-pro-16e7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is already published on my Github account here:&lt;a href="https://github.com/codingnninja/DevRel-How-to-sell-to-developers" rel="noopener noreferrer"&gt;DevRel Bible&lt;/a&gt;. Check it out for update. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;You only need to be curious to learn more about Developer Relations (&lt;a href="https://blog.deepgram.com/what-is-devrel-a-deepgram-approach/" rel="noopener noreferrer"&gt;DevRel&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
DevRel Bible: How to sell to developers

&lt;ul&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Table of contents&lt;/li&gt;
&lt;li&gt;How to read this content&lt;/li&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;Why is it hard to sell to developers?&lt;/li&gt;
&lt;li&gt;What is Developer Relations (DevRel)&lt;/li&gt;
&lt;li&gt;What is the job of DevRel?&lt;/li&gt;
&lt;li&gt;How to make developers buy&lt;/li&gt;
&lt;li&gt;How to make us feel the magic&lt;/li&gt;
&lt;li&gt;Identification of audience&lt;/li&gt;
&lt;li&gt;Education of stakeholders&lt;/li&gt;
&lt;li&gt;
Forming Relationships the right way:


&lt;ul&gt;
&lt;li&gt;Naming things to elicit curiosity&lt;/li&gt;
&lt;li&gt;Crafting compelling titles&lt;/li&gt;
&lt;li&gt;Making Content Intriguing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;How to align business goals with DevRel&lt;br&gt;
&lt;/li&gt;

&lt;li&gt;Measuring the impact of going to conferences&lt;/li&gt;

&lt;li&gt;Measuring the impact of creating content&lt;/li&gt;

&lt;li&gt;Measuring impacts of engaging developer communities&lt;/li&gt;

&lt;li&gt;More thought on creating swags to engage developers&lt;/li&gt;

&lt;li&gt;How to measure success in Developer Relations (DevRel)&lt;/li&gt;

&lt;li&gt;How to measure impacts?&lt;/li&gt;

&lt;li&gt;Stages of Impact&lt;/li&gt;

&lt;li&gt;

How to measure impact quantitatively and qualitatively

&lt;ul&gt;
&lt;li&gt;Progressive Reactions&lt;/li&gt;
&lt;li&gt;Retrogressive Reactions&lt;/li&gt;
&lt;li&gt;Precautionary Reactions&lt;/li&gt;
&lt;li&gt;Predetermined Reactions&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Hierarchy of reactions/engagements&lt;/li&gt;

&lt;li&gt;Measuring success&lt;/li&gt;

&lt;li&gt;Ayobami Ogundiran (Twitter: @codingnninja)&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;It all started on February 6th, 2020 when I was sitting at my table researching more about &lt;a href="https://en.wikipedia.org/wiki/Developer_relations" rel="noopener noreferrer"&gt;Developer Relations&lt;/a&gt; challenges.&lt;/p&gt;

&lt;p&gt;Although I had been dabbling into developer relations (DevRel) before then, the talk I had to give at a conference led me to serious research about developer relations.&lt;/p&gt;

&lt;p&gt;Along the line, I kept seeing phrases like “It is hard to sell to developers”, “Don’t sell to developers” and so on. &lt;/p&gt;

&lt;p&gt;As a person who is into business and also a software developer, I kept asking myself, why is it hard to sell to us? Are we not human beings like every other person? &lt;/p&gt;

&lt;p&gt;So, I started researching how to sell to developers and I found interesting things I am about to share with you in this write-up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is it hard to sell to developers?
&lt;/h2&gt;

&lt;p&gt;Selling to developers is very hard for four major reasons – openness, reliability, stubbornness and curiosity – all of which revolve around the practicality of software development. &lt;/p&gt;

&lt;p&gt;Developers are the best among the smart, they are very open and highly curious. At first, these reasons may seem odd but you will realize the truth in them soon.&lt;/p&gt;

&lt;p&gt;Listen, salespeople tend to be tricky or deceiving in selling but the common ethic of most software developers is openness and it is that openness that makes it easy for us to share challenges, experiences and even our faults in public. You would agree with me on this if you’re a developer.&lt;/p&gt;

&lt;p&gt;Or have you seen any community that shares things that should be secrets in public like software developers? Now, how is openness makes it hard to sell to developers? Psychologically speaking, if you’re open, you have a high tendency to dislike those who are not straightforward, isn’t it?&lt;/p&gt;

&lt;p&gt;Also, developers are very smart people. Many of us have learned about human psychology and selling by reading widely and watching documentaries and movies. &lt;/p&gt;

&lt;p&gt;All of this experience plus our encounters with salespeople make us always assume salespeople want to trick us and no human being likes to be tricked. For that reason, we hate to give sellers our attention.&lt;/p&gt;

&lt;p&gt;Developers are amazingly stubborn in pursuit, so we’re always strongly opinionated. Why do you think we have JavaScript libraries and frameworks that do the same thing basically? &lt;/p&gt;

&lt;p&gt;Why do you think we have DRY, WET and YAGNI? We tend to be stubborn in our thinking or belief and if you don’t have an emotionally and logically convincing product, you will struggle to sell to developers.&lt;/p&gt;

&lt;p&gt;Our inherent curiosity makes it very hard to sell software to us and retain us. Many of us are okay with wasting our time and night to build or find out how one shining project works. In short, we like to learn and build our things. &lt;/p&gt;

&lt;p&gt;Are you even a software developer if you don’t have unfinished side projects? Who doesn’t? &lt;/p&gt;

&lt;p&gt;So you can’t easily sell software products to us by telling or tricking us to buy them. We will rather build our alternative if you make us angry or trick us. And if your product is not really convincingly useful, curiosity will take us to the next shining things.&lt;/p&gt;

&lt;p&gt;That is the reality.&lt;/p&gt;

&lt;p&gt;Why do you think developers are open? It is because if we’re not, any piece of software will expose us with ease. Software exposes marketing gimmicks easily because developers have to go through some experience while using them and developers are highly skeptical of software they have not used practically.&lt;/p&gt;

&lt;p&gt;So developers rarely pay for software without experiencing it judging from experience. All this is why using marketing gimmicks without good experience rarely works in selling to developers. &lt;/p&gt;

&lt;p&gt;And it is the responsibility of DevRel to make sure your products work and achieve their purposes. They need to work to make sure your users feel the magic in your products the first time they use them. &lt;/p&gt;

&lt;p&gt;If they don't, DevRel needs to keep providing information to the stakeholders, abstract or create documentation and other forms of content to make the right audience feel the magic in your products. &lt;/p&gt;

&lt;p&gt;"The great liability of the engineer compared to men of other professions is that his works are out in the open where all can see them. &lt;/p&gt;

&lt;p&gt;His acts, step by step, are in hard substance. He cannot bury his mistakes in the grave like the doctors. &lt;/p&gt;

&lt;p&gt;He cannot argue them into thin air or blame the judge like the lawyers. He cannot, like the architects, cover his failures with trees and vines. &lt;/p&gt;

&lt;p&gt;He cannot, like the politicians, screen his shortcomings by blaming his opponents and hoping the people will forget. &lt;/p&gt;

&lt;p&gt;The engineer simply cannot deny he did it. If his works do not work, he is damned." - Herbert Hoover, American engineer and politician&lt;/p&gt;

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

&lt;p&gt;Tracing the origin of Developer Relations, there is no generally accepted definition as everyone tries to define it with relative terms.&lt;/p&gt;

&lt;p&gt;Now, let's make an attempt to give a definition that has potential to satisfy the needs of any DevRel team.&lt;/p&gt;

&lt;p&gt;DevRel is the interaction among developers to drive and achieve individual and organizational interests through experience and demonstration.&lt;/p&gt;

&lt;p&gt;This definition claims that experience and demonstration are necessary to achieve or forfeit a business, user and team's goals.&lt;/p&gt;

&lt;p&gt;Experience has to do with the value or benefit users, organizations and other parties gain out of their interactions which could be through demonstration in the form of content, conferences, demos and any other mediums. &lt;/p&gt;

&lt;p&gt;In short, Developer Relations revolve around all demonstrations and their attendant experience.&lt;/p&gt;

&lt;p&gt;For the sake of practical application, DevRel is about Development, Education ( with marketing and selling sense) and Customer care/support. Oh, sorry! I have forgotten we all hate the word "selling and marketing". Anyway, hear me out.&lt;/p&gt;

&lt;p&gt;Marketing or selling is not inherently bad, it is the snake oil sellers that make it seem so. Hating marketing or selling is just like hating policing and the police just because thieves use guns. Is that reasonable?&lt;/p&gt;

&lt;p&gt;Even if you only educate and form relationships, understanding ethical marketing and selling will help you identify the right audience, shape products to users' tastes, make and distribute content to them and lead them to buy your products.&lt;/p&gt;

&lt;p&gt;I strongly believe DevRel is partly about making developers feel the magic in your products. If you and your target audience can't feel the magic (the core problem it solves) while using your products, you still have a lot to do. &lt;/p&gt;

&lt;p&gt;Hey wait, isn't DevRel just marketing in disguise? Well, let's talk about their difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  DevRel vs Marketing: What is the difference?
&lt;/h2&gt;

&lt;p&gt;In the early morning of May 3, 2023, I saw a controversial tweet claiming "DevRel is marketing in disguise".&lt;/p&gt;

&lt;p&gt;Honestly, it is hard to reasonably debunk this claim. But it must be debunked to help business people not to make horrible choices.&lt;/p&gt;

&lt;p&gt;Looking at the claim again, it has the potential to make business people assume they can treat DevRel and Marketing the same way.&lt;/p&gt;

&lt;p&gt;No. That would be a terrible mistake for one major reason: Marketing is a profession of those who can talk while DevRel is a profession of those who can bring the talk to reality or do both.&lt;/p&gt;

&lt;p&gt;This is what I mean:&lt;/p&gt;

&lt;p&gt;It is one thing to promise your audience they will get all their desires plus extra but it is another thing to fulfil the promise.&lt;/p&gt;

&lt;p&gt;Marketers have no strong reasons or incentives to care about whatever happens to the users they bring, they only need to bring users. So they always resort to promising "The Heaven and The Earth" just to meet a target.&lt;/p&gt;

&lt;p&gt;And there is nothing wrong with that because it is the purpose of their job. In short, the mindset of a marketer is to bring in users by all means possible.&lt;/p&gt;

&lt;p&gt;But no, DevRel people can't do the same because their job is more practical than emotional. You can't promise computers to bring solutions into existence.&lt;/p&gt;

&lt;p&gt;It has to be practically done, bit by bit, with blood and sweat but never with just promises.&lt;/p&gt;

&lt;p&gt;DevRel people and developers generally always face the consequences of any promises they make. They have to work hard to create docs, abstractions, presentations and many others just to fulfil the promises.&lt;/p&gt;

&lt;p&gt;Treating DevRel people like marketers tends to prevent them from doing their job of finding and implementing ways to improve user experience to drive adoption and revenue. Turning them to marketers may look good if you focus on vanity metrics instead of what moves your business forward in the end.&lt;/p&gt;

&lt;p&gt;Obviously, DevRel has a lot to do with marketing and selling but they have to be addressed differently because of the practicality of software and software development. Marketers win when they bring in users and so they have an incentive to over-promise. Yes, it is totally different for DevRel people. &lt;/p&gt;

&lt;p&gt;After bringing users, they still have to be part of the process to deliver on their promises. If they fail to deliver on their promises, users will have terrible experiences, product adoption will tank and revenue will plummet, leading to the failure of such a company.&lt;/p&gt;

&lt;p&gt;So, it is reasonable for any business that deals with developers to make sure their DevRel team focuses on making the developer experience better than anyone else can deliver in their industries. The best way to do so; is not to treat DevRel people as marketers.&lt;/p&gt;

&lt;p&gt;Now, in summary, the major difference between marketing and DevRel is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Marketers are fond of &lt;strong&gt;&lt;em&gt;sweetening&lt;/em&gt;&lt;/strong&gt; product promises because they don't face the consequences of their actions as they don't build the product which may lead to terrible user or developer experience and revenue. DevRel teams work hard to fulfill the promises made by marketers and business executives. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketers tend to protect the image of their companies by spreading good news while DevRel tends to protect the image of their companies by trying to improve user experience and satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketing focuses on getting acquiring users without necessarily caring about users' experience while DevRel focuses on relationships and other activities that improve users' experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketers don't have to care about the feedback from their users because it has nothing to do with their job but any DevRel team needs to care about it because it will help to improve users' experience and satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Marketing and DevRel are different in purpose and operation, though they have some intersections in approach. So, treating DevRel teams and operations like marketing is not a good thing for a business that focuses on developers.&lt;/p&gt;

&lt;p&gt;Okay, wait! If marketing is different from Developer Relations, then what is the job of DevRel people? &lt;/p&gt;

&lt;p&gt;They educate stakeholders and create documentation, abstractions, applications and content that make the magic in their products felt so that you won’t need to trick people to buy your products.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the job of DevRel?
&lt;/h2&gt;

&lt;p&gt;Your job as a member of a DevRel team is to make developers want to buy whatever products you’re dealing with. &lt;/p&gt;

&lt;p&gt;Making them want to buy is a necessity because a relationship that doesn’t provide for business expectations is a failure. &lt;/p&gt;

&lt;p&gt;Think about it. &lt;/p&gt;

&lt;p&gt;How will businesses pay salaries if they’re not making revenue? Did you just say “venture funds"? But can “venture funds” last forever? If not, developers need to buy.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to make developers buy
&lt;/h2&gt;

&lt;p&gt;“I’ve learned that people will forget what you said, people will forget what you did, but people will never forget how you make them feel” – Maya Angelou&lt;/p&gt;

&lt;p&gt;What is your product making developers feel? That is what matters most.&lt;/p&gt;

&lt;p&gt;Making developers buy your products is not as hard as you think if you don’t try to sell to us. You need to avoid the word “sell” and any marketing lingo (except when they elicit curiosity) because they may deny you the chance to get our attention.&lt;/p&gt;

&lt;p&gt;Please and please, don’t “sell” to us.&lt;/p&gt;

&lt;p&gt;Instead, lead us to buy your products. It is very interesting to lead developers to buy your products and I am going to show you how to do it step by step in this write-up.&lt;/p&gt;

&lt;p&gt;See, you can’t make us buy anything unless we’re already willing to buy it. If we’re not willing to buy your products, please don’t try to force it by appealing to our interests and desires like salespeople always do because we will not stick around for long or even buy anything in the end. You will just waste money and effort.&lt;/p&gt;

&lt;p&gt;Did you just say why won’t you buy it?&lt;/p&gt;

&lt;p&gt;Look, appealing to our feelings with words is not the way to lead us to buy because our job is more practical than emotional. You need to make us feel the magic in your products and you can only win us if the magic we feel practically from your products has never been felt from our current stacks.&lt;/p&gt;

&lt;p&gt;This is what I mean.&lt;/p&gt;

&lt;p&gt;Your product (not you or your words) must make us feel the problem it solves and how amazing it is. If you are a developer that used Bootstrap, SASS, Tailwind CSS, React, Next, ChatGPT, Laravel or Ruby on Rails early; you should understand what I mean by feeling the magic.&lt;/p&gt;

&lt;p&gt;Don’t just tell or show us the problem your product solves; let your product make us feel it by itself. Let me explain:&lt;/p&gt;

&lt;p&gt;Your products (not just you) should make us feel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Wow, it is so fast!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Woot! So cheaper than its usefulness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Holy cow, how does it make the features or tasks extremely easy?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What? It is so easy to learn and delivers the best result.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazing, this is magic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Oh no, it eased my stress?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Yeah, it saves me time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hurray! This process is now amazingly fast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bravo! So secure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wow, this is an opportunity to be rich.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your product should make us feel that our problem is solved. If it doesn’t, you will struggle to sell it to us.&lt;/p&gt;

&lt;p&gt;From my personal experience, I had been writing PHP before knowing Laravel but when I used Laravel for the first time, I said “I am not going to be using PHP without Laravel except if it is a necessity or another framework makes me feel a better vibe practically”.&lt;/p&gt;

&lt;p&gt;Laravel made the features that usually took about two weeks to take days with its conventions and packages.&lt;/p&gt;

&lt;p&gt;Besides, I was using Angular 1 before I knew about React and when I used React, I felt the magic and I knew I was not going back. I was able to get around it in three days. So easy. &lt;/p&gt;

&lt;p&gt;Tailwind CSS also made me feel the magic recently. When I used it, it was easy to build beautiful pages just by using “class utilities” without stress and its documentation and libraries are so simple.&lt;/p&gt;

&lt;p&gt;If your products don’t make us or yourself feel that magic, it is hard to get developers to stick to them. Even if you get us to signup, we won’t stick to it. Then, how do you make developers feel the magic in your products?&lt;/p&gt;

&lt;h2&gt;
  
  
  How to make us feel the magic
&lt;/h2&gt;

&lt;p&gt;“Magic touches people in the way great art does. It lets them see the world with new eyes.” – Drummond Money-Coutts&lt;/p&gt;

&lt;p&gt;Do your products make us see our problems with new eyes and awe 🤩? That is very important.&lt;/p&gt;

&lt;p&gt;To make developers feel the magic in your products, you need to understand your audience and keep refining your products until they make your audience feel their problems are solved. &lt;/p&gt;

&lt;p&gt;Don’t trick us to buy, if you do, you are doing it wrong because it is easy to realize your tricks as software development is practical – You can’t hide deceits for long.&lt;/p&gt;

&lt;p&gt;It is better to put in efforts and resources to understand your audience and improve your products to make them feel the problem you solve for them. Then, making them buy becomes easier.&lt;/p&gt;

&lt;p&gt;This is how DevRel goes about it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Identification of audience
&lt;/h3&gt;

&lt;p&gt;They identify &lt;strong&gt;&lt;em&gt;the marketing audience&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;the target audience&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;the right audience&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;First and foremost, you need &lt;a href="https://www.questionpro.com/blog/audience-research/#:~:text=Conclusion-,What%20is%20audience%20research%3F,part%20of%20every%20marketing%20plan." rel="noopener noreferrer"&gt;audience research&lt;/a&gt; to succeed in DevRel.&lt;/p&gt;

&lt;p&gt;This is the first job of DevRel because all efforts to form good relationships with developers and make them want your products will not tally with the business expectation (which is revenue) if you are not addressing each group of the audience the right way. &lt;/p&gt;

&lt;p&gt;All audiences are important because they serve different purposes. &lt;/p&gt;

&lt;p&gt;What is the right way to deal with the marketing audience, the target audience and the right audience? This is what to understand:&lt;/p&gt;

&lt;p&gt;The marketing audience refers to those who use your products for educational purposes or other purposes which might not yield direct revenue but promote your products eventually. &lt;/p&gt;

&lt;p&gt;This audience is important as they create a bandwagon that ends up bringing you the target audience and the right audience. Organize them into a community of users who create add-ons, tutorials and others that reveal the magic of your products. &lt;/p&gt;

&lt;p&gt;The target audience refers to the set of people you think you’re solving problems for. The reality is many of them will not buy your products for reasons. Maybe they don't see any reason to jump ship, they're scared of lock-in or they can't just feel the magic.&lt;/p&gt;

&lt;p&gt;The right audience refers to the audience who have felt the magic in your products, are willing and are able to pay.&lt;/p&gt;

&lt;p&gt;The way you deal with each type of audience is somewhat different. The marketing audience has no reason or ability to pay even if they love your products. &lt;/p&gt;

&lt;p&gt;For this reason, it is important to make sure they achieve a marketing or community purpose for your products. In short, make sure they create a bandwagon effect that influences the target audience and the right audience to join.&lt;/p&gt;

&lt;p&gt;The target audience needs to feel a kind of specific magic in your products to encourage them to jump ship. They need some reasons. So let them feel the magic in your products – let them feel the reasons.&lt;/p&gt;

&lt;p&gt;Improve your products until your target audience can feel the reasons in your products. Again, let them feel (not rationalize) the reasons.&lt;/p&gt;

&lt;p&gt;Also, the right audience needs to be converted and cared for. They have felt the magic, they are willing and able to buy. All you have to do is to lead them to buy.&lt;/p&gt;

&lt;p&gt;Listen, you can't really make anyone buy what they don't want to buy, especially developers. Now that they want to buy, you have to do something to make them act as quickly as possible. &lt;/p&gt;

&lt;p&gt;That means giving them incentives, fair pricing, deadline, discount, FOMO or anything to encourage them to act fast.&lt;/p&gt;

&lt;p&gt;And if your company has a marketing/sales team, figuring out how to make developers act fast is their job, DevRel only needs to cross-check and test to see if they feel the magic or are repelled by the offering.&lt;/p&gt;

&lt;p&gt;You can continue to shape your offering until developers stick around.&lt;/p&gt;

&lt;p&gt;Finally, your content, distribution or presentation should be tagged with stage, audience and purpose (SAP). Doing so forces you to think or work out how to link them to the next stage without selling. Remember, the keyword here is "without selling".&lt;/p&gt;

&lt;h3&gt;
  
  
  Education of stakeholders:
&lt;/h3&gt;

&lt;p&gt;1) DevRel educates the internal &lt;a href="https://www.techtarget.com/searchcio/definition/stakeholder#:~:text=A%20stakeholder%20is%20a%20person,can%20have%20no%20official%20affiliation." rel="noopener noreferrer"&gt;stakeholders&lt;/a&gt; to build products that make the target audience feel the problem they solve. They do this by constantly getting information from/about the marketing audience, target audience and the right audience to refine the products.&lt;/p&gt;

&lt;p&gt;2) They make abstractions, documentation and content that makes it easy to use and adopt products.&lt;/p&gt;

&lt;p&gt;See, I strongly believe content creation, presentation, distribution and forming relationships are also meant to subtly educate to clear doubt, remove fear and make users take action. &lt;/p&gt;

&lt;p&gt;For example, it could be stated in a write-up that "we are building a streaming website with Sapabase without vendor lock-in". This example subtly removes the fear of vendor lock-in. &lt;/p&gt;

&lt;p&gt;This kind of education should be interestingly woven into your content, docs, presentation and relationships without selling – without forcing your content or products into the subject of every discussion.&lt;/p&gt;

&lt;p&gt;Give developers subtle reasons to use your products in your content, docs and presentations. And this should be mostly about their fears, doubts and problems they want to solve.&lt;/p&gt;

&lt;p&gt;If you do it well, you will be able to make developers buy without selling.&lt;/p&gt;

&lt;p&gt;Forming Relationships the right way:&lt;/p&gt;

&lt;p&gt;Forming relationships with developers is at the heart of Developer Relations and without it, you would struggle to reach developers and make them buy from you eventually. &lt;/p&gt;

&lt;p&gt;Developers have several communities offline and online. You need to be part of those communities to support their operations.&lt;/p&gt;

&lt;p&gt;Doing this is mainly to have genuine relationships with them. See, having genuine relationships with those communities is so important for continuity than marketing your products to them. Why am I saying this? Making the interests of the communities the core of your relationships with them; helps you a lot.&lt;/p&gt;

&lt;p&gt;Having strong relationships with developer communities will help you in distributing your content. The communities have gained the attention and trust of several developers so you don’t have to do it yourself and that simply means you have crushed the A (attention) in &lt;a href="https://www.smartinsights.com/traffic-building-strategy/offer-and-message-development/aida-model/" rel="noopener noreferrer"&gt;AIDA&lt;/a&gt; (Attention, Interest, Desire and Action).&lt;/p&gt;

&lt;p&gt;Then, how do you get the interest of developers? Listen, everyone says it is hard to sell to developers and that is true because everyone ignores developers’ ethics – openness, trust and reliability – because they think selling tricks are infallible.&lt;/p&gt;

&lt;p&gt;Developers have no stable interest; we’re too curious. Even expert developers with several years of experience in watching many products fail will still end up checking out another shining object behind the scene. If you’re a software developer, you’re probably guilty of that. Well, that is okay and needed to succeed in software development.&lt;/p&gt;

&lt;p&gt;So to get the interest of a software developer, you must be a master in eliciting curiosity. That is all it takes to make almost any software developer interested. It is easy to make someone interested in your write-up by giving it a title like “How I built a SaaS in one night and sold $5,000,000 worth of copies the next week”  but it won’t take you far.&lt;/p&gt;

&lt;p&gt;It will gain quick traffic but it is sometimes bad for business except you help people build and sell software. My point is, to make sure you elicit interest with the purpose of your products in mind. &lt;/p&gt;

&lt;p&gt;Don’t get me wrong; that kind of topic is great to make your brand known but it mostly creates an unintended view of your products.&lt;/p&gt;

&lt;p&gt;How do you elicit curiosity in developers?&lt;/p&gt;

&lt;p&gt;Yeah, let’s do this. There are several ways to elicit curiosity in developers and some of them are listed below:&lt;/p&gt;

&lt;h3&gt;
  
  
  Naming things to elicit curiosity:
&lt;/h3&gt;

&lt;p&gt;Name your services,  products or activities to elicit curiosity and that will be helpful to gain developers’ attention when you’re not well known. Then, how do you do that? Well, you can use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Name Association&lt;/em&gt;&lt;/strong&gt;: make the name of your product implicitly or explicitly mimic the name of a popular or successful product in your niche or another related niche. Or find a way to associate your products to some well-known things in your industry.&lt;/p&gt;

&lt;p&gt;For example, JavaScript explicitly associated itself with Java. You see, whoever knew what Java was meant for would immediately understand what JavaScript was also meant for and would be curious to know how it works. &lt;/p&gt;

&lt;p&gt;That is how to get developers with curiosity. More examples are Facebook, Openbase, Securinti, Imagedinary, ImageMagic, ReactQuery, Blognode, Videbugger, and Sapabase ( Somehow brings Supabase ). &lt;/p&gt;

&lt;p&gt;As the human brain tends to match things with what is stored and fills in the gap, names like this bring back the memory of an associated memory. Whenever you use this naming approach, make sure you don’t violate any copyright.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Intent revealing name:&lt;/em&gt;&lt;/strong&gt; If a lot of people want a thing or service, you name your products or services with intent revealing names such as React, freeCodeCamp, YouTooCanCode and Freelancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Metaphoric name:&lt;/em&gt;&lt;/strong&gt; Name your products, services or operations names that compare them with things, services or products that are expected to be superior to them such as Artificial Intelligence (AI) – compares machine intelligence to human intelligence, Machine Learning (ML), Virtual Reality (VR),  ReactQuery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Objectifying name:&lt;/em&gt;&lt;/strong&gt; Name your products or services names of popular objects or names that contain object names such as Python, Ruby, MongoDB, MariaDB, or Python-dance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Hyperbolic name:&lt;/em&gt;&lt;/strong&gt; Give your products, services or operations names that subtly exaggerate their purpose or ability such as Ruby-on-Rails, Image-on-steroid, paradizeDB, Python-onD-Moon, React-on-Fire to make want to know their purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Funny name:&lt;/em&gt;&lt;/strong&gt; Give a name that is funny and clearly indicates what you do. GitBoob, hashNude&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Contradictory or paradoxical name:&lt;/em&gt;&lt;/strong&gt; Give a name that is an exact opposite of a norm, product, idea, tool or itself, e.g, noCode, Stackless, Serverless.&lt;/p&gt;

&lt;h3&gt;
  
  
  Crafting compelling titles:
&lt;/h3&gt;

&lt;p&gt;Give your content titles that elicit curiosity at a glance. You can also use the approaches in the naming above. Anyway, below shows your ways to do so:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use a paradox:&lt;/em&gt;&lt;/strong&gt; You can make your reader curious by using a title that seems to be self-contradictory, contradictory or impossible. E.g.  How to sell to developers (Nobody wants to sell to developers because it doesn’t work), &lt;em&gt;How to build a "Serverless Database" with JavaScript and Github&lt;/em&gt;, and &lt;em&gt;How to understand a large, legacy codebase like a pro&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use a question:&lt;/em&gt;&lt;/strong&gt; Ask a thought-provoking question that piques the interest of your reader, E.g., Do you know you can reduce your debug time and stress with Replay?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Solve a problem:&lt;/em&gt;&lt;/strong&gt; Make sure your title reflects the problem it solves so that people who need your solution can check it out, eg. &lt;em&gt;How to reduce your debug time and stress with Replay&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Using a teaser:&lt;/em&gt;&lt;/strong&gt; Give a title that hints at a strange or intriguing event or idea. &lt;em&gt;Replay: A video debugger that changed my career&lt;/em&gt;, &lt;em&gt;The narrow death of Google&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use a metaphor:&lt;/em&gt;&lt;/strong&gt; Use titles that compare two things of different classes, e.g., ChatGPT-on-steroid: the only coding assistant that never fails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use a number:&lt;/em&gt;&lt;/strong&gt; You can also use titles that start with a number like “10 ways to keep you developers productive”.&lt;/p&gt;

&lt;p&gt;Using highly curious and purposeful titles can be used to lead developers to your products so they feel the solutions you provide to their problems.&lt;/p&gt;

&lt;p&gt;Note: Whatever you use, make sure it aligns with the image your company is willing to show to the world. In short, align them to the needs of your brand.&lt;/p&gt;

&lt;h3&gt;
  
  
  Making Content Intriguing:
&lt;/h3&gt;

&lt;p&gt;Whatever content you create, be it docs, presentations, tutorials or something else should educate developers in three ways:&lt;/p&gt;

&lt;p&gt;Educate them about the subject matter of your content in ways that satisfy their desires and biases. For example, if your content is about teaching people how to debug efficiently, make sure it achieves that purpose without leaving any major desires or biases untouched.&lt;/p&gt;

&lt;p&gt;Clear doubt and fear of your audience by demonstrating your products in ways that make their fear and doubt obviously unnecessary. If a tutorial is focused on using your products, make sure you subtly clear the doubt and fear of your audience about using your products. &lt;/p&gt;

&lt;p&gt;You can do so by associating yourself, developers, business executive and products with the best in the industry.&lt;/p&gt;

&lt;p&gt;For example, if you know your audience is not using your products because of their fear of scalability; you can subtly talk about how a real-world business is using your product at scale successfully just like another similar product.  &lt;/p&gt;

&lt;p&gt;Subtly educate them with the necessary information that will encourage them to take your expected reactions. You can do this by using every other thing you have learned above.&lt;/p&gt;

&lt;p&gt;It is necessary to address the doubt and fear of your audience in any content that focuses on your products. With this, you won’t have to do much work in convincing them as your content is already doing it for you; and would speed up their actions.&lt;/p&gt;

&lt;p&gt;With all of this, you will get the interest of developers to take them to your write-ups, make them feel the magic in your products and then find a way to turn them into your clients. &lt;/p&gt;

&lt;p&gt;Most times, getting developers to read your blog is not meant to make them use your products, you simply want them to stick around or visit your blog whenever it appears on Google. In this case, you have to lead them to your products.&lt;/p&gt;

&lt;p&gt;What next? Desire.&lt;/p&gt;

&lt;p&gt;You have to connect your products to their desires. To do this, you have to make sure they feel the magic in your products and clear their doubt or fear. If your products can’t do this, it might be hard to sell to developers. This is what I mean:&lt;/p&gt;

&lt;p&gt;Let’s assume I am the developer using your products and I am scared of vendor lock-in and the scalability of your solution. You won’t be able to sell to me if your products can’t make me realize my fear of vendor lock-in and scalability is unnecessary.&lt;/p&gt;

&lt;p&gt;Things like vendor lock-in, scalability, pricing, security, stability and some others are the major desires that will stop developers from buying your software even if your products make them feel the problem it solves. &lt;/p&gt;

&lt;p&gt;It is important to make your products cater to those desires automatically. Salespeople always get this wrong by trying to do it with flowery words which tend to turn developers off. Don’t say it, make them feel it.&lt;/p&gt;

&lt;p&gt;When you do that successfully, it is time to make them take action to buy your software or services. You need to collaborate with the sales team, in this case, to figure out how to encourage developers to buy. You can start by looking out for their complaints about similar and non-similar software and services to avoid the biases they have already developed for other software or services.&lt;/p&gt;

&lt;p&gt;Once again, it is important to form good relationships with developer communities and elicit their curiosity with terms, interests and desires of their communities instead of trying to use selling tricks on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to align business goals with DevRel
&lt;/h2&gt;

&lt;p&gt;“We are all so desperate to be understood, we forget to be understanding.” – Beau Taplin&lt;/p&gt;

&lt;p&gt;DevRel people tend to struggle with business objectives because they mostly believe that impact is more important than pushing hard to sell things to the developer communities while business people favour selling at all costs. Then, what is the way forward?&lt;/p&gt;

&lt;p&gt;Aligning business goals with DevRel is basically built on speaking each other’s languages. &lt;/p&gt;

&lt;p&gt;It is easier to flow with business people if DevRel objectives show clear paths to drive measurable adoption just like how it will be easier for business people to make DevRel people more effective if they can clearly demonstrate what they expect with the language developers understand – Impacts and Relationships.&lt;/p&gt;

&lt;p&gt;Listen, business people have a strong bias towards measurement and you will rarely get them on your side if you can’t measure impacts and relationships as a member of DevRel. &lt;/p&gt;

&lt;p&gt;Likewise, forcing developers to ignore impacts and relationships to sell at all costs is a no-go area. Then what is the way forward?&lt;/p&gt;

&lt;p&gt;Here is it: DevRel should focus on impacts and relationships but make impacts and relationships measurable. Did you just say that is impossible? Well, hear me out because I am about to show you how to do so.&lt;/p&gt;

&lt;p&gt;&lt;a href="//Developer%20Relations/8.%20Measuring%20success/0.%20How%20to%20align%20business%20goals%20with%20DevRel.md"&gt;Learn more...&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Measuring the impact of going to conferences
&lt;/h3&gt;

&lt;p&gt;DevRel people tend to share swags like stickers, shirts, hoodies and some others at conferences as a way to promote their brands. That is amazing but it will be better if we make most of these things actionable so that we can measure significant actions in the end.&lt;/p&gt;

&lt;p&gt;First of all, if you have to share shirts or hoodies at a conference when you’re just getting started, you should only give them to the authorities in your niche or related niches and take pictures with them in your company’s shirt (you don’t need to ask them to put on the shirts you give them to avoid being promotional) and share it on social media later. &lt;/p&gt;

&lt;p&gt;The authorities have built trust, credibility, and authority and have a lot of followers. Putting on your shirts means, they subtly promote your business to their audience that is also your audience. &lt;/p&gt;

&lt;p&gt;The next thing is about the stickers companies usually share at conferences. Instead of just sharing stickers, you can give them a ticket or stickers that are also tickets, and they can use them to claim special services on your platform. &lt;/p&gt;

&lt;p&gt;You can give a ticket that contains an inviting title and a URL to get a well crafted Resume to apply for their next job or a tutorial on how to interview successfully in the industry. &lt;/p&gt;

&lt;p&gt;It could be anything, just make sure it is relevant to all parties involved and they have to come to your platform to redeem it.&lt;/p&gt;

&lt;p&gt;This shouldn’t be promotional, it should be helpful and educational.&lt;/p&gt;

&lt;p&gt;Now, you can:&lt;/p&gt;

&lt;p&gt;measure the number of authorities you give things to and how many of them share it. &lt;/p&gt;

&lt;p&gt;You can measure the number of people you give you stickers, tickets, learning material, and templates and how many of them visit you and drop their emails or carry out the actions you want.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measuring the impact of creating content
&lt;/h3&gt;

&lt;p&gt;Even when you create tutorials (video or article) for SEO or to educate the communities about your products and offerings, you can still include the kind of gifts we discussed under measuring the impact of going to conferences as an incentive to make people act. Thereby we can also measure the impact of those who take action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measuring the impact of engaging developer communities
&lt;/h3&gt;

&lt;p&gt;It is now possible to measure almost all DevRel activities within the developer communities with the kind of actionable gifts we have designed. Just keep sharing them wherever you go and bring them back to your company. &lt;/p&gt;

&lt;p&gt;To make any event, hackathon, content creation or whatever measurable, make them actionable and then, we can measure the action. In short, to make anything measurable, you need to introduce quantifiable things or ideas so that we can have something to measure.&lt;/p&gt;

&lt;p&gt;Yeah, we have made attending conferences more actionable to appeal to business people. Smart, right?&lt;/p&gt;

&lt;p&gt;“All Birds find shelter during a rain. But Eagle avoids rain by flying above the Clouds. Problems are common, but attitude makes the difference” -- APJ Abdul Kalam.&lt;/p&gt;

&lt;h2&gt;
  
  
  More thought on creating swags to engage developers
&lt;/h2&gt;

&lt;p&gt;Swags are mostly meant to promote a company's brand, so they’re mostly objects with the company's logo. This way of sharing swags creates incomplete awareness for your products as far as I am concerned. Awareness is only complete not when your audience knows you exist but when they also know you’re important.&lt;/p&gt;

&lt;p&gt;To achieve this level of awareness, my proposition here is that swags should be produced for other purposes than to promote your brand; they should also be used to educate, encourage networking and induce user acquisition. This approach is interesting as it makes gathering metrics easier in DevRel. &lt;/p&gt;

&lt;p&gt;Let me give you some insights:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Credits:&lt;/em&gt;&lt;/strong&gt; Create credit tickets or cards that give your audience some preferential treatments they can enjoy by visiting your platform. If you use this appropriately, you can acquire users and still have something to measure. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Swags:&lt;/em&gt;&lt;/strong&gt; Swags should not only have logos, they can also have the title of a tutorial and a URL to check it out. Then you can decide what to do with them when they visit you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Networkers:&lt;/em&gt;&lt;/strong&gt; This is a kind of content or swag that is meant to encourage networking at a conference, online or somewhere else. One way or another, you have to make sure they bring people back to you. For example, I think this write-up is designed for that purpose – to basically network with DevRel people in the industry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Educators:&lt;/em&gt;&lt;/strong&gt; This is the swag that is purposefully designed to educate people about any subject. It is effective for business if it brings people to learn on your platform. Just make sure your topics are of great relevance and importance to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Plugins/add-ons/packages:&lt;/em&gt;&lt;/strong&gt; This is a kind of swag that is designed purposefully to share links to some useful packages related to your niche and it can even be the packages your company creates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Software/Applications:&lt;/em&gt;&lt;/strong&gt; This swag is meant to present some specific audience with some useful applications they may not know about but are very useful to help them be productive.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to measure success in DevRel
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;"One measurement is worth a thousand expert opinions."&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
– Donald Sutherland&lt;/p&gt;

&lt;p&gt;Measuring success in DevRel is very important for the sake of business. Business executives need something to measure to have insights about the department. Since DevRel and the Sales teams have to work together to drive revenue, we need to clarify or define what success is for both departments.&lt;/p&gt;

&lt;p&gt;Obviously, success for sales teams is well defined – revenue determines their success, but DevRel teams also contribute to the revenue generated as they bring in developers and tweak products regularly to ensure developers want and are willing to pay for it before the salespeople convert them to paid clients.  &lt;/p&gt;

&lt;p&gt;That description shows DevRel and the Sales team are working together to drive revenue but it is hard to see how DevRel contributes to sales because it is not obvious. &lt;/p&gt;

&lt;p&gt;But without the awareness DevRel creates which eventually generates traffic, there will be no one to convert, so DevRel teams are very important. The question now is, how will I measure success in DevRel?  &lt;/p&gt;

&lt;p&gt;As getting people to use a piece of software and retaining them requires education, trust and reliability, it is important for DevRel teams to focus on impact but it is hard to report impacts to business executives so you have to make impacts measurable.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to measure impacts?
&lt;/h3&gt;

&lt;p&gt;It is hard to measure impacts if we don’t know what it is. So, impact according to the Oxford dictionary, is “the powerful effect that something has on somebody/something” and by a powerful effect, we mean an effect that makes your targets act the way you desire or predetermined.&lt;/p&gt;

&lt;p&gt;Any effect has corresponding reactions so the impact can be measured by measuring the reactions it generates now and later.  &lt;/p&gt;

&lt;p&gt;The impact you create may generate desired or predetermined results now but makes your company struggle later for some reasons. This is why you need to always create content that creates an impact that generates desired results both now and in the future. Using some gimmicks may get you, followers, quickly but can you retain them? If you do, can they yield revenue for your company? &lt;/p&gt;

&lt;p&gt;Also, the quality of your audience is important to determine the quality of impact you have. Dealing with beginners is easier than dealing with experienced developers. You can easily use any selling gimmicks on beginners because they don’t know left from right. &lt;/p&gt;

&lt;p&gt;However, professionals have to see you as an expert to get them to trust and rely on you and that is not easy.&lt;/p&gt;

&lt;p&gt;For these reasons, it is good to tag your content, distribution channels and others with “experts, beginners, intermediates and all” to have intended impacts. Create the right content for the right audience and make them feel the magic in your products. Then, you can measure their interaction with your products.&lt;/p&gt;

&lt;p&gt;In short, to have unexpected but positive impacts or intended impacts, you must solve expected problems or make current solutions unexpectedly better, if not, you might end up having negative impacts and that will affect what you measure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stages of impact
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Awareness&lt;/em&gt;&lt;/strong&gt; is the first stage of impact developer relations are meant to achieve and it is very important to DevRel success. Awareness must be created for your products or services before they can have any powerful effect on anyone whatsoever. It is also essential to make sure the awareness is impactful, that is, it has a powerful effect on your audience.&lt;/p&gt;

&lt;p&gt;By a powerful effect, I mean an effect that makes them act the way you desire or predetermined.&lt;/p&gt;

&lt;p&gt;Awareness is only complete when it generates inbound and outbound impact or effect, that is your audience realizes your offer is important. In DevRel, awareness could be generated with articles, talks, videos, presentations, hackathons, swags and many others. &lt;/p&gt;

&lt;p&gt;Therefore, whatever medium is used to generate awareness must have three sections – a heading that elicits curiosity, a body that solves relevant expected problems or make current solutions better unexpectedly and a trigger that takes them to the next stage of impact.&lt;/p&gt;

&lt;p&gt;For example, a talk at an event to generate awareness should fulfill all the purposes above. The swags shared should also do the same. Until your awareness fulfills all of these requirements, it is not complete. It should be noted that awareness may start today and be completed next year or at any point in time.&lt;/p&gt;

&lt;p&gt;So to measure awareness we have to use something I call “Both sides of the Pareto principle”. The first side of this principle states that approximately 20% of the people that are aware of your products take inbound actions and 20% of those who take inbound actions will take outbound actions. The first side is about the people who took your predetermined actions.&lt;/p&gt;

&lt;p&gt;The second side of the principle states approximately 80% of those who are aware of your products and know it is important are either distracted, occupied, acting on biases,  don’t need or don’t consider your content or products good enough yet. &lt;/p&gt;

&lt;p&gt;The second side is about the people who will take retrogressive or precautionary reactions though they are aware of your products or services. Also, people that know your products exist but don’t know it is important are equal to 5 times those who know it exists and are important.&lt;/p&gt;

&lt;p&gt;They represent the percentage of the audience you’re yet to get their attention and you can get their attention by varying your operation in all ramifications.  I mean you should vary your styles, contents, distribution channels and every other. &lt;/p&gt;

&lt;p&gt;Furthermore, you can calculate the total number of those who are aware of your brands or products in two ways:&lt;/p&gt;

&lt;p&gt;Know you exist and are important = Number of reactions (excluding view, reach and click) times 5.&lt;/p&gt;

&lt;p&gt;Know you exist but don’t know you’re important = Number of those who know you exist and are important times 5 ( total number view * 5 )&lt;/p&gt;

&lt;p&gt;Let’s use the image below as an example:&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/markessien.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/markessien.PNG" alt="An image of Mark Essien, the founder of https:hotels.ng"&gt;&lt;/a&gt;&lt;br&gt;
.&lt;/p&gt;

&lt;p&gt;In this case, “following” is the major action, so to calculate the level of awareness Mark had to get those followers; we will do 9,467 * 5 = 47,335. That means 47,335 people know that Mark exists and is important but 47,335 * 5 = 236,675 are now aware he exists though don't know he is important. Now, the total awareness generated is equal to  47,335 + 236,675.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Acquisition&lt;/em&gt;&lt;/strong&gt; (inbound and outbound action) — This refers to getting some audience. It is all about the audience you’re able to get from the awareness you generate. &lt;/p&gt;

&lt;p&gt;For example, those who consume your content and take actions like subscribing, and sharing and those who take the next action like filling a form (outbound action ). The acquisition is the second stage of impact where you need solid reasons to make the audience take your predetermined reactions.&lt;/p&gt;

&lt;p&gt;To measure acquisition, you have to measure the predetermined reactions with the first side of the Pareto principle. The first side of this principle states that approximately 20% of the people that are aware of your products take inbound actions and 20% of those who take inbound actions will take outbound actions. The first side is about the people who take your predetermined and relevant reactions. &lt;/p&gt;

&lt;p&gt;And those who are yet to take the predetermined reactions, are either taking retrogressive or precautionary reactions. So, your purpose is to keep optimizing your content with subtle messages to clear their fear and doubt hoping you will acquire them one day. &lt;/p&gt;

&lt;p&gt;That is why you have to consider them as a part of the people who are aware of your products and services.&lt;/p&gt;

&lt;p&gt;“Acquisition” is basically about the audience who takes your predetermined reactions whether inbound or outbound except clicks and views.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Activation&lt;/em&gt;&lt;/strong&gt; (Usage) is the third stage of impact where you make your audience to consume your products or services. This is the stage when you have to make sure they feel the magic in your products. Once they feel the magic, they’re activated to keep using your products and tell others about it. You can also use the first side of the Pareto principle to measure activation. It states that approximately 20% of the audience that is acquired takes action to use your products or services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Retention&lt;/em&gt;&lt;/strong&gt; is the fourth stage of impact when your audience has felt the magic in your products or services and they are stuck with it because it solves their problems in interesting ways they can’t do without. &lt;/p&gt;

&lt;p&gt;At this stage, users will churn if they don’t find your products really useful so you have to keep making sure you solve problems that make them stick around. Don’t forget, approximately 20% of the audience that is activated is retained.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Referral&lt;/em&gt;&lt;/strong&gt; is the fifth stage of impact when your audience proudly shares your products and services with their networks to bring them to use them too. You need to make sharing your products easy for your audience and also make sure that you encourage them to do so. Also, approximately 20% of the audience that is retained will refer you to their networks to use your products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Revenue&lt;/em&gt;&lt;/strong&gt; is the sixth stage of impact when you have cleared the doubts and fears of your audience and now pay for your products and services. Now, approximately 20% of the audience that is retained will pay for your products eventually.&lt;/p&gt;

&lt;p&gt;You might be wondering why I call all of these stages of impact. It is for you to realize how the success of your products depends on the great experience of your audience and the more you improve at every stage, the more your chance of increasing adoption and revenue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Product feedback&lt;/em&gt;&lt;/strong&gt; — This is the last stage where you get useful information from your customers to improve your products.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to measure impact quantitatively and qualitatively
&lt;/h3&gt;

&lt;p&gt;By now, you should have some insights into measuring impact quantitatively. We will take it a bit further. The impact can be measured with the reactions it generates – positively or negatively. &lt;/p&gt;

&lt;p&gt;The major reactions as a result of action are predetermined reactions, precautionary reactions, progressive reactions and retrogressive reactions all of which can be measured qualitatively and quantitatively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Predetermined reactions&lt;/em&gt;&lt;/strong&gt; refer to certain reactions you have selectively chosen or want to get before you even act; then, you expect your action to generate the exact reactions. This means desired reactions should be determined before any DevRel activities take place and then we can compare the expected reactions and the actual reactions. &lt;/p&gt;

&lt;p&gt;It is either your audience that takes you or their predetermined reactions. Anyway, your job is to make them take your predetermined reactions.&lt;/p&gt;

&lt;p&gt;To use this effectively, you need to break whatever content you make into components and tag each of the components with desired reactions (quantitative and qualitative). Let’s use an article as a case study. You need to break the article into title, media, body and trigger.&lt;/p&gt;

&lt;p&gt;The title and image are meant to trigger curiosity (qualitative) and clicks (quantitative) action in relation to the reach of the post. Then, we can measure how effective it is by sharing it with our audience on different platforms.&lt;/p&gt;

&lt;p&gt;The body is, for example, meant to make your audience perceive a sense of awe, ease, excitement or opportunity. The more you’re able to get them to this state, the better the chance of them taking your predetermined reaction which is to click the trigger.&lt;/p&gt;

&lt;p&gt;In short, every part of your content, be it articles, presentations or whatever should have reactions or purposes you want them to achieve. Reactions or purposes you want them to achieve could be comments/replies, subscriptions, signups, use of products or payment, and then, you can measure the outcome with both sides of the Pareto principle I explained initially. &lt;/p&gt;

&lt;p&gt;And once they take your predetermined reactions, take their experience to the next level by offering services that give them a better experience to retain them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Retrogressive reactions&lt;/em&gt;&lt;/strong&gt; refer to the reactions that are worse compared to your predetermined reactions. This means your measurement of the quantitative and qualitative parts of your work ends up being worse than you expect. You can use both sides of the Pareto principle to measure retrogressive reactions.&lt;/p&gt;

&lt;p&gt;Most of the time, you have retrogressive reactions because your audience is acting based on biases, experiences, beliefs and knowledge which fault or are against you, so in this case, you have to make them feel or see why their claims are solid and lead them to realize how you or your products have catered for everything they are doubting or scared of.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Progressive reactions&lt;/em&gt;&lt;/strong&gt; refer to the reactions that are better compared to your predetermined reactions. This means you generate more quantitative and qualitative impacts than expected – more comments/replies, subscriptions, payments, referrals and many more.&lt;/p&gt;

&lt;p&gt;These reactions show you’re doing what they really appreciate at the moment ( which may change later). Whenever you perceive this kind of reaction, it is best to care for them to keep having great experiences to retain their loyalty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Precautionary reactions&lt;/em&gt;&lt;/strong&gt; refer to when the reactions of your audience show they are being careful or cautious at the moment. For example, they support you indirectly, subtweet you, and complain indirectly or in non-obvious ways. People react with caution when seeing some good signs in what you do but are yet to get substantial reasons or evidence to vouch for you.&lt;/p&gt;

&lt;p&gt;Whenever you perceive this kind of reaction, it is best to provide verifiable evidence factually and emotionally to get them to your side.&lt;/p&gt;

&lt;p&gt;Now, how do you use all of these?&lt;/p&gt;

&lt;p&gt;You have to use them to see how people react to your content and products and see which reactions get the most desired results in the end so that you can do more of it. &lt;/p&gt;

&lt;p&gt;For example, your content may generate retrogressive reactions and attract a lot of people to your funnel but that may not be favourable if they don’t take your most desired reactions and that is why you have to pay attention to the reaction that brings you the best result and do more of it.&lt;/p&gt;

&lt;p&gt;&lt;a href="//Developer%20Relations/8.%20Measuring%20success/1.%20Measuring%20success%20in%20DevRel.md"&gt;Learn more...&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hierarchy of reactions/engagements
&lt;/h3&gt;

&lt;p&gt;1st. feedback&lt;br&gt;
2nd. payment&lt;br&gt;
3rd. Interactions in communities&lt;br&gt;
4th. Signups; subscribe&lt;br&gt;
5th. Reply, comment&lt;br&gt;
6th. Read, watch, listen to&lt;br&gt;
7th. Clicks, views, impression&lt;/p&gt;

&lt;p&gt;The Hierarchy of Reactions refers to different reactions in their order of importance for the sake of collating trustable and dependable metrics for your business. &lt;/p&gt;

&lt;p&gt;Measuring all of these reactions with both sides of the Pareto principle is useful to always have a solid quantitative and qualitative measurement to make your products or services serve your audience better.&lt;/p&gt;

&lt;p&gt;Finally, measuring success in DevRel is so much dependent on DevRel budget, purposes, and product effectiveness. The effort of DevRel will not materialize if the products they promote are not capable of converting and retaining users so it is essential to keep improving the products until they can do so.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring success
&lt;/h2&gt;

&lt;p&gt;Measuring success is relative and that is why it has to be clearly defined before carrying out DevRel activities and we can adjust the activities after measuring results. &lt;/p&gt;

&lt;p&gt;For this reason, I suggest a kind of agile system in which the two sides of the Pareto principle are used to determine expectations for awareness, acquisition, activation, retention, referral, revenue and feedback.&lt;/p&gt;

&lt;p&gt;Doing this makes it easier to set a budget and encourages optimization as it makes it obvious to realize the differences between expectations and actual results.&lt;/p&gt;

&lt;p&gt;In conclusion, there are several ways to go about this based on the context of your organization but I provide this to give you a head start. So, feel free to adjust anything in this write-up to suit the context of your organization and operation.&lt;/p&gt;

&lt;p&gt;Did you feel the magic in this write-up?&lt;/p&gt;

&lt;p&gt;Your reaction here should guide you in selling to developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  One more thing
&lt;/h2&gt;

&lt;p&gt;Do you need to hire a Software Engineer and Developer Advocate with the real work skills you rarely find in a person? Talk to Ayobami on Twitter/x via: &lt;a href="//x.com/codingnninja"&gt;Ayobami Ogundiran&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and your business never remain the same.&lt;/p&gt;

</description>
      <category>devrel</category>
    </item>
    <item>
      <title>Breaking the Barrier: The Science of Selling to Developers</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Thu, 25 May 2023 11:37:32 +0000</pubDate>
      <link>https://dev.to/codingnninja/breaking-the-barrier-the-science-of-selling-to-developers-431n</link>
      <guid>https://dev.to/codingnninja/breaking-the-barrier-the-science-of-selling-to-developers-431n</guid>
      <description>&lt;p&gt;Yes, selling to developers is a barrier and so we keep telling one another, "Don't sell to developers". Have you ever asked yourself, "why is it hard to sell to us? Are we not human beings like every other person?".&lt;/p&gt;

&lt;p&gt;In this article, I will show you why it is hard to sell developers but wait, this article is a part of &lt;a href="https://github.com/codingnninja/DevRel-How-to-sell-to-developers"&gt;DevRel: How to sell to developers&lt;/a&gt;; check it out to learn more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why is it hard to sell to developers?
&lt;/h2&gt;

&lt;p&gt;Selling to developers is very hard for four major reasons – openness, reliability, stubbornness and curiosity – all of which revolve around the practicality of software development. &lt;/p&gt;

&lt;p&gt;Developers are the best among the smart, they are very open and highly curious. At first, these reasons may seem odd but you will realize the truth in them soon.&lt;/p&gt;

&lt;p&gt;Listen, salespeople tend to be tricky or deceiving in selling but the common ethic of most software developers is openness and it is that openness that makes it easy for us to share challenges, experiences and even our faults in public. You would agree with me on this if you’re a developer.&lt;/p&gt;

&lt;p&gt;Or have you seen any community that shares things that should be secrets in public like software developers? Now, how is openness makes it hard to sell to developers? Psychologically speaking, if you’re open, you have a high tendency to dislike those who are not straightforward, isn’t it?&lt;/p&gt;

&lt;p&gt;Also, developers are very smart people. Many of us have learned about human psychology and selling by reading widely and watching documentaries and movies. &lt;/p&gt;

&lt;p&gt;All of this experience plus our encounters with salespeople make us always assume salespeople want to trick us and no human being likes to be tricked. For that reason, we hate to give sellers our attention.&lt;/p&gt;

&lt;p&gt;Developers are amazingly stubborn in pursuit, so we’re always strongly opinionated. Why do you think we have JavaScript libraries and frameworks that do the same thing basically? &lt;/p&gt;

&lt;p&gt;Why do you think we have DRY, WET and YAGNI? We tend to be stubborn in our thinking or belief and if you don’t have an emotionally and logically convincing product, you will struggle to sell to developers.&lt;/p&gt;

&lt;p&gt;Our inherent curiosity makes it very hard to sell software to us and retain us. Many of us are okay with wasting our time and night to build or find out how one shining project works. In short, we like to learn and build our things. &lt;/p&gt;

&lt;p&gt;Are you even a software developer if you don’t have unfinished side projects? Who doesn’t? &lt;/p&gt;

&lt;p&gt;So you can’t easily sell software products to us by telling or tricking us to buy them. We will rather build our alternative if you make us angry or trick us. And if your product is not really convincingly useful, curiosity will take us to the next shining things.&lt;/p&gt;

&lt;p&gt;That is the reality.&lt;/p&gt;

&lt;p&gt;Why do you think developers are open? It is because if we’re not, any piece of software will expose us with ease. Software exposes marketing gimmicks easily because developers have to go through some experience while using them and developers are highly skeptical of software they have not used practically.&lt;/p&gt;

&lt;p&gt;So developers rarely pay for software without experiencing it judging from experience. All this is why using marketing gimmicks without good experience rarely works in selling to developers. &lt;/p&gt;

&lt;p&gt;And it is the responsibility of DevRel to make sure your products work and achieve their purposes. They need to work to make sure your users feel the magic in your products the first time they use them. &lt;/p&gt;

&lt;p&gt;If they don't, DevRel needs to keep providing information to the stakeholders, abstract or create documentation and other forms of content to make the right audience feel the magic in your products. &lt;/p&gt;

&lt;p&gt;"The great liability of the engineer compared to men of other professions is that his works are out in the open where all can see them. &lt;/p&gt;

&lt;p&gt;His acts, step by step, are in hard substance. He cannot bury his mistakes in the grave like the doctors. &lt;/p&gt;

&lt;p&gt;He cannot argue them into thin air or blame the judge like the lawyers. He cannot, like the architects, cover his failures with trees and vines. &lt;/p&gt;

&lt;p&gt;He cannot, like the politicians, screen his shortcomings by blaming his opponents and hoping the people will forget. &lt;/p&gt;

&lt;p&gt;The engineer simply cannot deny he did it. If his works do not work, he is damned." - Herbert Hoover, American engineer and politician&lt;/p&gt;

&lt;p&gt;Talk to me about programming, content creation and DevRel on Twitter at &lt;a href="https://t.co/codingnninja"&gt;Ayobami Ogundiran&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devrel</category>
      <category>programming</category>
      <category>selling</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DevRel is marketing in disguise</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Sat, 06 May 2023 12:48:16 +0000</pubDate>
      <link>https://dev.to/codingnninja/devrel-is-marketing-in-disguise-o07</link>
      <guid>https://dev.to/codingnninja/devrel-is-marketing-in-disguise-o07</guid>
      <description>&lt;p&gt;In the early morning of May 3, 2023, I saw a controversial tweet claiming "DevRel is marketing in disguise".&lt;/p&gt;

&lt;p&gt;Honestly, it is hard to reasonably debunk this claim. But it must be debunked to help business people not to make horrible choices.&lt;/p&gt;

&lt;p&gt;Looking at the claim again, it has the potential to make business people assume they can treat DevRel and Marketing the same way.&lt;/p&gt;

&lt;p&gt;No. That would be a terrible mistake for one major reason: Marketing is a profession of those who can talk while DevRel is a profession of those who can bring the talk to reality or do both.&lt;/p&gt;

&lt;p&gt;This is what I mean:&lt;/p&gt;

&lt;p&gt;It is one thing to promise your audience they will get all their desires plus extra but it is another thing to fulfil the promise.&lt;/p&gt;

&lt;p&gt;Marketers have no strong reasons or incentives to care about whatever happens to the users they bring, they only need to bring users. So they always resort to promising "The Heaven and The Earth" just to meet a target.&lt;/p&gt;

&lt;p&gt;And there is nothing wrong with that because it is the purpose of their job. In short, the mindset of a marketer is to bring in users by all means possible.&lt;/p&gt;

&lt;p&gt;But no, DevRel people can't do the same because their job is more practical than emotional. You can't promise computers to bring solutions into existence.&lt;/p&gt;

&lt;p&gt;It has to be practically done, bit by bit, with blood and sweat but never with just promises.&lt;/p&gt;

&lt;p&gt;DevRel people and developers generally always face the consequences of any promises they make. They have to work hard to create docs, abstractions, presentations and many others just to fulfil the promises.&lt;/p&gt;

&lt;p&gt;Treating DevRel people like marketers tends to prevent them from doing their job of finding and implementing ways to improve user experience to drive adoption and revenue. Turning them to marketers may look good if you focus on vanity metrics instead of what moves your business forward in the end.&lt;/p&gt;

&lt;p&gt;Obviously, DevRel has a lot to do with marketing and selling but they have to be addressed differently because of the practicality of software and software development. Marketers win when they bring in users and so they have an incentive to over-promise. Yes, it is totally different for DevRel people. &lt;/p&gt;

&lt;p&gt;After bringing users, they still have to be part of the process to deliver on their promises. If they fail to deliver on their promises, users will have terrible experiences, product adoption will tank and revenue will plummet, leading to the failure of such a company.&lt;/p&gt;

&lt;p&gt;So, it is reasonable for any business that deals with developers to make sure their DevRel team focuses on making the developer experience better than anyone else can deliver in their industries. The best way to do so; is not to treat DevRel people as marketers.&lt;/p&gt;

&lt;p&gt;Now, in summary, the major difference between marketing and DevRel is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Marketers are fond of &lt;strong&gt;&lt;em&gt;sweetening&lt;/em&gt;&lt;/strong&gt; product promises because they don't face the consequences of their actions as they don't build the product which may lead to terrible user or developer experience and revenue. DevRel teams work hard to fulfill the promises made by marketers and business executives. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketers tend to protect the image of their companies by spreading good news while DevRel tends to protect the image of their companies by trying to improve user experience and satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketing focuses on getting acquiring users without necessarily caring about users' experience while DevRel focuses on relationships and other activities that improve users' experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketers don't have to care about the feedback from their users because it has nothing to do with their job but any DevRel team needs to care about it because it will help to improve users' experience and satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Marketing and DevRel are different in purpose and operation, though they have some intersections in approach. So, treating DevRel teams and operations like marketing is not a good thing for a business that focuses on developers.&lt;/p&gt;

&lt;p&gt;Okay, wait! If marketing is different from Developer Relations, then what is the job of DevRel people? &lt;/p&gt;

&lt;p&gt;They educate stakeholders and create documentation, abstractions, applications and content that make the magic in their products felt so that you won’t need to trick people to buy your products.&lt;/p&gt;

&lt;p&gt;Is DevRel marketing in disguise? What do you think?&lt;/p&gt;

&lt;p&gt;This write-up originally appeared in:&lt;br&gt;
&lt;a href="https://github.com/codingnninja/DevRel-How-to-sell-to-developers"&gt;&lt;strong&gt;&lt;em&gt;DevRel: How to sell to developers&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And don't forget to subscribe to my newsletter &lt;a href="https://codingnninja.substack.com/p/devrel-is-marketing-in-disguise"&gt;Mindcrates&lt;/a&gt; to get the next update straight in your inbox.&lt;/p&gt;

</description>
      <category>devrel</category>
      <category>webdev</category>
      <category>programming</category>
      <category>coding</category>
    </item>
    <item>
      <title>Why do you use Typescript with automated tests?</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Sat, 22 Apr 2023 11:03:35 +0000</pubDate>
      <link>https://dev.to/codingnninja/why-do-you-use-typescript-with-automated-tests-3l91</link>
      <guid>https://dev.to/codingnninja/why-do-you-use-typescript-with-automated-tests-3l91</guid>
      <description>&lt;p&gt;Whenever I use Typescript, I don't think I need to test types of data but output value.&lt;/p&gt;

&lt;p&gt;When I use only JavaScript, I do think, I need to test data types and output value.&lt;/p&gt;

&lt;p&gt;If I have to still test for data types, why then do I use Typescript?&lt;/p&gt;

&lt;p&gt;By tests, I mean automated tests?&lt;/p&gt;

&lt;p&gt;What do you think? &lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to extract title, description or metadata from markdown</title>
      <dc:creator>Ayobami Ogundiran</dc:creator>
      <pubDate>Thu, 02 Mar 2023 15:41:53 +0000</pubDate>
      <link>https://dev.to/codingnninja/how-to-extract-title-description-or-metadata-from-markdown-3nn8</link>
      <guid>https://dev.to/codingnninja/how-to-extract-title-description-or-metadata-from-markdown-3nn8</guid>
      <description>&lt;p&gt;Do you need a piece of code to extract title, description or frontmatter from markdwon dynamically or you are just curious to know how it is done? &lt;/p&gt;

&lt;p&gt;This tutorial shows you how to do it efficiently and step by step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Just give me the code:&lt;/em&gt;&lt;/strong&gt;&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;const&lt;/span&gt; &lt;span class="nx"&gt;extractMetadataFromMarkdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;charactersBetweenGroupedHyphens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/^---&lt;/span&gt;&lt;span class="se"&gt;([\s\S]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;?)&lt;/span&gt;&lt;span class="sr"&gt;---/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadataMatched&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;charactersBetweenGroupedHyphens&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadataMatched&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&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;metadata&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadataLines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadataObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadataLines&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;part&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;part&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&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;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&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;accumulator&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;metadataObject&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;Now, let's explain everything step by step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Declare a function named "extractMarkdownMetadata"
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;extractMarkdownMetadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;markdown&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// The rest of the code will go here  &lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;extractMarkdownMetadata&lt;/code&gt; takes a &lt;code&gt;markdwon&lt;/code&gt; as an argument. Let's assume the markdown we want to use is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;
&lt;span class="sb"&gt;`---
title: how to get things done
description: this is greate
tags: money, income, coding
conver_image: ayobami.jpg
---

This is the main body of the article.`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Write a regex that matches anything within &lt;code&gt;---&lt;/code&gt; and &lt;code&gt;---&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;charactersBetweenGroupedHyphens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/^---&lt;/span&gt;&lt;span class="se"&gt;([\s\S]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;?)&lt;/span&gt;&lt;span class="sr"&gt;---/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clearly, you get the purpose of the regex above but do you understand what each of its units does? Let me explain:&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="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;indicates&lt;/span&gt; &lt;span class="nx"&gt;we&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt; &lt;span class="nx"&gt;writing&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;regex&lt;/span&gt; 
 &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;means&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;matching&lt;/span&gt; &lt;span class="nx"&gt;only&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;beginning&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;
 &lt;span class="o"&gt;---&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="nx"&gt;hyphens&lt;/span&gt;
 &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;whitespace&lt;/span&gt; &lt;span class="nf"&gt;characters &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;enter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;tab&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;whitespace&lt;/span&gt; &lt;span class="nf"&gt;characters &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;texts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numbers&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;symbols&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;white&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;white&lt;/span&gt; &lt;span class="nx"&gt;space&lt;/span&gt; &lt;span class="nx"&gt;character&lt;/span&gt;
 &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;preceding&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="nx"&gt;zero&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt; &lt;span class="nx"&gt;times&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;it&lt;/span&gt; &lt;span class="nx"&gt;operates&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
 &lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;preceding&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="nx"&gt;zero&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;one&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="nx"&gt;So&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;*?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;makes&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;matching&lt;/span&gt; &lt;span class="nx"&gt;lazy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; 
 &lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nx"&gt;S&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;?):&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;group&lt;/span&gt; &lt;span class="nx"&gt;capturing&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;remembers&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;keeps&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;bracket&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; 
 &lt;span class="o"&gt;---&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="nx"&gt;three&lt;/span&gt; &lt;span class="nx"&gt;ending&lt;/span&gt; &lt;span class="nx"&gt;hyphens&lt;/span&gt;
 &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;indicates&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;end&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;regex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Extract frontmeta or metadata from a string
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadataMatched&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;markdown&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;charactersBetweenGroupedHyphens&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadataMatched&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget, &lt;code&gt;markdwon&lt;/code&gt; is a string of markdown passed to the function as an argument and now, we extract the metadata from it. If we console.log &lt;code&gt;metadata&lt;/code&gt; we should have a string that looks like below:&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title: how to get things done
description: this is greate
tags: money, income, coding
conver_image: ayobami.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might want to ask, why do we assess metadataMatched[1] with &lt;code&gt;1&lt;/code&gt; and why not 0 or any other number? &lt;/p&gt;

&lt;p&gt;It is because the regex matched the string including &lt;code&gt;--- and ---&lt;/code&gt; and it is the first element of the array but group capturing helped pick the text between &lt;code&gt;( and )&lt;/code&gt; as the second element of &lt;code&gt;metadataMatched&lt;/code&gt;. So, we used &lt;code&gt;1&lt;/code&gt; to access it. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Split the string of metadata into lines of an array
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;metadata&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadataLines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We return an empty object if &lt;code&gt;metadata&lt;/code&gt; is falsy and split the &lt;code&gt;metadata&lt;/code&gt; string into an array of lines of strings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Convert the lines into an object
&lt;/h2&gt;

&lt;p&gt;After we split the metadata into an array of lines of strings, the &lt;code&gt;metadataLines&lt;/code&gt; should look like below:&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="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title: how to get things done&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;description: this is greate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tags: money, income, coding&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;conver_image: ayobami.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's convert everything into an object.&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;// Use reduce to accumulate the metadata into an object&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;metadata&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;metadataLines&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// Split the line into key-value pairs&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;part&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;part&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&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;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&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;accumulator&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeah, that is what the reduce function does.&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;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;line&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;part&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;part&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This part split each line by semi-colon (:). You should have realized that value is an array because of the rest operator (...). We do it that way in case semi-colon is also used as a part of &lt;code&gt;value&lt;/code&gt; in the &lt;code&gt;key-value&lt;/code&gt; pairs like " title: How to get things done: the best ways".&lt;/p&gt;

&lt;p&gt;In this case, the only string before the first semi-colon is consider to be the key while the remainder is considered to be a value.&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="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;accumulator&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&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;accumulator&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we convert the key and value to &lt;code&gt;key-value&lt;/code&gt; pairs and put them into &lt;code&gt;accumulator&lt;/code&gt;. Remember, &lt;code&gt;accumulator&lt;/code&gt; is an argument from the &lt;code&gt;reduce&lt;/code&gt; callback function.&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="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We checked if value is an array with more than one elment, if that is true, the array elements are join with ":" and if it has an element; we turn it to a string. &lt;/p&gt;

&lt;p&gt;If you look at the complete function, you should see something that looks like below:&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;accumulator&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We pass an empty object as the accumulator to the &lt;code&gt;reduce method&lt;/code&gt; because accumulator is an array by default.&lt;/p&gt;

&lt;p&gt;Now, the final result should look like:&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="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;how to get things done&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;this is greate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;money, income, coding&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;conver_image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ayobami.jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we can now extract frontmatter or metadata from any markdown with JavaScript. What are you waiting for? Go and use whatever you have learnt now.&lt;/p&gt;

&lt;p&gt;See you soon!&lt;/p&gt;

&lt;h2&gt;
  
  
  One more thing
&lt;/h2&gt;

&lt;p&gt;Do you want to solve any business problems with content or programming? Let's talk. Feel free to reach me on Twitter at &lt;a href="https://twitter.com/codingnninja" rel="noopener noreferrer"&gt;Ayobami Ogundiran&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontmatter</category>
      <category>tutorial</category>
      <category>markdown</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
