<?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: Mike</title>
    <description>The latest articles on DEV Community by Mike (@mikerenoe).</description>
    <link>https://dev.to/mikerenoe</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F548869%2F1a906f9e-7d39-425a-9ed8-63f5a8389155.jpg</url>
      <title>DEV Community: Mike</title>
      <link>https://dev.to/mikerenoe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mikerenoe"/>
    <language>en</language>
    <item>
      <title>Family Leave</title>
      <dc:creator>Mike</dc:creator>
      <pubDate>Tue, 07 Jul 2026 23:37:52 +0000</pubDate>
      <link>https://dev.to/mikerenoe/family-leave-5e0d</link>
      <guid>https://dev.to/mikerenoe/family-leave-5e0d</guid>
      <description>&lt;h3&gt;
  
  
  Two New Additions
&lt;/h3&gt;

&lt;p&gt;On 4/24/2026 my wife and I welcomed our twins, Clyde and Clara, and the day before that I started my paternity leave. Outside generously provides twelve weeks of paid leave, and during it there’s nothing I’d rather be doing than spending time with my family. Building bonds and routines, and watching my two children’s personalities begin to show, has been incredible.&lt;/p&gt;

&lt;p&gt;The reality of a leave this long means that the return date looms close by and the tectonic shifts since taking off are a concern that clouds each week.&lt;/p&gt;

&lt;p&gt;Extended time off means that while I was able to prepare a Q2 plan and the beginnings of a Q3 plan, I wouldn’t be there to see through Q2 or adapt Q3 to the reality of what we achieved in Q2. The scope of my role will likely be forever changed as colleagues forge new processes and relationships. I’ve been there since 2021 and risen up through multiple promotions. I look forward to talking to my coworkers as ever, but I know I’ll feel less ’needed’ and that will sting at first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Missing out
&lt;/h3&gt;

&lt;p&gt;Part of stepping away is the quiet fear of falling behind. The industry moves fast. The obvious thing I’ve missed out on is three months of development around LLM usage at work. Day to day, I think the momentum is still going in the same direction. LLM and agentic development has proven itself for developers. However, I’ve been anticipating more interest in lower-cost tooling and per-token models that keep their interfaces low-friction, especially since organizations were just hit with the reality of &lt;a href="https://www.latimes.com/business/story/2026-06-02/uber-caps-staff-use-of-ai-coding-tools-after-blowing-its-budget" rel="noopener noreferrer"&gt;token-based enterprise costs&lt;/a&gt; and the newly discovered possibility of &lt;a href="https://www.anthropic.com/news/redeploying-fable-5" rel="noopener noreferrer"&gt;government restrictions on frontier models&lt;/a&gt;. Despite this, I don’t see most of those engineers ever going back to ‘hand-coding’.&lt;/p&gt;

&lt;p&gt;In my experience, these three months are also where the year really begins. Ideas get in motion and start to blossom further. This aligns with our users’ patterns too. In the cadence of the year at Outside, the summer is one of the peak seasons. People are going outside, reading to be inspired, researching trail conditions, and tracking their routes to look back and reminisce. Projects are being ideated for the next few quarters, and while a strategy was laid out before my leave, the expectation is that reality led to pivots - ones I’ll only learn about once I return.&lt;/p&gt;

&lt;p&gt;It’s a cliché that trust while delegating is one of the most challenging parts &lt;em&gt;of&lt;/em&gt; delegation, but it consistently remains true. You surround yourself with an excellent team you trust, you agree upon a plan, and yet &lt;em&gt;execution&lt;/em&gt; is still a skill folks ascribe to successful companies for a reason. It doesn’t come for free.&lt;/p&gt;

&lt;h3&gt;
  
  
  What to return to
&lt;/h3&gt;

&lt;p&gt;When you’re hired to a role, the hiring manager has an idea of the problems you’re there to solve and the team you’re there to manage. I took a twelve-week leave doing that job along with the role creep that comes with promotions along the way. As tends to be the case, I was doing the work required of me by the job description, plus the work I thought I was uniquely capable of executing on.&lt;/p&gt;

&lt;p&gt;For instance, I historically took it upon myself to get the most out of developer tooling, since it’s complementary to DevOps, and to focus on operational efficiencies like bringing many teams (and many more brands) onto shared services such as payments and identity - which is critical to maintaining a platform (vs a series of businesses under one roof). Those initiatives were delegated while I was away - either to engineers on my team or to IT - and the business hasn’t come crashing down as a result.&lt;/p&gt;

&lt;p&gt;Aside: isn’t that always the case? You feel crucial until you’re gone, and then you realize people move on. You’ve probably done a better job of ‘working yourself out of a job’ than you give yourself credit for - which means you should probably scale up to bigger and better problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to design it
&lt;/h3&gt;

&lt;p&gt;So to wrap this up, what are my next steps?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Determine what I must do. &lt;em&gt;What’s my job description?&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Determine what I want to do. &lt;em&gt;What fills my cup each day to allow me to keep doing the hard things?&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Determine what I will stop doing. &lt;em&gt;This was delegated but doesn’t go away. Someone is waiting to hand this back off to me.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Leave handed me a rare reset. I’m excited to come back thoughtfully.&lt;/p&gt;

</description>
      <category>management</category>
      <category>leave</category>
      <category>jobdescriptions</category>
    </item>
    <item>
      <title>Bringing the blog home</title>
      <dc:creator>Mike</dc:creator>
      <pubDate>Fri, 05 Jun 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/mikerenoe/bringing-the-blog-home-33ik</link>
      <guid>https://dev.to/mikerenoe/bringing-the-blog-home-33ik</guid>
      <description>&lt;p&gt;For years my writing lived on Medium. It’s a fine place to read, but the work — and the SEO that comes with it — belonged to someone else’s domain. So I’ve brought the blog home.&lt;/p&gt;

&lt;p&gt;From now on, posts are written in Markdown and published here first, at &lt;strong&gt;mikerenoe.com/blog&lt;/strong&gt;. Everything is generated by &lt;a href="https://gohugo.io" rel="noopener noreferrer"&gt;Hugo&lt;/a&gt; and deployed alongside the rest of the site on Vercel, so the blog shares the same look and feel you’re seeing right now.&lt;/p&gt;

&lt;p&gt;There’s an &lt;a href="https://mikerenoe.com/feed.xml" rel="noopener noreferrer"&gt;RSS feed&lt;/a&gt; too. When I cross-post to Medium or dev.to, those copies point their canonical URL back here — so this page stays the original, and the search-engine credit stays with the site.&lt;/p&gt;

&lt;p&gt;More soon.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>navelgazing</category>
    </item>
    <item>
      <title>What’s in my Inbox?</title>
      <dc:creator>Mike</dc:creator>
      <pubDate>Wed, 05 Jun 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/mikerenoe/whats-in-my-inbox-ge0</link>
      <guid>https://dev.to/mikerenoe/whats-in-my-inbox-ge0</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: I originally wrote this post in 2019. Some of the newsletters below have since gone quiet or shut down, so treat this as a snapshot of what I was reading at the time rather than a current list.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvhu4cclu1u5gsqeokm9a.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvhu4cclu1u5gsqeokm9a.jpeg" width="800" height="534"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://burst.shopify.com/@thenomadbrodie?utm_campaign=photo_credit&amp;amp;utm_content=Free+Hand+Full+Of+Roasted+Coffee+Photo+%E2%80%94+High+Res+Pictures&amp;amp;utm_medium=referral&amp;amp;utm_source=credit" rel="noopener noreferrer"&gt;Brodie Vissers&lt;/a&gt; from &lt;a href="https://burst.shopify.com/fall?utm_campaign=photo_credit&amp;amp;utm_content=Free+Hand+Full+Of+Roasted+Coffee+Photo+%E2%80%94+High+Res+Pictures&amp;amp;utm_medium=referral&amp;amp;utm_source=credit" rel="noopener noreferrer"&gt;Burst&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Email newsletters have been a relatively recent addition to my morning routines but they’re something I value as highly as my favorite podcasts in some cases. Newsletters and especially newsletters via email are by no means new but I think services like &lt;a href="https://theskimm.com/" rel="noopener noreferrer"&gt;The Skimm&lt;/a&gt; have certainly popularized the brief curated medium. We’re surrounded by an abundance of information each and every day, selected a source who’s dedicated to bringing you a slice of news from a segment of your interest has greatly improved the quality of my media diet.&lt;/p&gt;

&lt;p&gt;I’m making this list in the hope that someone will find in valuable, a lot of these newsletters I found via word of mouth or following the curator. Substack offers some lists of newsletters but there’s not a suggestion platform yet for newsletters like podcasts or books. These curators put their time and energy into these emails and rely on word of mouth. I’m gaining nothing by sharing these (except for referral credits from Finimize at the bottom) aside from the hope that the creator continues maintaining them well into the future. This is my thanks to them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reply All Newsletter
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qkmtl565wt90rpnpf3h.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qkmtl565wt90rpnpf3h.jpg" width="800" height="800"&gt;&lt;/a&gt;&lt;em&gt;&lt;a href="https://gimletmedia.com/shows/reply-all" rel="noopener noreferrer"&gt;https://gimletmedia.com/shows/reply-all&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; Recommendations from around the &lt;a href="https://gimletmedia.com/" rel="noopener noreferrer"&gt;Gimlet Media&lt;/a&gt; office.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; The Gimlet staff has great taste on the whole and if you’re a fan of the podcast you’ll like this. From it I’ve started listening to Clairo, watched a LOT of weird YouTube videos, and even received new recipes!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://mailchi.mp/5d8515fdcbc6/new-episode-136-the-founder-930569?e=6975c8691a" rel="noopener noreferrer"&gt;Read here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://gimletmedia.com/shows/reply-all" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  A Woman to Know
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpd40ywxukljpdp6117j0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpd40ywxukljpdp6117j0.jpg" width="424" height="359"&gt;&lt;/a&gt;&lt;em&gt;(image via &lt;a href="https://commons.wikimedia.org/wiki/File:Dorothy_Arzner_in_The_Bride_Wore_Red_trailer.jpg" rel="noopener noreferrer"&gt;Wikimedia&lt;/a&gt;*)&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How often?&lt;/strong&gt; Every weekday&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; A quick summary of a notable woman in history, her accomplishments, and lots of links for further reading.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; Lots of women through history didn’t achieve the publicity level of the men surrounding them for many reasons. This newsletter serves to supplement our knowledge of historical figures and improve the visibility of women and their achievements over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://tinyletter.com/awomantoknow/letters/a-woman-to-know-dorothy-arzner-1" rel="noopener noreferrer"&gt;Read here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://tinyletter.com/awomantoknow" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s the Difference Between…
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9374pu4likwp2cba5yz4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9374pu4likwp2cba5yz4.jpeg" width="184" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; Brette Warshaw clearly and succinctly explaining the difference between terms that might seem similar or are similar but are actually different. Described by Brette herself as: “A newsletter for the curious &amp;amp; confused.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; I love etymology and word history. Often the newsletters break down the history of a term and how subcategories develop from that original topic. I’m mostly thinking about this issue, &lt;a href="https://tinyletter.com/whatsthedifference/letters/what-s-the-difference-between-61" rel="noopener noreferrer"&gt;CRUDO, SASHIMI, TARTARE, AND CARPACCIO?&lt;/a&gt; but they’re all great and along that same line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://tinyletter.com/whatsthedifference/letters/what-s-the-difference-between-62" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://tinyletter.com/whatsthedifference" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Perf.email
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How Often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; Curated list of links and blurbs by &lt;a href="https://calibreapp.com/" rel="noopener noreferrer"&gt;Calibre&lt;/a&gt; related to web performance and accessibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; Web Accesibility means creating websites and web apps that can be easily and clearly accessed by everyone. &lt;a href="https://us2.campaign-archive.com/?u=9067434ef642e9c92aa7453d2&amp;amp;id=d6a8899618" rel="noopener noreferrer"&gt;Issue 23&lt;/a&gt; in particular featured &lt;a href="https://parametric.press/issue-01/unraveling-the-jpeg/" rel="noopener noreferrer"&gt;this blog&lt;/a&gt; discussing how JPEGs are displayed, encoded and broken down as well as a talk by Tatiana Mac on how &lt;a href="https://www.youtube.com/watch?v=nQq_gZiZ-jg" rel="noopener noreferrer"&gt;Privilege Defines Performance.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://mailchi.mp/perf.email/24" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://perf.email/" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Now I Know
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi8tun51rp2aalxt96uj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi8tun51rp2aalxt96uj6.png" width="800" height="179"&gt;&lt;/a&gt;&lt;em&gt;&lt;a href="http://nowiknow.com/" rel="noopener noreferrer"&gt;http://nowiknow.com/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Often?&lt;/strong&gt; Every Weekday&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; Stories, trivia, and lesser known facts from around the world. Every Friday also features a ‘Weekender’ with long-reads and puzzles to hold readers curiosity til the coming Monday.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; Dan’s stories are exactly the kind of trivia I love to read that tends to stick with me throughout the day. Last issue in particular featured a story about a soccer goalie who was so dedicated that when the game was called on account of fog and poor visibility, he remained on the pitch until the police came to find him after the team had showered and packed up. He just thought his team was holding the other to their own goal!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="http://nowiknow.com/the-goalie-who-wouldnt-stop/" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="http://nowiknow.com/" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  A11y Weekly
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz4xo1mtn0hh9ky7i0bq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz4xo1mtn0hh9ky7i0bq9.png" width="722" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; Curated list of links to blogs, articles and tutorials related to web accessibility, web design and building a more inclusive web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; I subscribe to two newsletters on Web Accessibility because it is a relatively new topic for me to delve deeply into. It’s always been a concern but I wasn’t aware how much more I could be doing until I started seeking out resources like this. This curated list is getting me up to speed with accessibility with tons of tutorials and well written blog posts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://us11.campaign-archive.com/?u=884d5f16016183c67252bd18c&amp;amp;id=965a9ce960" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://a11yweekly.com/" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Monday Medley&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How Often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; A collection of thoughts and links from Nat Eliason from the previous week.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; Nat is a great resource for information on growth, marketing, and growing a small business. Nat’s marketing know how was my original reason for subscribing. Digital marketing was something I was learning on the job but wanted to start getting a leg up.&lt;/p&gt;

&lt;p&gt;Since that original impetus, it’s moved into just seeing what someone else finds on the web in a given week. There’s often a topic or two I would disagree on if we met in person and with his accompanying viewpoint on a link I’ve been able to hear an opinion I might not have heard in my day-to-day communications. I always walk away thinking about something that wasn’t on my mind previously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://us9.campaign-archive.com/?u=d87b9456b8a59ad2b8292e6bc&amp;amp;id=a3abf081d9" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://www.nateliason.com/join" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Rendezvous with Cassidoo
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How Often?&lt;/strong&gt;  Weekly&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s in it?&lt;/strong&gt; A weekly roundup of links relating to the web, a few words, a joke and a quick programming challenge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I love it:&lt;/strong&gt; Front end web design is constantly moving, changing and growing more opinionated, this newsletter focuses the fire-hose of information into a steady stream. Additionally, front end web &lt;em&gt;design&lt;/em&gt; is another blind spot for me, I’ve always been more comfortable with back end engineering at the expense of digging into the front end. Newsletters like this one pull back the curtain for me to jump into CSS, JS and the design process.&lt;/p&gt;

&lt;p&gt;I also really enjoy the ‘interview question of the week’, when I have the time available I always try to solve it as a fun puzzle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Last Issue:&lt;/strong&gt; &lt;a href="https://tinyletter.com/cassidoo/letters/if-you-are-not-criticized-you-may-not-be-doing-much-d-h-rumsfeld" rel="noopener noreferrer"&gt;Read Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscribe:&lt;/strong&gt; &lt;a href="https://tinyletter.com/cassidoo" rel="noopener noreferrer"&gt;Here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s a few others listed below that I don’t read as often but might be interesting to readers here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/" rel="noopener noreferrer"&gt;Mozilla’s Developer Newsletter&lt;/a&gt; — Quick set of links and blurbs about where the web is going.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://99percentinvisible.org/" rel="noopener noreferrer"&gt;99% Invisible Newsletter&lt;/a&gt; — From the team that brings you your favorite podcast. Accompanying articles for new episodes as well as stories too small for podcasts.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.thegoodnewsemail.com/" rel="noopener noreferrer"&gt;The Good News Email&lt;/a&gt; — The best positive news to your inbox, once a week because sometimes we focus too much on the worst.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.brainpickings.org/" rel="noopener noreferrer"&gt;Brain Pickings&lt;/a&gt; — One of the original ones that I’m aware of. Carefully and artfully curated selection of the best works of fiction, art, or anything that can lead to a more beautiful life.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://finimize.com/invite?kid=QSVT1" rel="noopener noreferrer"&gt;Finimize&lt;/a&gt; — Daily and weekly roundup of business, financial, and money news.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>email</category>
      <category>newsletters</category>
    </item>
    <item>
      <title>Learning Go by writing a TCP Server</title>
      <dc:creator>Mike</dc:creator>
      <pubDate>Tue, 30 Apr 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/mikerenoe/learning-go-by-writing-a-tcp-server-15d4</link>
      <guid>https://dev.to/mikerenoe/learning-go-by-writing-a-tcp-server-15d4</guid>
      <description>&lt;p&gt;&lt;a href="https://www.takeoutcentral.com" rel="noopener noreferrer"&gt;Takeout Central&lt;/a&gt; had a problem. We were running a TCP Server and a UDP Server. Both were written in Perl. Neither was taking advantage of concurrency. At the same time, our team of Delivery Heroes became frustrated while beta testing an IoT device in the field. Information sent to the ten beta test devices took an hour or more to update, which we found to be an unacceptable amount of time.&lt;/p&gt;

&lt;p&gt;Enter Go. I’d used Go in the past. It was my language of choice for &lt;a href="https://adventofcode.com/" rel="noopener noreferrer"&gt;Advent Of Code&lt;/a&gt; 2017. As I kept up with the five days of challenges, I found that writing in Go was a breeze. After that, I kept an eye out for a problem that called for a robust systems language. Here was the opening.&lt;/p&gt;

&lt;p&gt;Go uses concurrency rather than parallelism. While the differences between concurrency and parallelism are slight to most, co-designer of the Go programming language Rob Pike explains it like this: “Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once.”&lt;a href="https://blog.golang.org/concurrency-is-not-parallelism" rel="noopener noreferrer"&gt;*&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, I wanted to know how concurrency functioned in Go. It was so straightforward that even beginner &lt;a href="https://tour.golang.org/concurrency/1" rel="noopener noreferrer"&gt;tutorials&lt;/a&gt; discussed it relatively early. Next, I needed to know how to implement concurrency in a server environment. After a few more minutes of googling, I found the scaffold for the TCP server. I learned how Go handles socket communications on this &lt;a href="https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go" rel="noopener noreferrer"&gt;blog&lt;/a&gt;, which also explains how these can all be leveraged using goroutines. The go keyword before handleRequest does all of the work for concurrency, because each function called with a preceding go starts a new concurrent process. Getting the server off the ground was easy, because all it entailed was prefacing a function call with “go”.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;//Taken from https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go&lt;/span&gt;
&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
 &lt;span class="s"&gt;"fmt"&lt;/span&gt;
 &lt;span class="s"&gt;"net"&lt;/span&gt;
 &lt;span class="s"&gt;"os"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
 &lt;span class="n"&gt;CONN_HOST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"localhost"&lt;/span&gt;
 &lt;span class="n"&gt;CONN_PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"3333"&lt;/span&gt;
 &lt;span class="n"&gt;CONN_TYPE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"tcp"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;// Listen for incoming connections.&lt;/span&gt;
 &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CONN_TYPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CONN_HOST&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;":"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;CONN_PORT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Error listening:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
 &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="c"&gt;// Close the listener when the application closes.&lt;/span&gt;
 &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
 &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Listening on "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;CONN_HOST&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;":"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;CONN_PORT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;// Listen for an incoming connection.&lt;/span&gt;
 &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Error accepting: "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
 &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="c"&gt;// Handle connections in a new goroutine.&lt;/span&gt;
 &lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conn&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="c"&gt;// Handles incoming requests.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Conn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;// Make a buffer to hold incoming data.&lt;/span&gt;
 &lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="c"&gt;// Read the incoming connection into the buffer.&lt;/span&gt;
 &lt;span class="n"&gt;reqLen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Error reading:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="c"&gt;// Send a response back to person contacting us.&lt;/span&gt;
 &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Write&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Message received."&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
 &lt;span class="c"&gt;// Close the connection when you're done with it.&lt;/span&gt;
 &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Close&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’d become comfortable with concurrency and goroutines, so I turned my attention back to the problem at Takeout Central. To replace the old system that was slowing us down without losing any functionality, we needed the new TCP server to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Concurrently handle each Device-to-Server TCP connection using goroutines&lt;/li&gt;
&lt;li&gt;Respond to &lt;em&gt;valid&lt;/em&gt; requests with a JSON packet&lt;/li&gt;
&lt;li&gt;Log requests, failures, updated states&lt;/li&gt;
&lt;li&gt;Update a MySQL database accordingly&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  JSON
&lt;/h3&gt;

&lt;p&gt;Because our devices sent requests and expected responses in JSON, it was my next topic of interest. The &lt;a href="https://golang.org/pkg/encoding/json/" rel="noopener noreferrer"&gt;json&lt;/a&gt; package &lt;a href="https://golang.org/pkg/encoding/json/#Marshal" rel="noopener noreferrer"&gt;Marshal&lt;/a&gt; function does the work producing the JSON string and it’s documentation lays out the possible inputs.&lt;/p&gt;

&lt;p&gt;I chose to use an exported struct. It offered clearly-defined messages, meaning the struct was also self-documenting. I prefer to use explicit key names whenever possible, which is why I also utilized the ‘json’ tag in cases where a device’s expected key did not conform to Go’s style.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;errorMessage&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Error&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="s"&gt;`json:"error"`&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This struct is populated using the explicit assignment seen below where the variable message is a string containing a user defined error message. The resulting struct is Marshaled into a byte slice to be returned by our connection handler.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;ourErrorMessage&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;errorMessage&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;errorMessageAsJSON&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Marshal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newMsg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;On the flip side, requests need to be validated by the &lt;a href="https://golang.org/pkg/encoding/json/#Unmarshal" rel="noopener noreferrer"&gt;Unmarshal&lt;/a&gt; function. Given the errorMessage struct above we can put together the pieces to get an error message from the client using the code below. If invalid JSON is passed, the Unmarshal function will pass an error for our server to log. This validates that messages are at least using valid JSON.&lt;/p&gt;

&lt;p&gt;The standard Unmarshal function omits fields that don’t exist in your struct definition by default. Here at Takeout Central on this project specifically we’re working with standard messages with very little variance between them. If that’s not the case for your application, you might want to look into handling unexpected messages using a different interface than a struct.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;//given a JSON String&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;errorRequest&lt;/span&gt; &lt;span class="n"&gt;errorMessage&lt;/span&gt; 
&lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;"{&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;Unknown Error Occurred&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s"&gt;}"&lt;/span&gt;
&lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unmarshal&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;errorRequest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="c"&gt;//handle error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;errorMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;errorRequest&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Error&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Logging
&lt;/h3&gt;

&lt;p&gt;For logging, Go provides the &lt;a href="https://golang.org/pkg/log/" rel="noopener noreferrer"&gt;log&lt;/a&gt; package. We start here by initializing a pointer to &lt;a href="https://golang.org/pkg/log/#Logger" rel="noopener noreferrer"&gt;Logger&lt;/a&gt; in main using &lt;a href="https://golang.org/pkg/log/#New" rel="noopener noreferrer"&gt;Log.new&lt;/a&gt;. Using this pointer and dependency injection we pass this along to the handleConnection function and furthermore into our subsequent log helper functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OpenFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/your/log/file"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_RDWR&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_CREATE&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;O_APPEND&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0666&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fatalf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"error opening file: %v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;""&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the formatting I prefer something along the lines of 2019–04–25 21:26:17 [error], and so our log functions look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;logError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SetPrefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"2006-01-02 15:04:05"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" [error] "&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&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;It’s important to note here that when using dependency injection on concurrent functions the objects you’re passing need to be thread-safe. This is necessary to avoid race conditions as well as ensuring one of the many concurrent processes don’t fail because it’s attempting to modify our log file while it’s in use. Luckily for us, the documentation for &lt;a href="https://golang.org/pkg/log/#Logger" rel="noopener noreferrer"&gt;Logger&lt;/a&gt; spells that out explicitly.&lt;/p&gt;

&lt;p&gt;If one thing has come through thus far, I hope it’s how straightforward and ‘batteries-included’ Go is for these tasks in particular. Up until now and in fact, excluding the MySQL drivers I’m about to delve into, everything in our server is powered by the Go packages from the core team.&lt;/p&gt;

&lt;h3&gt;
  
  
  MySQL
&lt;/h3&gt;

&lt;p&gt;Go doesn’t implement each database in their own core libraries, it’s been left as a challenge to the users or the &lt;a href="https://en.wiktionary.org/wiki/exercise_for_the_reader" rel="noopener noreferrer"&gt;reader&lt;/a&gt;. They do provide the &lt;a href="https://golang.org/pkg/database/sql/" rel="noopener noreferrer"&gt;sql&lt;/a&gt; package as an interface and a comprehensive list of &lt;a href="https://github.com/golang/go/wiki/SQLDrivers" rel="noopener noreferrer"&gt;drivers&lt;/a&gt; for your ease. I went with &lt;a href="https://github.com/go-sql-driver/mysql/" rel="noopener noreferrer"&gt;go-sql-driver&lt;/a&gt; as it best fit my projects needs.&lt;/p&gt;

&lt;p&gt;go-sql-driver and Go sql follow standard patterns if you’ve worked with MySQL before. Starting with a pointer to the DB(database) object we use it like Logger before as this is also designed to be &lt;a href="https://golang.org/pkg/database/sql/#DB" rel="noopener noreferrer"&gt;threadsafe&lt;/a&gt; as you might expect.&lt;/p&gt;

&lt;p&gt;For our use-case, we’re monitoring and updating devices one at a time. This means there’s very few cases where we have to fetch more than one row from the database, meaning our requests and data grabs tend to look like the code below. Like log our database pointer is initialized in main and passed to each handleConnection goroutine.&lt;/p&gt;

&lt;p&gt;The variables you see that aren’t initialized in view: dbh, our database pointer; log, pointer to our log object; errors which is a &lt;a href="https://golang.org/pkg/errors/" rel="noopener noreferrer"&gt;package&lt;/a&gt; Go provides to handle passing errors between functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;baz&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;dbh&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;QueryRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SELECT foo, baz FROM devices WHERE id=? LIMIT 1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
 &lt;span class="n"&gt;Scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;baz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="n"&gt;logError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"No devices with ID: "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"No devices with ID:"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ICCID&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;
  
  
  Wrapping it all together
&lt;/h3&gt;

&lt;p&gt;This was one of the most enjoyable projects I’ve worked on recently and I owe it largely to Go’s internal packages and tools. In particular, goroutines as a thread abstraction. Having worked with threads manually in the past I fully appreciate just how much heavy lifting they do. The simple ‘go’ keyword provided a smooth abstraction that is less prone to error and automatically efficiently schedules threads. If you’re implementing this yourself, please keep in mind other aspects of a production server like malicious attackers and prepare accordingly. With that in mind though, this is a great TCP server app for a few IoT devices connecting to a central server; I hope it serves you well.&lt;/p&gt;




</description>
      <category>go</category>
      <category>tcp</category>
      <category>perl</category>
    </item>
    <item>
      <title>The Problem With Bike Registration</title>
      <dc:creator>Mike</dc:creator>
      <pubDate>Sat, 02 Mar 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/mikerenoe/the-problem-with-bike-registration-5a2h</link>
      <guid>https://dev.to/mikerenoe/the-problem-with-bike-registration-5a2h</guid>
      <description>&lt;p&gt;&lt;em&gt;This blog is an expanded version of a letter that I sent to my NC State Rep Verla Insko&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This week the NC State Representative from Wilkes County, &lt;a href="https://www.ncleg.gov/Members/Biography/H/643" rel="noopener noreferrer"&gt;Jeffery Elmore&lt;/a&gt;, proposed &lt;a href="https://www.ncleg.gov/BillLookUp/2019/H157" rel="noopener noreferrer"&gt;H157&lt;/a&gt;, a bike registration bill. If passed, cyclists riding on any NC state road will be required to pay $10/year for a registration card and plate for their bicycle and failure to do so can result in a fine up to $25. As a bike lover and cyclist, I’m vehemently opposed to this bill. In its current state, it discourages recreational cycling statewide and places a heavy burden on the lowest income populations.&lt;/p&gt;

&lt;p&gt;Cycling means a lot to me. I learned the roads of my community on a bike, earned my first paycheck delivering papers by bike, and made friends who also rode bikes. It was my only means of transport through college; I didn’t buy a car until graduation week. Biking was how I got groceries, visited friends, and eventually how I rode across the country advocating for affordable housing with &lt;a href="https://bikeandbuild.org" rel="noopener noreferrer"&gt;Bike &amp;amp; Build&lt;/a&gt;. For some, like myself, it’s a path to self-actualization and autonomy but for others, it’s how they stay active and healthy.&lt;/p&gt;

&lt;p&gt;You might be reading this and thinking $10/year is a small cost, who cares? I completely understand. For us, this is a new hoop to jump through, an added barrier between the occasional bike commute or workout. This could become a subconscious justification for not riding today. It’s telling yourself you’ll bike to work &lt;em&gt;tomorrow&lt;/em&gt; or it’s the reason you can’t ride bikes with your kids today. However, if you do choose to ride your bike despite the known consequence, you’re now at risk of paying 2.5 times the original price on top of the future registration. Does $35 sound right for a stroll down the road? Consider now the people for whom $10, $25, and $35 is everything. It’s all that’s leftover after a paycheck or all that they can save after a couple of weeks. For every person who’s making the choice to ride their bike rather than a car or for the fun of it, there are those who have no other option.&lt;/p&gt;

&lt;p&gt;Outside of major metropolitan areas even simple tasks like grocery shopping are substantially more difficult and time consuming on public transit or walking. For those folks who don’t own a car and are healthy enough to ride one, a bike is the only realistic option for commuting and errands. The ubiquity of bikes makes them accessible to most people regardless of their socioeconomic status. Whether from thrift stores, non-profits, or even a friend with a beat up bike, a bike is a sturdy machine designed for heavy use. These are the cyclists, however, who will be most harmed by the otherwise low-cost registration as well as the punitive fine. This fine is comparable to overdraft fees as it targets similar socioeconomic statuses and has a similar charge. As such, Americans, in total, paid $34 Billion in 2017 (&lt;a href="https://www.marketwatch.com/story/overdraft-fees-havent-been-this-bad-since-the-great-recession-2018-03-27" rel="noopener noreferrer"&gt;https://www.marketwatch.com/story/overdraft-fees-havent-been-this-bad-since-the-great-recession-2018-03-27&lt;/a&gt;) with &lt;strong&gt;only&lt;/strong&gt; an average of $20 for each fee. Even that is less than the exorbitant fine for not having a registration plate on your bike. Imagine how this could add up over a year for a person.&lt;/p&gt;

&lt;p&gt;Offenders will rarely just pay the $25. The $25 fine is currently listed as an infraction in the bill, this means it comes with additional court fees to pay on top of the previous amount. (&lt;a href="https://www.nccourts.gov/help-topics/fees-and-payments/court-costs#criminal-and-infraction-costs-including-traffic-tickets-5430" rel="noopener noreferrer"&gt;https://www.nccourts.gov/help-topics/fees-and-payments/court-costs#criminal-and-infraction-costs-including-traffic-tickets-5430&lt;/a&gt;) These additional costs add up over time and don’t include the career cost of attending court during the workweek. Riding your bike to work or to get groceries will carry with it the impending threat of swiping a debit card with a precariously low balance. These folks don’t need another bill or threat of debt over their head while they ride to work.&lt;/p&gt;

&lt;p&gt;Bike registration isn’t a new idea. Since I started riding on the road, I’ve encountered drivers who feel like I don’t belong because I’m not buying into the care of it. This claim has been debunked and addressed many times over. (&lt;a href="https://www.bicycling.com/training/a20042771/the-best-responses-to-anti-cyclist-claims/" rel="noopener noreferrer"&gt;https://www.bicycling.com/training/a20042771/the-best-responses-to-anti-cyclist-claims/&lt;/a&gt;) My arguments here aren’t comprehensive of all the reasons why bike registration is the wrong move but it’s impact on people is the most important to me. Don’t keep me from riding my bike a couple of times a week and don’t place another barrier between those without a car and getting to work on time.&lt;/p&gt;

</description>
      <category>bikes</category>
      <category>law</category>
      <category>northcarolina</category>
    </item>
  </channel>
</rss>
