<?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: Papa</title>
    <description>The latest articles on DEV Community by Papa (@papa).</description>
    <link>https://dev.to/papa</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%2Forganization%2Fprofile_image%2F1492%2F0376cc6a-8e74-4404-98ea-7cab37810662.png</url>
      <title>DEV Community: Papa</title>
      <link>https://dev.to/papa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/papa"/>
    <language>en</language>
    <item>
      <title>An Ode to My Favorite Line of Elixir !</title>
      <dc:creator>Adrian P. Dunston</dc:creator>
      <pubDate>Wed, 29 Jul 2020 16:00:11 +0000</pubDate>
      <link>https://dev.to/papa/an-ode-to-favorite-line-of-elixir-319p</link>
      <guid>https://dev.to/papa/an-ode-to-favorite-line-of-elixir-319p</guid>
      <description>&lt;p&gt;Gather around, and I'll tell you the tale of my favorite line of code&lt;/p&gt;

&lt;p&gt;A piece of advice, I thought it concise to bequeath in the form of an ode&lt;/p&gt;

&lt;p&gt;&lt;code&gt;|&amp;gt; IO.inspect(label: "!!ADRIAN #{__ENV__.file}:#{__ENV__.line}", pretty: true)&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Pipes
&lt;/h1&gt;

&lt;p&gt;We'll start with a pipe &lt;code&gt;|&amp;gt;&lt;/code&gt; a wondrous device, feeds one call's return to another&lt;/p&gt;

&lt;p&gt;Without such a token, our code would look broken, its calls piled up in a smother.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;text_of_poem&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"One fish&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;Two fish&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;Red fish&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;Blue fish"&lt;/span&gt;

&lt;span class="c1"&gt;# Without pipes&lt;/span&gt;
&lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text_of_poem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;

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



&lt;p&gt;First argument in, next function begins; you can see at a glance it looks cleaner&lt;/p&gt;

&lt;p&gt;Make functions designed with piped-calls in mind; Your test suite is sure to run greener&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# With pipes&lt;/span&gt;
&lt;span class="n"&gt;text_of_poem&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&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="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Inspect
&lt;/h1&gt;

&lt;p&gt;Now let us reflect on humble &lt;code&gt;inspect/2&lt;/code&gt;, a device indescribably lucid&lt;/p&gt;

&lt;p&gt;If your bug's a big stinker that's stuck in your thinker, &lt;code&gt;inspect/2&lt;/code&gt; makes it jump as if goose-ed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Convert data structure to readable string&lt;/span&gt;
&lt;span class="n"&gt;quoth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;%{&lt;/span&gt;&lt;span class="ss"&gt;raven:&lt;/span&gt; &lt;span class="s2"&gt;"nevermore"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quoth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# ==&amp;gt; "%{raven: \"nevermore\"}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;inspect/2&lt;/code&gt; by itself is more than a help, it converts any data to string form&lt;/p&gt;

&lt;p&gt;And with option &lt;code&gt;pretty&lt;/code&gt;, the output's less bitty; Your brain has more room for a brainstorm&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;quoth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;%{&lt;/span&gt;&lt;span class="ss"&gt;raven:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"nevermore"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"nevermore"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"nevermore"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
    &lt;span class="ss"&gt;poe:&lt;/span&gt; &lt;span class="s2"&gt;"Take thy form from off my door!"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quoth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀%{poe: "Take thy form from off my door!", raven: ["nevermore", "nevermore", "nevermore"]}&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; :ok&lt;/span&gt;

&lt;span class="c1"&gt;# The pretty: true option gives us more readable spacing.&lt;/span&gt;
&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;quoth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="ss"&gt;pretty:&lt;/span&gt; &lt;span class="no"&gt;true&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="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀%{&lt;/span&gt;
&lt;span class="c1"&gt;#    poe: "Take thy form from off my door!",&lt;/span&gt;
&lt;span class="c1"&gt;#    raven: ["nevermore", "nevermore", "nevermore"]&lt;/span&gt;
&lt;span class="c1"&gt;#   }&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; :ok&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  IO.inspect
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;IO.inspect/2&lt;/code&gt; has dual effects, first it needs not a &lt;code&gt;puts/1&lt;/code&gt; to be candid,&lt;/p&gt;

&lt;p&gt;The second more subtle, not run in a bubble, this function returns what it's handed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kn"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# 👀%{raven: "nevermore"}&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; %{raven: "nevermore"}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Inspection without interference!&lt;/span&gt;
&lt;span class="n"&gt;text_of_poem&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&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="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀["One fish", "Two fish", "Red fish", "Blue fish"]&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now let's look at &lt;code&gt;:label&lt;/code&gt;; It's part of the stable of options &lt;code&gt;inspect/2&lt;/code&gt; can make use of&lt;/p&gt;

&lt;p&gt;ID your inspections for further reflection on whatever info's elusive&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;text_of_poem&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"Before split"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&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="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"After split"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀Before split: "One fish\nTwo fish\nRed fish\nBlue fish"&lt;/span&gt;
&lt;span class="c1"&gt;# 👀After split: ["One fish", "Two fish", "Red fish", "Blue fish"]&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Calling Card
&lt;/h1&gt;

&lt;p&gt;Now &lt;code&gt;IO.inspect\2&lt;/code&gt;'s not a thing to forget when your feature is primed for submission,&lt;/p&gt;

&lt;p&gt;When you &lt;strong&gt;fit-and-finish&lt;/strong&gt;, prestige will diminish with inspect lines as part of commission&lt;/p&gt;

&lt;p&gt;Remind to remove and avoid such reprove with &lt;strong&gt;calling-card&lt;/strong&gt; text you're alert to&lt;/p&gt;

&lt;p&gt;Make it unique, add your mystique, and before you commit do a search-through&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;#!!ADRIAN - debug lines easier to spot in console&lt;/span&gt;
&lt;span class="c1"&gt;# Remember to grep and remove !!ADRIAN lines before you push&lt;/span&gt;

&lt;span class="n"&gt;text_of_poem&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"!!ADRIAN Before split"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&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="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"!!ADRIAN After split"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀!!ADRIAN Before split: "One fish\nTwo fish\nRed fish\nBlue fish"&lt;/span&gt;
&lt;span class="c1"&gt;# 👀!!ADRIAN After split: ["One fish", "Two fish", "Red fish", "Blue fish"]&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  ENV file and line
&lt;/h1&gt;

&lt;p&gt;Final reflection on one-line perfection confesses the fact that I'm slothful.&lt;/p&gt;

&lt;p&gt;It feels such a bother, each label to author; is cutting and pasting so awful?&lt;/p&gt;

&lt;p&gt;Now in walks dear &lt;code&gt;ENV&lt;/code&gt;, our quite astute friend; she knows both the file and line number&lt;/p&gt;

&lt;p&gt;With this pal in hand, inspect can be canned; and attention advance unencumbered&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="n"&gt;text_of_poem&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;  &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"!!ADRIAN &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;__ENV__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;__ENV__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;pretty:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;String&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;  &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;label:&lt;/span&gt; &lt;span class="s2"&gt;"!!ADRIAN &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;__ENV__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;__ENV__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;pretty:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="mi"&gt;5&lt;/span&gt;  &lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 👀!!ADRIAN example.ex:2: "One fish\nTwo fish\nRed fish\nBlue fish"&lt;/span&gt;
&lt;span class="c1"&gt;# 👀!!ADRIAN example.ex:4: ["One fish", "Two fish", "Red fish", "Blue fish"]&lt;/span&gt;
&lt;span class="c1"&gt;# ==&amp;gt; 4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  Coda - Clipboard Extension Tools
&lt;/h1&gt;

&lt;p&gt;I hope you've admired this line so inspired by the folks who have taught me before,&lt;/p&gt;

&lt;p&gt;And with your indulgence, I've one more divulgence, a quirk that can quickly be yours&lt;/p&gt;

&lt;p&gt;Clipboard extension is carapal prevention; it works by saving you typing&lt;/p&gt;

&lt;p&gt;Along with your copies, it pastes pre-typed drop-ins, so coding continues like lightning!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight markdown"&gt;&lt;code&gt;Ditto Clipboard Extension for Windows
https://www.microsoft.com/en-us/p/ditto-clipboard/9nblggh3zbjq

Clipy Clipboard Extension for Mac
https://github.com/Clipy/Clipy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Have a Calling Card - Putting your personal stamp on things left undone</title>
      <dc:creator>Adrian P. Dunston</dc:creator>
      <pubDate>Mon, 27 Jul 2020 14:08:35 +0000</pubDate>
      <link>https://dev.to/papa/have-a-calling-card-putting-your-personal-stamp-on-things-left-undone-lk8</link>
      <guid>https://dev.to/papa/have-a-calling-card-putting-your-personal-stamp-on-things-left-undone-lk8</guid>
      <description>&lt;p&gt;When I'm writing/changing software, and I write something that I know I don't want to go out to production, I put a comment with the string &lt;code&gt;!!ADRIAN&lt;/code&gt; in it. Before I commit/push/deploy (depending on the situation), I do a full-text-search for that string. Wherever I find it, I fix it.&lt;/p&gt;

&lt;p&gt;This has improved my life in ways beyond measure. It's easy to understand and easy to do, so it's one of the first pieces of advice I give to newer programmers: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Invent a personal calling card&lt;/li&gt;
&lt;li&gt;Leave it as a comment wherever you are leaving something unfinished&lt;/li&gt;
&lt;li&gt;Search for it before you turn in your work&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;So you finish what you intend to. The ability to &lt;strong&gt;make your intentions real in the world&lt;/strong&gt; is the definition of power. Software is complicated. Your mind (while very impressive) is limited. We use tools to leverage the power of our mind. This simple tool gives you more power over software.&lt;/p&gt;

&lt;h2&gt;
  
  
  How?
&lt;/h2&gt;

&lt;p&gt;Pick something unique to you. &lt;code&gt;TODO&lt;/code&gt; doesn't cut it. You'll probably be working in a team soon (if not already). &lt;code&gt;TODO&lt;/code&gt; is everyone's responsibility, &lt;strong&gt;so it's no one's responsibility&lt;/strong&gt;. &lt;code&gt;!!ADRIAN&lt;/code&gt; claims something as my responsibility. I'm generally the only Adrian on a team. Pick something that no one else will use. When I suggested this to a colleague, he immediately started using 🚨. Brilliant. I would never have thought of that. (I'm still not used to the fact that my editor understand emoji.) If someone else starts using it, my colleague may want to put his initials on it, but &lt;strong&gt;let's not go solving tomorrow's problems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Pick something agreeable. &lt;strong&gt;Agreeability is not always the right choice&lt;/strong&gt;, but here it is. Sometimes you'll forget to search. Seeing your calling-card in production code will be mildly embarrassing, and that's fine. We &lt;strong&gt;develop with our feelings&lt;/strong&gt;. You don't want to exacerbate that by having a calling card that is additionally embarrassing. In general, &lt;strong&gt;don't write swears&lt;/strong&gt;, and try to &lt;strong&gt;keep it positive&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Pick something that indicates a problem. Seeing &lt;code&gt;!!&lt;/code&gt; , it's easy for other developers to infer that the comment indicates something is wrong or unfinished. 🚨 accomplishes the same thing.&lt;/p&gt;

&lt;p&gt;Pick something easy to write. My fingers type &lt;code&gt;#!!ADRIAN&lt;/code&gt; automatically now. It's also in certain debug lines I'm always pasting in. My colleague knows how to make an 🚨 appear with a few keystrokes. You may want to use a &lt;strong&gt;clipboard manager&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Do the search at the end. I encourage you to &lt;strong&gt;have an actual checklist&lt;/strong&gt; you run through before turning in any work. I have a checklist for &lt;strong&gt;fit and finish&lt;/strong&gt;. It includes searching for &lt;code&gt;#!!ADRIAN&lt;/code&gt; and &lt;code&gt;@tag :wip&lt;/code&gt;, two artifacts I often leave behind in Elixir development. Your checklist is up to you, but I recommend having one, and I recommend "search for calling card" be on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the rest of the team?
&lt;/h2&gt;

&lt;p&gt;You use this tool. See if it works for you. If so, suggest it to your closest teammates and then to the rest of the team. Socializing tools helps those around you, and &lt;strong&gt;teaching helps you learn&lt;/strong&gt;. But ultimately, this is an individual tool. It will help you regardless of who else adopts it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about you?
&lt;/h2&gt;

&lt;p&gt;Thanks for reading. If you start using this or have been, I'd love to hear it. Feel free to reach out and let me know your calling card or any fun stories from leaving one behind.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How we test our React-Native application with Appium</title>
      <dc:creator>Andy Sherman</dc:creator>
      <pubDate>Fri, 06 Dec 2019 21:09:31 +0000</pubDate>
      <link>https://dev.to/papa/how-we-test-our-react-native-application-with-appium-4mmd</link>
      <guid>https://dev.to/papa/how-we-test-our-react-native-application-with-appium-4mmd</guid>
      <description>&lt;h2&gt;
  
  
  Where it all started
&lt;/h2&gt;

&lt;p&gt;I know what you're thinking... "Oh boy, everyone's favorite phase of the software development life cycle: TESTING!".  At least, that was my initial thought.  However, proper testing is critical, especially when it comes to my current role in mobile development.  When you are writing for an app that will hit the hands of &lt;em&gt;thousands&lt;/em&gt; of people, you need to plan for all possible "what if"'s. &lt;/p&gt;

&lt;p&gt;Since I began my job at Papa, the mobile testing was done by the engineers, by hand, every time.  While it was getting us through our releases, it was obviously not going to be sustainable in the long term as the company continues to grow and features continue to be added.  A colleague did some research in to automated testing, and I was then tasked with implementing her results.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Getting rolling with Appium
&lt;/h2&gt;

&lt;p&gt;For anyone unfamiliar, Appium is an open source test automation framework for use with native, hybrid and mobile web apps.  As we are building our app with React-Native, this was the clear front runner for our team. (For reference, I do all of my work on macOS) The installation of Appium is as easy as&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g appium&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After successfully doing that, all you then need to do is run the command &lt;code&gt;appium&lt;/code&gt; and you'll have a local Appium server running on port 4723!  It is in this window you'll be able to see all the output and logs from any tests you run.&lt;/p&gt;

&lt;h4&gt;
  
  
  Quick suggestion
&lt;/h4&gt;

&lt;p&gt;I began my testing process exactly as described above, which &lt;em&gt;does&lt;/em&gt; work fine, however if you are going to be writing extensive testing using Appium, I &lt;strong&gt;highly&lt;/strong&gt; recommend you download the Appium desktop client.  This will give you a dedicated window for the server, easier view and searching of the logs, among many other customization and capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing the tests
&lt;/h2&gt;

&lt;p&gt;What is normally considered the most painful part of mobile testing is made a lot easier with Appium. The ability to set the desired capabilities of the test right up front allows you to customize the test to your needs and make sure you are testing &lt;em&gt;exactly&lt;/em&gt; what you want to be testing.  Now, Appium has a very long list of supported capability settings, which can be found &lt;a href="http://appium.io/docs/en/writing-running-appium/caps/"&gt;here&lt;/a&gt;.  The best thing you can do is to familiarize yourself with this list before you even get started so you save yourself some major headaches while testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Downsides
&lt;/h2&gt;

&lt;p&gt;I know I know, I've been gushing so much over Appium you're probably assuming I work for them, but I don't.  As much as their product has begun to make things easier for myself and my team, there is certainly plenty of room for improvement.  I could write a whole separate post on that, but for now I'll leave you with my 2 biggest gripes:&lt;/p&gt;

&lt;h4&gt;
  
  
  Utilities
&lt;/h4&gt;

&lt;p&gt;My biggest road block I ran in to throughout the process was that the app I am testing requires location permissions. The issue being that this notification always pops up before the app is fully loaded, so the built-in "handleAlert" functions are useless.  I spent hours trying to track down a solution and settled on &lt;a href="https://github.com/wix/AppleSimulatorUtils"&gt;AppleSimulatorUtils&lt;/a&gt;, which allows you to set permissions for the simulator in the background and not have to rely on responding to alerts.&lt;/p&gt;

&lt;h4&gt;
  
  
  Sleeping
&lt;/h4&gt;

&lt;p&gt;As far as I could find, there was no easy way to "slow down" Appium as it blasted through all of the test commands.  Anyone who has worked in a simulator knows that sometimes they are a little slow and laggy.  This often caused the tests to fail because Appium would click a button and then try clicking another one before the next screen had loaded.  Appium &lt;em&gt;does&lt;/em&gt; have the ability to wait for certain elements to be present before acting, however including the &lt;code&gt;isElementDisplayed()&lt;/code&gt; after every screen transition could be a bit tiresome.&lt;/p&gt;

&lt;p&gt;My solution was to write a simple sleep function and include &lt;em&gt;that&lt;/em&gt; after each command, as it was a lot easier to reuse and adjust as needed, and didn't require the constant discovery of elementId's.&lt;/p&gt;

&lt;h5&gt;
  
  
  fin.
&lt;/h5&gt;

</description>
      <category>reactnative</category>
      <category>appium</category>
      <category>testing</category>
      <category>react</category>
    </item>
    <item>
      <title>How Friday developer potlucks can help build stronger, happier engineering teams.</title>
      <dc:creator>Sergio Tapia</dc:creator>
      <pubDate>Thu, 07 Nov 2019 01:14:20 +0000</pubDate>
      <link>https://dev.to/papa/how-friday-developer-potlucks-can-help-build-stronger-happier-engineering-teams-1akc</link>
      <guid>https://dev.to/papa/how-friday-developer-potlucks-can-help-build-stronger-happier-engineering-teams-1akc</guid>
      <description>&lt;p&gt;Before joining Papa as director of engineering, I worked with plenty of different startups and mid-sized companies and I would receive these large features to build that would easily take two weeks to complete. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heading out for the weekend knowing that I had this beast of a feature still there was demoralizing&lt;/strong&gt;. I couldn't really enjoy my weekend. The beast always lingered there in the back of my mind.&lt;/p&gt;

&lt;p&gt;A big part of my job at Papa is making sure our engineering team is happy, productive and unblocked. I always approach things from the angle of: "I've been in their shoes. What would I have liked back then?" and do my best to make their professional lives easier.&lt;/p&gt;

&lt;p&gt;This is where I thought of the potluck idea.&lt;/p&gt;

&lt;p&gt;Here's the problem:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You have large tasks to work on during the sprint.&lt;/li&gt;
&lt;li&gt;Smaller bugs and annoyances pop up during a regular sprint.&lt;/li&gt;
&lt;li&gt;These small things build up in your mind and you leave Friday worried about the small things and the unfinished big thing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's the solution, our sprint potluck:&lt;/p&gt;

&lt;p&gt;Every Friday after lunch, we take the rest of the afternoon to pick one item from our potluck list and do our best to knock it out. &lt;/p&gt;

&lt;p&gt;This simple change brings a lot of benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;People go home with a feeling of accomplishment. A &lt;strong&gt;finished&lt;/strong&gt; ticket no matter how small, is finished.&lt;/li&gt;
&lt;li&gt;We whittle away at the long list of small annoyances.&lt;/li&gt;
&lt;li&gt;People's brains can relax from thinking about that big incomplete thing for an afternoon and two days. Surprisingly, coming back to the large feature yields great results. The break does pay off!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Specifically, we use &lt;a href="https://clubhouse.io/"&gt;Clubhouse&lt;/a&gt; as our project management tool.&lt;/p&gt;

&lt;h1&gt;
  
  
  Collecting the small annoyance tickets
&lt;/h1&gt;

&lt;p&gt;Each week we have one person on rotation to triage requests from head of departments in a Slack channel we call &lt;em&gt;department-support&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;We figure out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this a real issue?&lt;/li&gt;
&lt;li&gt;Is this request too out there and unreasonable?&lt;/li&gt;
&lt;li&gt;Is this a feature or a bugfix?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then we place it into Clubhouse in our Backlog project.&lt;/p&gt;

&lt;h1&gt;
  
  
  The day of the sprint potluck
&lt;/h1&gt;

&lt;p&gt;We all meet over Zoom and go over each triaged ticket in the Backlog project. Every person on the team picks one ticket they think they can reasonably address during potluck.&lt;/p&gt;

&lt;p&gt;We move each ticket into the potluck &lt;em&gt;iteration&lt;/em&gt; (Clubhouses' fancy word for an agile sprint)&lt;/p&gt;

&lt;h1&gt;
  
  
  We feast
&lt;/h1&gt;

&lt;p&gt;We all relax after a Friday lunch and tackle these smaller items with more levity and a fresh set of eyes. &lt;/p&gt;




&lt;p&gt;What happens if someone doesn't finish their potluck ticket?&lt;/p&gt;

&lt;p&gt;They can take Monday morning to finish it off, but if they can't it means that the ticket is a candidate to become a normal sprint ticket - and no longer potluck. We discuss when its a priority to add it to the sprint.&lt;/p&gt;

&lt;p&gt;I'd love to hear your thoughts about our sprint potluck and also if your team has any other engineering rituals. &lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>management</category>
      <category>agile</category>
    </item>
  </channel>
</rss>
