<?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: Tom Collins</title>
    <description>The latest articles on DEV Community by Tom Collins (@collinstommy).</description>
    <link>https://dev.to/collinstommy</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%2F187284%2F242f0365-e6a9-461e-85da-236e92f09e1f.png</url>
      <title>DEV Community: Tom Collins</title>
      <link>https://dev.to/collinstommy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/collinstommy"/>
    <language>en</language>
    <item>
      <title>Invest time into writing questions: Tips for writing better questions</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 19 Jul 2021 12:11:58 +0000</pubDate>
      <link>https://dev.to/collinstommy/invest-time-into-writing-questions-tips-for-writing-better-questions-2e12</link>
      <guid>https://dev.to/collinstommy/invest-time-into-writing-questions-tips-for-writing-better-questions-2e12</guid>
      <description>&lt;p&gt;The essence of writing code is problem solving. This problem solving will often be a solitary task, you, the keyboard and a code editor. Not all problems are easily solved in this vacuum. For many problems we will benefit from the help of others.&lt;/p&gt;

&lt;p&gt;Every problem or task when writing code is a chance to learn from others. A complex task can usually benefit from the input of multiple developers. &lt;/p&gt;

&lt;p&gt;The more effort we put into asking a question, the more likely we will get an appropriate answer. When posing a question, whether this be over slack, email or in person, we should think of the time put into asking this question as an investment. A poorly framed question with little context will likely yield low quality answers, if any at all. &lt;strong&gt;A well structured question that describes the problem in full is far more likely to be answered well.&lt;/strong&gt; With that, let's look at how we can ask better questions.&lt;/p&gt;

&lt;p&gt;Asking good questions is all about context. We should frame the question with as much information as we can. When asking online you will likely need to give more context that when asking within a team. The same rules generally apply to either scenario though.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Include information on the environment
&lt;/h2&gt;

&lt;p&gt;A key piece of information will always be where this software is running. Is this a performance issue in production? Is this on your local machine? Documentation should be provided with any steps required to set up the environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Your issue should be reproducible
&lt;/h2&gt;

&lt;p&gt;If there are some UI steps required to reproduce a bug, be specific about these. Include the branch name if relevant. Always have your code pushed to a remote repo.&lt;/p&gt;

&lt;p&gt;If you are asking online (stack overflow), create a reproducible code sample on Codepen, Code Sandbox or some other publicly available sandbox. &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Include errors
&lt;/h2&gt;

&lt;p&gt;Don't stop at describing the issue. Include any stack traces from logs or console output. Check the network tab for any related network errors and include anything that is relevant&lt;/p&gt;

&lt;h2&gt;
  
  
  4. List the steps you have taken
&lt;/h2&gt;

&lt;p&gt;Give information on what you have already tried. What commands did you run? What code did you change? What debugging did you do? This will help frame the question and narrow the focus by eliminating these steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Link to code
&lt;/h2&gt;

&lt;p&gt;When the question is on a specific piece of code, link to this in github or give a file path and line number. Don't just give a function name. Help other developers find the code you are referring to.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Explain the problem in full
&lt;/h2&gt;

&lt;p&gt;For more general questions on what technology or a library to use, explain what you are trying to achieve. List the things that matter as well as what matters less. Include any constraints you may have.&lt;/p&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure you give enough information so that the same state can be reached in the application&lt;/li&gt;
&lt;li&gt;Add as much context as you can&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>writing</category>
    </item>
    <item>
      <title>How do you manage wellness and avoid distractions?</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Sat, 02 May 2020 18:05:06 +0000</pubDate>
      <link>https://dev.to/collinstommy/how-do-you-manage-wellness-and-avoid-distractions-3n60</link>
      <guid>https://dev.to/collinstommy/how-do-you-manage-wellness-and-avoid-distractions-3n60</guid>
      <description>&lt;p&gt;With so many new remote workers I'd love to hear how others are managing this new way of work.&lt;/p&gt;

&lt;p&gt;My living room has now become an office/gym/living room. Separating work and life is more challenging for me now. The desk and laptop are always looming in the corner of the room.&lt;/p&gt;

&lt;p&gt;Conversely, I tend to become more distracted without the structure of the office.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do you all separate work from life?&lt;/li&gt;
&lt;li&gt;How are you managing your mental health?&lt;/li&gt;
&lt;li&gt;How are you remaining focused during the workday?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>mentalhealth</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Your code should tell a story: Tips for writing code for others to read</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 24 Feb 2020 12:39:02 +0000</pubDate>
      <link>https://dev.to/collinstommy/your-code-should-tell-a-story-tips-for-writing-code-for-others-to-read-6gi</link>
      <guid>https://dev.to/collinstommy/your-code-should-tell-a-story-tips-for-writing-code-for-others-to-read-6gi</guid>
      <description>&lt;p&gt;When we write code, we are also writing a story for other developers.&lt;/p&gt;

&lt;p&gt;Here are a few tips on how we can write code for our future selves and other developers (our readers).&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Use functions and variables to convey your intention, not comments
&lt;/h3&gt;

&lt;p&gt;Relying on comments can lead to code that takes longer to read and digest. You should think about how your code will live on. It’s a story that others are going to read, possibly for years to come.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;sendResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&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;// get connection to database&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="cm"&gt;/* The function calculates exame results for all students */&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;query&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;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;

  &lt;span class="cm"&gt;/* Generate Email with results */&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;generateHTML&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;html&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;strong&gt;Good:&lt;/strong&gt;&lt;br&gt;
Create extra functions to explain your code. Needing to add a comment should be a call to action to either create a new variable or a new function. Smaller functions are easier to test and lead to dryer code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;getStudentResults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&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;dbConnection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&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;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dbConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&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;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;result&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&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;emailResults&lt;/span&gt; &lt;span class="o"&gt;=&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;html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;generateHTML&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;html&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;sendResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&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;resuls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;emailResultse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resuls&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;strong&gt;Good:&lt;/strong&gt;&lt;br&gt;
Documenting high level functions using something like JSDoc is an ideal use case for comments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * Get student results from the Database
 * @param {object} dbConfig - Config for connecting to the db
 * @param {string} query - Query for the database
 */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;query&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="p"&gt;}&lt;/span&gt;

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



&lt;p&gt;Disclaimer: There are a place and time for comments. I’m not against comments per se, just the overuse of them when clean code is a better option.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Use variables to explain control statements
&lt;/h3&gt;

&lt;p&gt;When others are reading your code you should make their lives as easy as possible. I don’t want a good story ruined by constantly having to make small calculations in my head.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4309394&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// I need to compute this in my brain to figure out what is happening in this if statement&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;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attendance&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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;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="nx"&gt;sendPassMail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;strong&gt;Good:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Assigning new variables to store the results of a statement allows readers of your code to get on with the story.  A reader of your code is trying to find the piece that they are concerned with. Help them follow the story so they can fix the bug or add that piece of functionality. This story will have co-authors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStduentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4309394&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;userPassedCourse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attendance&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50&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;userPassedCourse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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;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="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;h3&gt;
  
  
  3. Avoid ambiguous arguments
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;myFunction(null, undefined, 1)&lt;/code&gt; is not the best start to any story.  Don’t make your readers delve into the function so see what the arguments do. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4309394&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;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attendance&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="c1"&gt;// what does false mean here, I can guess but it should be explicit&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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;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="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&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;strong&gt;Good:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Passing in an object can be a great solution here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;sendEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;passedCourse&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="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4309394&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;userPassedCourse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attendance&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50&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;userPassedCourse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;passedCourse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;passedCourse&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Also Good:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You could make your story more expressive by creating some new functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;sendEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;passedCourse&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="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sendPassEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;passedCourse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&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;sendFailEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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="nx"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;passedCourse&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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4309394&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;userPassedCourse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attendance&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;50&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;userPassedCourse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;sendPassedEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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="nx"&gt;sendFailEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&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;h3&gt;
  
  
  4. Magic is good in some stories, not in ours
&lt;/h3&gt;

&lt;p&gt;Avoid magic numbers. Similar to the ambiguous arguments above, magic numbers have the sort of intrigue we don’t want in our stories&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;getStudents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fieldOfStudy&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;students&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;323424&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Good:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;getStudents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;studentType&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;courseId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;323424&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;fieldsOfStudy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;ENGINEERING&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;BUSINESS&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;students&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fieldsOfStudy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ENGINEERING&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Use enums. Avoid using strings as identifiers.
&lt;/h3&gt;

&lt;p&gt;In the same vein as magic numbers, using strings as identifiers can lead to confusion in your story. Having ids in strings can lead to ambiguity. Refactoring these strings will be more difficult.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undergrad&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SCIENCE_101&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Elsewhere in the code&lt;/span&gt;
&lt;span class="nx"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undergrad&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SCIENCE_101&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;undergrad&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SCIENCE_100&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;strong&gt;Good:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;entity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;UNDERGRAD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;underGrad&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;POSTGRAD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;postGrad&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;getResultsFromDB&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;UNDERGRAD&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;courseId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SCIENCE_101&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;Better yet, use typescript to enforce type safety.&lt;/p&gt;

&lt;h3&gt;
  
  
  6.  Favor verbosity over brevity
&lt;/h3&gt;

&lt;p&gt;Don’t confuse your readers. Our code should be dry, concise and clean but our function names don’t need to be restricted by length.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bad:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getResults&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Good:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;examResults&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getStudentExamResults&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What tips do you have?&lt;br&gt;
I would love to see some code snippets in the comments.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>codequality</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The 10 Best Note Taking Apps for developers</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 06 Jan 2020 13:09:41 +0000</pubDate>
      <link>https://dev.to/collinstommy/the-10-best-note-taking-apps-for-developers-in-2020-23ad</link>
      <guid>https://dev.to/collinstommy/the-10-best-note-taking-apps-for-developers-in-2020-23ad</guid>
      <description>&lt;p&gt;When looking for a note-taking app, there were a few features which I was looking for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Markdown support - support for GitHub flavored markdown.&lt;/li&gt;
&lt;li&gt;Organization - tagging or the ability to create a hierarchy&lt;/li&gt;
&lt;li&gt;Inline Text Editor - being able to write markdown inline without the need for a side-by-side view.&lt;/li&gt;
&lt;li&gt;Cross-Platform - being able to access notes on your desktop as well as when you are on the move.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the things I use these apps for are: taking meeting notes, organizing my daily todo list, planning longer-term goals, collecting recipes, and planning side projects. &lt;/p&gt;

&lt;p&gt;In no particular order here are the best note-taking apps in 2021:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Evernote
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms&lt;/strong&gt;: Mac, Windows, Linux, Mobile, Web&lt;/p&gt;

&lt;p&gt;Evernote is one of the most ubiquitous note-taking apps out there. It has a solid text editor with a wide variety of features, such as tables, nested lists, file attachments, and font colors. You can also set reminders on notes, something that most apps on this list do not allow.&lt;/p&gt;

&lt;p&gt;The organization system is solid. You can create notebooks to group notes by topic. Notes can be tagged and searched by tag. &lt;/p&gt;

&lt;p&gt;While Evernote has a solid feature set and great cross-platform support, it falls down in one key area, markdown support. I would consider this a must for any note-taking app for developers. The organization of notes is also somewhat limited in that you are restricted to notebooks and tagging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Evernote is a solid choice if you can forgo markdown support. For non-developers, it’s a strong note-taking solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Typora
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Windows, macOS, Linux&lt;/p&gt;

&lt;p&gt;Typora is a minimalist note-taking app available for desktop only. The inline editor is beautiful. Of all the note-taking apps I’ve tried this has one of the strongest editors. It has support for tables, various font families and nested unordered lists. Markdown works great in this editor, with a very seamless experience.&lt;/p&gt;

&lt;p&gt;Sticking with the minimal approach, Typora allows you to organize notes using folders and subfolders. Markdown files are used under the hood for storing your notes. There is currently no tagging system which can make it difficult to organize notes across different functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; One of the best editors on the list. A minimalist approach is taken to organizing notes.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. OneNote
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Windows, macOS, Mobile, Web&lt;/p&gt;

&lt;p&gt;Microsoft OneNote is a feature-rich note-taking app. It uses a similar system to Evernote for organizing notes, with notebooks being the main mechanism. OneNote does also allow you to create sub-pages though. More recent versions do have custom tags, though the UI for this is clunky.&lt;/p&gt;

&lt;p&gt;The text editor has a large feature set. Most users will be familiar with the Microsoft Office UI. Tables, nested lists, attachments, to-do lists are all supported. There are also drawing tools, which is something that most other apps on this list are missing. &lt;/p&gt;

&lt;p&gt;Like Evernote, a big drawback is the lack of markdown support and the plethora of features can seem overwhelming at times. I found the simpler todo apps were more pleasant to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A feature-rich to-do app with no markdown support. Windows users will be at home with OneNote.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Bear
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; iOS, macOS&lt;/p&gt;

&lt;p&gt;Bear is a beautifully crafted note-taking app. It features a fantastic inline text editor, with good markdown support. The current version of Bear is missing a few markdown features, such as tables and full support for indented lists.&lt;/p&gt;

&lt;p&gt;The UI is excellently designed. There are a number of view options, that can allow you to move between an editor view and a menu view. The various themes help to create an excellent aesthetic. It’s clear the team behind Bear has taken great effort with the design and UX. &lt;/p&gt;

&lt;p&gt;Where Bear really shines, is its tagging ability. You can tag notes within the editor itself using a #. Bear supports the nesting of tags allowing you to create a hierarchy while organizing your notes. Multiple tags are supported on a single note. The side menu is centered around these tags.&lt;/p&gt;

&lt;p&gt;Bear does have a few notable drawbacks. It currently does not have an Android app or a web app. For those who are not fully bought into the Apple ecosystem, it means having Bear as your single note/todo app can be difficult.  &lt;/p&gt;

&lt;p&gt;The editor, while excellent does not have the flexibility of Notion or Slite. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A beautiful UI, fantastic text editor, and best in class tagging system make this a great choice for Apple users.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Notion
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Mac, Windows, Mobile, Web&lt;/p&gt;

&lt;p&gt;The functionality of Notion goes far beyond note-taking. Its feature set boasts pages, databases, wikis, templates, todo, and boards. It offers a huge amount of flexibility and customization. Templates leverage this flexibility and provide examples of how to create pages for specific tasks. Examples of templates include a recipe book, a Kanban board or a CRM.&lt;/p&gt;

&lt;p&gt;The inline text editor itself is very strong. It has solid markdown support and allows for multiple columns and drag n drop. It is missing a few markdown features such as proper nested lists and tables.&lt;/p&gt;

&lt;p&gt;There are a variety of ways to organize notes. You can create pages and subpages. You can create databases with labels and links to notes. You can link pages from within other pages. Notion also allows you to share any given note or workspace with others using a shareable link or by inviting by email. &lt;/p&gt;

&lt;p&gt;The one notable thing missing in Notion is tagging notes outside of a database. If Notion had the tagging functionality of Bear it would be close to the perfect note-taking app.&lt;/p&gt;

&lt;p&gt;The fact that Notion themselves use the app for their support docs and release docs is a testament to how flexible the application is. This is where Notion really shines. If you want a do-it-all note-taking and organization app, look no further. It’s not the strongest in any one feature but it does most things very well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A do-it-all note-taking app that is strong in most areas with strong cross-platform support.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Boost Note
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Windows, Mac, Linux, Web&lt;/p&gt;

&lt;p&gt;Boostnote is an open-source note-taking app built for developers. It uses a straightforward side by side editor. It has good markdown support which includes tables, lists and code blocks. &lt;/p&gt;

&lt;p&gt;The editor itself is pretty basic. For me, inline editors such as Typora and Bear offer a better note-taking experience. &lt;/p&gt;

&lt;p&gt;Boost Note is pretty strong when it comes to organization. It allows you to tag individual notes and the side menu allows you to easily find notes by tag. You can store notes in the cloud or locally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A note-taking app with a basic editor and good organization. &lt;/p&gt;

&lt;h3&gt;
  
  
  7. Notable
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Windows, Mac, Linux&lt;/p&gt;

&lt;p&gt;Notable is very similar to Boost Notes. It has a side-by-side editor, markdown support and tags. It does outshine Boost Note on two features, its text editor and its tagging system. Nested tags are supported in Notable, a big plus on the organizational front. Its text editor has better markdown support and is easier to use than Boost Notes.&lt;/p&gt;

&lt;p&gt;The Notable UI is simple, clean and easy to use.&lt;/p&gt;

&lt;p&gt;There is no mobile or web version at this time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A free no-frills note-taking app for desktop with tagging and markdown support.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. DropBox Paper
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Web&lt;/p&gt;

&lt;p&gt;Dropbox paper provides a great online note-taking experience. It has good markdown support and a fantastic inline editor. It allows teams to collaborate on notes with features such as commenting, todo, and sharing. The organization of notes is pretty bare bones. You can create folders and subfolders and that’s it.&lt;/p&gt;

&lt;p&gt;Dropbox paper is currently only available on the Web; meaning that, internet access is needed when accessing your notes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A nice online note-taking app with good collaboration tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Slite
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Windows, Mac, Mobile, Web&lt;/p&gt;

&lt;p&gt;Slide bills itself as a collaboration tool and note-taking app all in one. It features a beautiful UI and excellent text editor. The drag and drop functionality and markdown support make this one of the strongest editors on the list.&lt;/p&gt;

&lt;p&gt;Slite is aimed at teams. It allows you to create organizations within the app to share notes across teams. You can use Slite as a wiki for your team or as your own personal note-taking app.&lt;/p&gt;

&lt;p&gt;Slite uses the concept of channels for organizing notes. The side menu that allows you to browse channels is beautifully designed. Unfortunately, there is no tagging support for now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Slite is a great option for teams and organizations who want to share notes and create wikis. It has one of the strongest text editors and a beautiful UI.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. StackEdit
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Platforms:&lt;/strong&gt; Web&lt;/p&gt;

&lt;p&gt;StackEdit is a straightforward markdown editor that concentrates on integrating with platforms such as Google Drive, Dropbox, and GitHub. &lt;/p&gt;

&lt;p&gt;Its UI is certainly not the prettiest on the list but as a note-taking app, it gets the job done. The editor is quick and easy to use. &lt;/p&gt;

&lt;p&gt;The organization is basic and relies on folders with no tagging support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; A basic editor with Google Drive integration&lt;/p&gt;

&lt;h2&gt;
  
  
  The Winner
&lt;/h2&gt;

&lt;p&gt;Many of the apps on this list focus on different areas. Several present themselves as an all-in-one solution for documentation, wikis, and note-taking. Others focus on offering an inexpensive note-taking solution specifically for developers. Each app has its own specialty and no one app performs perfectly across all areas. &lt;/p&gt;

&lt;p&gt;I made a conscious decision to ignore the price. Most of these apps are inexpensive and if you use them correctly should be worth far more to your productivity than their price tag.&lt;/p&gt;

&lt;p&gt;With that being said, here are my picks of the bunch:&lt;/p&gt;

&lt;h3&gt;
  
  
  Overall Winner: &lt;a href="https://www.notion.so"&gt;Notion&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This was a close race between Note, Bear, and Slite. Notion’s flexibility and cross-platform support make it the best all-in-one solution. It has a huge feature set and a good editor. If you want to use a single app to store notes and stay you organized, look no further than Notion.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Editor: &lt;a href="https://www.dropbox.com/paper"&gt;Dropbox Paper&lt;/a&gt; &amp;amp; &lt;a href="https://typora.io/"&gt;Typora&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;There is little to choose from both of these excellent editors. Both have excellent markdown support and a clean inline editor. Typora is best if you need offline support. Dropbox wins if you want to collaborate. Slite should also get a special mention here. &lt;/p&gt;

&lt;h3&gt;
  
  
  Best Apple Specific App: &lt;a href="https://bear.app/"&gt;Bear&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;I’m a huge fan of Bear. Its note-taking experience is great and its tagging is an excellent way of staying organized. The UI is pleasing to use and beautiful on the eye. All it is missing is cross-platform support and some extra features in the editor such as drag and drop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honorable mentions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Keep&lt;/li&gt;
&lt;li&gt;Ulysses &lt;/li&gt;
&lt;li&gt;Quiver&lt;/li&gt;
&lt;li&gt;Simple Note&lt;/li&gt;
&lt;li&gt;Joplin&lt;/li&gt;
&lt;li&gt;TiddlyWiki&lt;/li&gt;
&lt;li&gt;Cherry Tree&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;With so many options for note-taking apps and so many features available there is a good chance that I missed out on some features. I will gladly update any of the points above to fix inaccuracies.&lt;/p&gt;

&lt;p&gt;I use a combination of Notion and Bear. Notion for ToDo’s and project planning and Bear for note-taking.&lt;/p&gt;

&lt;p&gt;So what is your favorite note-taking app? Comment below.&lt;/p&gt;

&lt;p&gt;*EDIT: Update honorable mentions with suggestions from comments.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>webdev</category>
      <category>writing</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Looking back on 2019 - 7 Lessons Learnt</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Thu, 02 Jan 2020 12:14:29 +0000</pubDate>
      <link>https://dev.to/collinstommy/looking-back-on-2019-7-lessons-learnt-4mp4</link>
      <guid>https://dev.to/collinstommy/looking-back-on-2019-7-lessons-learnt-4mp4</guid>
      <description>&lt;p&gt;Cross post from &lt;a href="https://www.tcollins.dev" rel="noopener noreferrer"&gt;tcollins.dev&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Learning shouldn’t always be about your job
&lt;/h3&gt;

&lt;p&gt;In the past, I’ve always tailored my learning outside of work to what is relevant to my current work projects. I feel an important part of being a developer is to keep the passion for learning alive. For me, recently, that has meant stepping outside my comfort zone of Front End Development. This year I’ve spent time learning design principals, how to set up a web server on a VPS, and doing some writing. Of course, these do broadly relate to my field. They compliment my current skills and have the potential to open doors to other areas. &lt;/p&gt;

&lt;p&gt;I believe continuous learning is more important than the subject matter you study. Keeping variety in my learning has helped me stay interested and motivated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftmhgivnjznq3hadd0t36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftmhgivnjznq3hadd0t36.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. We should all ask more questions
&lt;/h3&gt;

&lt;p&gt;If you are a Junior Developer, ask more questions. Learn as much as you can in this early part of your career. Know that imposter syndrome happens to all of us. Every developer starts off in your very position.&lt;/p&gt;

&lt;p&gt;If you are a Senior Developer, ask more questions. You may not know as much as you think and you can always learn more. Challenge your assumptions and learn from your team.&lt;/p&gt;

&lt;p&gt;If you are a Jedi Developer/Coding Savant, ask more questions. This will encourage more junior members to ask more questions. Discussions you start will help you, and others around you, learn.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Writing good code is only part of it
&lt;/h3&gt;

&lt;p&gt;Clean performant code is only one piece of the puzzle. A huge part of successfully writing software is coordinating people. Having a great process around how you develop and deploy software is crucial. Motivating a team of developers will impact code quality. Organizing and coordinating a group of developers to write code in a scalable way is the cornerstone of the entire process.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Statically generated web pages are a great option
&lt;/h3&gt;

&lt;p&gt;Static site generators are a game-changer. Frameworks like Gatsby, Hugo and Jekyll allow the advantage of automating the generation of pages without the overhead for a web server. There is often a need to have dynamic data that does not continually change, but changes according to some semi-regular event such as a blog post or a product launch. For these, statically generated pages are ideal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpjamx290s7ijeg0qs0il.jpeg" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpjamx290s7ijeg0qs0il.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Writing takes much longer than I expected
&lt;/h3&gt;

&lt;p&gt;Planning, researching, and writing articles take far longer than I expected. As soon as I sit down to write an article, I see where the holes in my knowledge lie. This invariably leads to further research and diving down rabbit holes. Not being a natural writer, the proofreading and various drafts are somewhat onerous. Next year, I’m going to try to work on a few articles at once, in different stages, in an attempt to increase the cadence of new articles.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Use apps to boost my productivity
&lt;/h3&gt;

&lt;p&gt;This year I’ve started using Notion and Bear for note-taking and todos, Insomnia for testing API endpoints, and Grammarly to bolster my writing skills.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>writing</category>
    </item>
    <item>
      <title>Lessons from Scrum</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Sat, 14 Dec 2019 13:58:09 +0000</pubDate>
      <link>https://dev.to/collinstommy/lessons-from-scrum-il3</link>
      <guid>https://dev.to/collinstommy/lessons-from-scrum-il3</guid>
      <description>&lt;p&gt;Cross post from &lt;a href="https://www.tcollins.dev/lessons-from-scrum/"&gt;tcollins.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently our development team switched to scrum. Before we adopted scrum we were using a more ad hoc process. We had the concept of tickets and rounds of review. There was however no strong process in place.&lt;/p&gt;

&lt;p&gt;It has taken us a number of sprints to hone the process. Below are some of the lessons we learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tasks over 2 days =&amp;gt; split them up
&lt;/h2&gt;

&lt;p&gt;We primarily estimate by tasks. Each story has a number of sub-tasks. We estimate each sub-task in days. The sum of these tasks is then compared to our capacity. The textbooks will likely recommend estimating using story points. This is, of course, a valid approach; however, estimating by days has been working great for us.&lt;/p&gt;

&lt;p&gt;If a task is longer than two days, it’s an indication that there is some complexity hidden within the task. The longer the estimate, the greater the risk that you are underestimating the time required to complete this task. If you find yourself attaching an estimate of more than two days, ask yourself: what is making this task more complex? Look at how you can split this into two or more subtasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acceptance Tests are vital
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5vv1BG1E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9e6mywfie0rb8thwi3mm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5vv1BG1E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9e6mywfie0rb8thwi3mm.png" alt="Checklist"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest advantages of using scrum for our team was the accuracy of requirements. Every story now has a set of acceptance tests that need to be completed in order for the story to be considered done.&lt;/p&gt;

&lt;p&gt;An acceptance test should indicate the input and the expected output. They may also include that current state of the app. &lt;a href="https://openclassrooms.com/en/courses/4544611-write-agile-documentation-user-stories-and-acceptance-tests/4810081-writing-acceptance-tests"&gt;https://openclassrooms.com/en/courses/4544611-write-agile-documentation-user-stories-and-acceptance-tests/4810081-writing-acceptance-tests&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest advantage we saw with acceptance tests was that requirements were discussed upfront with our stakeholders. Questions, discussion, and clarifications happened at the planning stage rather than the implementation stage. This reduces the risk of bugs as well as underestimating tasks.&lt;/p&gt;

&lt;p&gt;Having acceptance tests right there with the story is a godsend. It avoids the need to dig through docs or recall conversations on features.&lt;br&gt;
Acceptance tests are also a great basis for unit tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Review Often
&lt;/h2&gt;

&lt;p&gt;A by-product of having smaller tasks is that you tend to have smaller commits and conversely a shorter code review cycle. Reducing the time pull requests stay in review keeps your cadence up, and reduces the risk of large changes being required for code review changes. Large code reviews tax the reviewer. Shorter reviews will get a more thorough review, line by line, which is going to greatly help with code quality.&lt;/p&gt;

&lt;p&gt;Aim to have several code reviews each week, or even each day. You can stub our modules that are not yet implemented and communicate this with your reviewers.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Source of Truth
&lt;/h2&gt;

&lt;p&gt;Have one source of truth. Your one source of truth should be your Scrum board. I've used physical whiteboards for this as well as digital boards.&lt;/p&gt;

&lt;p&gt;JIRA is our source of truth but any tool you are comfortable with will work. Each story has all acceptance tests as well as links to copy docs, translations, videos, and designs. The key thing is that all assets live alongside the story itself. Gone are the days of trawling through slack conversations or emails. I can open the ticket and commence development right away.&lt;/p&gt;

&lt;p&gt;If you use a physical board for your tickets, think about how you can manage your digital assets in an orderly way. You may elect to mirror this board in digital form. We use Google Drive, which hosts most of our content, and then link to specific Google documents in the JIRA ticket.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do your high-risk tasks first
&lt;/h2&gt;

&lt;p&gt;Unknown tasks will always have the highest likelihood of hidden complexity. It’s best to approach tasks that may look the most unpleasant or the most complex early on in the project. If you are going to overrun a deadline it’s best to know early on.&lt;br&gt;
Starting with your unknown tasks gives you the opportunity to discuss requirements with stakeholders. You will have more time to clarify issues with stakeholders and fix any blocker that may arise.&lt;/p&gt;

&lt;p&gt;Examples of high-risk tasks are tasks that have business logic, tasks dealing with data, and tasks that are outside your domain of expertise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo &amp;amp; Deploy Often
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sR5MvjcV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ui2oucble3sbeik7vn0n.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sR5MvjcV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ui2oucble3sbeik7vn0n.jpeg" alt="Ship it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stick to your sprint demo schedule. Frequent demos help with communication with stakeholders. Deploying often reduces the risk of bugs being found in production.&lt;br&gt;
I'm sure we have many more lessons to learn. We continually look to improve how we write software. Overall adopting scrums has been a huge win for our team and our stakeholders. By following the points above we've seen many benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Happier stakeholders - Stakeholders are kept in the loop and are more active in creating requirements&lt;/li&gt;
&lt;li&gt;Better estimation - We can now give clearer estimates to stakeholders and management. If we need more dev resources we can identify this early on.&lt;/li&gt;
&lt;li&gt;Planning - Acceptance tests are set in advance. The requirements of each feature are clear&lt;/li&gt;
&lt;li&gt;Happier developers - There is less context switching as all information is in JIRA.  Change requests go through the backlog and planning to reduce distractions during the sprint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My advice to you if you are not yet using Scrum/Agile, is to try it out for one project. Give yourself a number of sprints and expect to improve over time. Talk to your stakeholders and management about the advantages to them. Document the process early on and follow this process as strictly as you can. As you continue with scrum you will refine and improve this process.&lt;/p&gt;

</description>
      <category>agile</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Starting is the hardest part: 4 rules to stop procrastination </title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 09 Sep 2019 17:57:10 +0000</pubDate>
      <link>https://dev.to/collinstommy/starting-is-the-hardest-part-4-rules-to-stop-procrastination-4ocb</link>
      <guid>https://dev.to/collinstommy/starting-is-the-hardest-part-4-rules-to-stop-procrastination-4ocb</guid>
      <description>&lt;p&gt;As developers, many of us have an idea for some side project. For many this is just a thought, something that has been stewing in back of our minds. All too often, these stay as just that, ideas. Often this is due to time constraints. Work is busy, family and friends take up our time or we just don't have the energy. &lt;/p&gt;

&lt;p&gt;There's another far more common reason. Its dam hard to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why is getting started so tough&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Building habits is difficult.&lt;/strong&gt; Studies have shown that it takes on average 21 days to build a habit. (Some guy in the pub told me that). It's the reason why it's often tough to drag ourselves to the gym or start to learn something new. We begin at first with an exuberance, which soon subsides as we realize the extent of the work involved in our new venture. We have lofty goals that we aspire to. These goals appear distant from our lowly starting point. &lt;/p&gt;

&lt;p&gt;There is often a &lt;strong&gt;gap between what we want to build and what we can realistically achieve&lt;/strong&gt;. We set out to create something ambitious, epic, game-changing but soon realize the extent of the work involved. This same conundrum befalls many a new developer. You're learning how to structure a HTML document but you want to build a single page application that you can show to your friends.&lt;/p&gt;

&lt;p&gt;Our brain gets a similar rush of serotonin from telling people our plan as it does from executing said plan. (More barstool facts) &lt;strong&gt;Talking about an idea is rewarding in itself.&lt;/strong&gt; Planning and imagining our project feels great and takes far less work. We should not linger too long in this zone of non-building.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to get started&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Plan, don't over-plan&lt;/strong&gt;&lt;br&gt;
Sure, dream big, have a vision, shoot for the goddam stars. Having a road map is absolutely a positive thing. Just don't over plan. Set your expectation of success. For many of us that maybe "The was harder than expected but I learned something new".  Concentrate on small achieve tasks. If you build and build that success will become an inevitability. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Start with small and achievable&lt;/strong&gt;&lt;br&gt;
Focus on small, achievable tasks. These should be some small piece of functionality that adds a small piece of value. As much as it can this should be end to end. It should bring a user from start to finish for a single feature. Set out a number of these small achievable tasks early on. You will be able to build some momentum in this way. Once you get into a cadence of some sort you can start to plan further ahead.&lt;/p&gt;

&lt;p&gt;Day 1 maybe create a wireframe of the first user journey. Day 2 build out your skeleton app. Day 3 get some sample data from your data source to your view.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Build an MVP&lt;/strong&gt;&lt;br&gt;
The best way to validate an idea is to get it out into the world. With some luck, people will see the value in your idea. Your reward circuitry in your brain will get it hit. New motivation will overcome you and you'll start on v2.&lt;/p&gt;

&lt;p&gt;Having a goal of something deliverable early on will help steer your first feature set. By dividing an conquering what was daunting becomes more manageable.&lt;/p&gt;

&lt;p&gt;As your building this MVP a strong focus should be making this deployable. Build this into your initial plan. Ideally, deploy each feature as they as built into a test environment. &lt;/p&gt;

&lt;p&gt;4.&lt;strong&gt;When building, build towards an outcome&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you sit down to start planning/developing, have an outcome. At the early stages that may be a wireframe or a list of features to build next. Have in mind what you should have done by the end of your session.&lt;/p&gt;

&lt;p&gt;When working with others, go into meetings with an agenda of what to discuss. Outline your desired outcomes from the start. Going into meetings everyone should know what should be taken from the meeting. After the meeting you want to be one step closer to your next milestone. Think of your desired artifacts from the meetings as being concrete actions.&lt;/p&gt;

&lt;p&gt;…. ok then its time to stop reading and go build that project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A portfolio template made with Gatsby </title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 19 Aug 2019 08:16:35 +0000</pubDate>
      <link>https://dev.to/collinstommy/a-portfolio-template-made-it-gatsby-ig2</link>
      <guid>https://dev.to/collinstommy/a-portfolio-template-made-it-gatsby-ig2</guid>
      <description>&lt;p&gt;A while back I came across a cool project that allows you to quickly create your own portfolio site:&lt;br&gt;
&lt;a href="https://github.com/imfunniee/gitfolio"&gt;https://github.com/imfunniee/gitfolio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been using Gatsby recently and I'm a big fan. I decided to port gitfolio over to use gatsby as its a perfect fit for a static site generator.&lt;/p&gt;

&lt;p&gt;Clone the repo to get started on your own:&lt;br&gt;
&lt;a href="https://github.com/collinstommy/gitfolio-gatsby"&gt;https://github.com/collinstommy/gitfolio-gatsby&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demo:&lt;br&gt;
&lt;a href="https://collinstommy.github.io/gitfolio-gatsby/"&gt;https://collinstommy.github.io/gitfolio-gatsby/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>gatsby</category>
      <category>career</category>
    </item>
    <item>
      <title>A Case Against Type Selectors</title>
      <dc:creator>Tom Collins</dc:creator>
      <pubDate>Mon, 01 Jul 2019 09:58:58 +0000</pubDate>
      <link>https://dev.to/collinstommy/a-case-against-type-selectors-46nn</link>
      <guid>https://dev.to/collinstommy/a-case-against-type-selectors-46nn</guid>
      <description>&lt;p&gt;I’ve been contemplating the use of type selectors in CSS recently. Below are largely opinions and I welcome comments or corrections on the topic.&lt;/p&gt;

&lt;p&gt;So let's dig into the issue at hand, type selectors in CSS. &lt;/p&gt;

&lt;p&gt;A common use case for type selectors is for enforcing site-wide styles. This allows you to keep things on brand by setting properties such as color, font-size, and spacing.&lt;/p&gt;

&lt;p&gt;Let's take an example. You create some styles for our site.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'#33475b'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3.2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bold&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5rem&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.2&lt;/span&gt; &lt;span class="n"&gt;rem&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;So now we have some base styles for our elements. We want to build out some pages. Let's start with a news section. This will have some images and text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launching our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;sr=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I want to give my &lt;code&gt;news&lt;/code&gt; section some styles. I know I will have different types of &lt;code&gt;section&lt;/code&gt; elements so I give this a class. Time to styles my elements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nc"&gt;.news&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// p tag, have some breathing space&lt;/span&gt;
    &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&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="c1"&gt;// I want my images to stand out from my text so lets give it some padding&lt;/span&gt;
    &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="nt"&gt;padding&lt;/span&gt; &lt;span class="nt"&gt;1rem&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;Great stuff. Now my page is ready for some new content. &lt;/p&gt;

&lt;p&gt;After adding some content I decide that some of my articles need avatars. I want to have a series of them appear in a row.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launching our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;sr=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I'm a different article&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;but I need some avatars&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &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;"news__row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;sr=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;sr=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&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;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;    &lt;span class="nc"&gt;.news&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;__row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&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="p"&gt;}&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I load up my webpage. Here is where the problems start. My images have inherited this extra padding. This padding made sense for my initial design of one image per news update.  It has broken my avatar design where I don’t want this spacing.&lt;/p&gt;

&lt;p&gt;I could, of course, fix this by overriding the styles, increasing the specificity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;    &lt;span class="nc"&gt;.news&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;__row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nc"&gt;...&lt;/span&gt;
            &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="err"&gt;...
                &lt;/span&gt;&lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&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="p"&gt;}&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is not ideal as each time I add a different child element that has an image I woul need to override this padding. This illustrates the first issue of type selector styling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breaking future designs
&lt;/h2&gt;

&lt;p&gt;For each new case where I need different &lt;code&gt;img&lt;/code&gt; styles in my news section, I am required to override the padding. The default I have imposed on this section only works for my initial use case. My initial use case was not a good candidate for element type styling. It was too specific and was more suited to class selectors. &lt;/p&gt;

&lt;p&gt;By using classes I can ensure that I am being intentional when styling my elements. Aside from my site-wide typography styles, my elements will only be styled by the classes I assign to them.&lt;/p&gt;

&lt;p&gt;Take note of the &lt;code&gt;.news__avatar&lt;/code&gt; selector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight scss"&gt;&lt;code&gt;    &lt;span class="nc"&gt;.news&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;__row&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;__avatar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// no padding to override&lt;/span&gt;
            &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;__feature-image&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nt"&gt;padding&lt;/span&gt; &lt;span class="nt"&gt;1rem&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;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launching our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news__feature-image"&lt;/span&gt; &lt;span class="na"&gt;sr=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launching our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &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;"news__row"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news__avatar"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news__avatar"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"myimage"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="nt"&gt;/&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;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By moving to use classes and BEM notation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I’m being more intentional in the styles that I apply to the elements&lt;/li&gt;
&lt;li&gt;When reading my markup I can see where my elements are getting styles from&lt;/li&gt;
&lt;li&gt;I can now search my code base for &lt;code&gt;__avatar&lt;/code&gt;. I’m helping some other poor developer who has to deal with my code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another advantage is that my elements are styled like components. As they follow a BEM notation, moving these to reusable components is an easier task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight jsx"&gt;&lt;code&gt;    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;NewsItem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;heading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;imageUrl&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;(&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;article&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;heading&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"news__feature-image"&lt;/span&gt; &lt;span class="na"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;imageUrl&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"image"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;article&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;My feature image no longer relies on being within &lt;code&gt;.news&lt;/code&gt; and being an &lt;code&gt;img&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;This leads to another disadvantage of type selector styling:&lt;/p&gt;

&lt;h2&gt;
  
  
  Reliance on element types
&lt;/h2&gt;

&lt;p&gt;By tying styles to an element type I am introducing the need to change CSS if I need to add these styles to another element. Using my old element styling the following markup will require a change in CSS&lt;/p&gt;

&lt;p&gt;If I target &lt;code&gt;img&lt;/code&gt; my &lt;code&gt;svg&lt;/code&gt; will not pick up the correct styles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launchin our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="err"&gt;.....&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;By associating my styles with a class selector I can apply this to different element types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;We're launchin our new site&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Check it out for lots of new content&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news__feature-image"&lt;/span&gt; &lt;span class="err"&gt;....&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Let's take another use case. I have a  &lt;code&gt;span&lt;/code&gt; I use in my web app. It's a simple back button that triggers some javascript. I style this by using a type selector:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;Back&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.news&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;span&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'#0091ae'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;underline&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;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Later to let SEO crawlers know what this span does I change this to be anchor tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;section&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"news"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mysite.com/homapege"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Back&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Again here I have broken my styles and need to change my CSS&lt;/p&gt;

&lt;h2&gt;
  
  
  Difficult in debugging
&lt;/h2&gt;

&lt;p&gt;Consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;section {
    article {
        div {
            margin-top: 1rem;
            color: '#f2545b';
            img {
                border-radius: 3px;
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There are a number of issues with this. Due to the nested structure altering my DOM will break my design. Having these nested elements create a tight coupling between my styles and my DOM structure. A change in one will likely require a change in the other.&lt;/p&gt;

&lt;p&gt;Overuse of this pattern leads to difficulty in debugging. Looking at markup without classes makes finding the applicable CSS difficult. It also requires a developer deal with specificity issues. In the future, if I refactor this CSS to be part of a reusable component, there can be an unintended consequence for child element in the DOM  tree that match these elements.&lt;/p&gt;

&lt;p&gt;Of course, the above example is somewhat contrived. Even type selectors nested a single level deep can have an unintended consequence for future markup.&lt;/p&gt;

&lt;h2&gt;
  
  
  In summary, avoid overuse of type selectors:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Styles are bound to specific element types&lt;/li&gt;
&lt;li&gt;It can lead to breaking semantic markup in order to achieve a specific design e.g. &lt;code&gt;&amp;lt;h3&amp;gt; &amp;lt;h2&amp;gt;&lt;/code&gt; in the wrong order&lt;/li&gt;
&lt;li&gt;Changing the DOM structure can break a design&lt;/li&gt;
&lt;li&gt;Refactoring is needed when new element types are added&lt;/li&gt;
&lt;li&gt;Debugging can be more difficult&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  So what’s the solution
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Lean into class names. Be intentional with your styling. There are many tools that can help you avoid names clashes in CSS such as CSS Modules, BEM, styled-components etc, &lt;/li&gt;
&lt;li&gt;Use type selectors for their intended purpose, for applying styles globally to keep a consistent look and feel.&lt;/li&gt;
&lt;li&gt;HTML tags are for used to semantically structure your page. A &lt;code&gt;h1&lt;/code&gt; should indicate the purpose of your page.  A &lt;code&gt;p&lt;/code&gt; should contain some long-form text. You should apply the styles using classes.&lt;/li&gt;
&lt;li&gt;Create classes to reuse styles. Have a &lt;code&gt;.blog__header&lt;/code&gt; , &lt;code&gt;hero-title&lt;/code&gt;, &lt;code&gt;big-image&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Are there cons?
&lt;/h2&gt;

&lt;p&gt;Of course, as with anything, there are potential drawbacks. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using BEM notation you may find yourself using a number of long class names: &lt;code&gt;.news__article--main&lt;/code&gt;, .&lt;code&gt;news__cta--primary&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You are now required to add a class to your new elements &lt;code&gt;&amp;lt;img class=“featured-image /&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that being said I think the improved readability, ease of debugging and more robust nature of class selectors outweigh these drawbacks.&lt;/p&gt;

&lt;p&gt;You may argue that having to add a class to all your elements is a drawback. In my experience when there are multiple elements with the same class, this is often done programmatically or via a CMS. If you have a list of elements that you need to continually add to manually, that is a separate issue that likely should be automated in some way.&lt;/p&gt;

&lt;h2&gt;
  
  
  An Afterword
&lt;/h2&gt;

&lt;p&gt;I believe much of the above also applies to the overuse if &lt;code&gt;*&lt;/code&gt; &lt;code&gt;&amp;gt;&lt;/code&gt; &lt;code&gt;+&lt;/code&gt; selectors. Of course, these have their place, but should not be relied upon when a simple class would do the job. Using a variety of selectors in your code makes developers reading your code have to constantly compute what these selectors are doing. Often the best solution is the simplest one. &lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
