<?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: Will Honey</title>
    <description>The latest articles on DEV Community by Will Honey (@tibfib).</description>
    <link>https://dev.to/tibfib</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%2F3639%2Fb2Kz66uG.jpg</url>
      <title>DEV Community: Will Honey</title>
      <link>https://dev.to/tibfib</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tibfib"/>
    <language>en</language>
    <item>
      <title>Why Prettier</title>
      <dc:creator>Will Honey</dc:creator>
      <pubDate>Fri, 15 Feb 2019 03:10:29 +0000</pubDate>
      <link>https://dev.to/tibfib/why-prettier-18mj</link>
      <guid>https://dev.to/tibfib/why-prettier-18mj</guid>
      <description>&lt;p&gt;At my previous job, I was the lead frontend developer at a small startup. I was also the only frontend developer. As such, I could do basically whatever I wanted. I heard about Prettier through twitter and decided to try it. I immediately loved it and added it as a &lt;a href="https://prettier.io/docs/en/precommit.html"&gt;pre-commit hook&lt;/a&gt;. I stopped caring about formatting my code. I just typed it out, pressed save, and like magic, prettier would make it look &lt;em&gt;good enough&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Eventually I left that job to try out a bigger team at a bigger company. I was hired on as a senior frontend developer–with two others already on the team. I immediately suggested adopting prettier to my coworkers and was met with a lot of resistance. The complaints:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I just don't like the way it looks. &lt;/li&gt;
&lt;li&gt;It uses way too much vertical space. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I disagreed with both of those complaints, but wanting to be a good new coworker, I eventually lessened the pressure; only bringing it up in side comments ("Yeah, I really like how &lt;a href="https://marketplace.visualstudio.com/items?itemName=rbbit.typescript-hero"&gt;typescript hero&lt;/a&gt; takes care of the imports and sorting for me. That's one thing I really like about Prettier too–how it automates a lot of stuff I don't need to do manually"). &lt;/p&gt;

&lt;p&gt;As I became more familiar with the codebase I started creating more and more pull requests for the tasks in our JIRA board (don't get me started there). I was a little nervous to see how my code would be received–after all I had mostly worked as a solo frontend dev for the majority of my career. I was crestfallen to see that my first few PRs were filled with comments and "needs work" stamps. It made me feel really bad. Like, am I not a good programmer? &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;95% of the comments were about formatting issues.&lt;/strong&gt; "We put an extra line here." "We prefer to put a comma here." "We do it this way." My first few pull requests, when I needed the most validation, were ripped to shreds because we didn't use Prettier.&lt;/p&gt;

&lt;p&gt;As &lt;a href="https://twitter.com/dan_abramov/status/1086216675828137984"&gt;Dan Abramov&lt;/a&gt; tweeted, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We need something to obsess about. We learn mechanical rules and to feel good about following them. Much easier than fixing bugs! We impose them on new team members — here’s how WE do things, you forgot a SPACE here and  SEMICOLON.&lt;/p&gt;

&lt;p&gt;This is madness. Break the cycle. Use Prettier.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Gradually I learned their coding styles and the style comments lessened. Now, five months after I started, the team has agreed to use Prettier. It just kind of... happened. I brought it up in earnest this week and I think my coworkers were more open to it after I had been working with them for a while. The frontend team lead decided to do some investigation and in the end was willing to give it a try.&lt;/p&gt;

&lt;p&gt;We spent much of the day arguing about the Prettier settings (initially they wanted  180 character columns!) but eventually came to a consensus. We all have Prettier in our respective editors with our &lt;code&gt;.prettierrc&lt;/code&gt; in the repo. I have a good feeling this'll be one of the last times we argue about code style.&lt;/p&gt;

</description>
      <category>prettier</category>
      <category>javascript</category>
      <category>eslint</category>
      <category>formatting</category>
    </item>
  </channel>
</rss>
