<?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: anthonyjvoss</title>
    <description>The latest articles on DEV Community by anthonyjvoss (@anthonyjvoss).</description>
    <link>https://dev.to/anthonyjvoss</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%2F340483%2F836e28ac-0bfe-48cc-a565-60a20029455f.jpeg</url>
      <title>DEV Community: anthonyjvoss</title>
      <link>https://dev.to/anthonyjvoss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anthonyjvoss"/>
    <language>en</language>
    <item>
      <title>PowerShell Readability For Others</title>
      <dc:creator>anthonyjvoss</dc:creator>
      <pubDate>Sun, 23 Feb 2020 15:09:08 +0000</pubDate>
      <link>https://dev.to/anthonyjvoss/powershell-readability-for-others-4p5k</link>
      <guid>https://dev.to/anthonyjvoss/powershell-readability-for-others-4p5k</guid>
      <description>&lt;h1&gt;
  
  
  Intro
&lt;/h1&gt;

&lt;p&gt;I've been meaning to start some sort of online blog to jot down snippets, ideas, and solutions to begin giving back to the online community I regularly benefit from.  Here is my first short post to begin that journey!&lt;/p&gt;

&lt;h1&gt;
  
  
  The Great Debate
&lt;/h1&gt;

&lt;p&gt;I work on a team of 6 developers that write automated solutions.  We are currently a little divided in our preferred languages with a heavier focus on Python.  Unfortunately, I'm the PowerShell guy that has been slowly learning Python to support different projects and our overall code base.&lt;/p&gt;

&lt;p&gt;I've been having a debate with myself over the past couple weeks.  Do I go out of my way to make my PowerShell more readable or stick to the syntax I've learned and are more comfortable writing?&lt;/p&gt;

&lt;h1&gt;
  
  
  Can You Read This Now?
&lt;/h1&gt;

&lt;p&gt;Here is a quick example with a method used very frequently: piping to Where-Object to perform operations based on an object property value.&lt;/p&gt;

&lt;p&gt;This is the way I'm used to writing my code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-NetworkAdapter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Where-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;NetConnectionID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NIC1"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For anyone familiar with PowerShell, this probably makes perfect sense.  However, on my team this presents an initial roadblock concerning readability.  &lt;/p&gt;

&lt;p&gt;Based on a poll I sent out, they seemed more familiar/comfortable when the same command was presented this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-NetworkAdapter&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;NetConnectionID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-eq&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NIC1"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Overall, I think our decision is going to come down to what works best for our team.  I'm fine to give a little, as some of the syntax of PowerShell is quite different than Python.  However, I will also be challenging them to invest some time learning PowerShell as I learn Python :)&lt;/p&gt;

&lt;p&gt;Let me know what you think in the comments.  I may later turn this into a series about our team adventure to being a multi-language group.&lt;/p&gt;

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

</description>
      <category>powershell</category>
      <category>python</category>
      <category>readability</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
