<?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: Jared Mathis</title>
    <description>The latest articles on DEV Community by Jared Mathis (@jaredmathis).</description>
    <link>https://dev.to/jaredmathis</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%2F464185%2F08710f77-f7ba-402a-86a5-30861bed4e33.jpeg</url>
      <title>DEV Community: Jared Mathis</title>
      <link>https://dev.to/jaredmathis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaredmathis"/>
    <language>en</language>
    <item>
      <title>C# Tuples</title>
      <dc:creator>Jared Mathis</dc:creator>
      <pubDate>Sat, 05 Sep 2020 21:00:07 +0000</pubDate>
      <link>https://dev.to/jaredmathis/c-tuples-438n</link>
      <guid>https://dev.to/jaredmathis/c-tuples-438n</guid>
      <description>&lt;p&gt;Beginning with C# 7.0, Tuples &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-tuples"&gt;can be expressed like this&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(double, int) t1 = (4.5, 3);
Console.WriteLine($"Tuple with elements {t1.Item1} and {t1.Item2}.");
// Output:
// Tuple with elements 4.5 and 3.

(double Sum, int Count) t2 = (4.5, 3);
Console.WriteLine($"Sum of {t2.Count} elements is {t2.Sum}.");
// Output:
// Sum of 3 elements is 4.5.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This way you don't have to write &lt;code&gt;new Tuple(item1, item2)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Tuples can be expressed succintly in method signatures. For example, this method returns an &lt;code&gt;IEnumerable&lt;/code&gt; of tuples of generic type &lt;code&gt;T&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static IEnumerable&amp;lt;(T,T)&amp;gt; Pairs&amp;lt;T&amp;gt;(IEnumerable&amp;lt;T&amp;gt; ts)
{
    var skip = 1;
    T previous = default;
    foreach (var current in ts)
    {
        if (skip == 0)
        {
            yield return (previous, current);
        }
        else
        {
            skip--;
        }
        previous = current;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This method enumerates through pairs of an &lt;code&gt;IEnumerable&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, if you have &lt;code&gt;new [] { 1,2,3 }&lt;/code&gt;, the following tuples will be enumerated (using the new syntax): &lt;code&gt;(1,2)&lt;/code&gt;, &lt;code&gt;(2,3)&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
    <item>
      <title>Angular on StackBlitz</title>
      <dc:creator>Jared Mathis</dc:creator>
      <pubDate>Sat, 05 Sep 2020 20:27:57 +0000</pubDate>
      <link>https://dev.to/jaredmathis/angular-on-stackblitz-2j7j</link>
      <guid>https://dev.to/jaredmathis/angular-on-stackblitz-2j7j</guid>
      <description>&lt;p&gt;&lt;a href="https://angular.io/docs"&gt;Angular&lt;/a&gt; normally requires you to install &lt;a href="https://nodejs.org/"&gt;Node.js&lt;/a&gt; and the &lt;a href="https://cli.angular.io/"&gt;Angular command-line interface tool&lt;/a&gt; to &lt;a href="https://angular.io/guide/setup-local"&gt;get started with an Angular project&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Instead, to try out Angular, check out StackBlitz.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to: &lt;a href="https://stackblitz.com/"&gt;https://stackblitz.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the "Start a new app" button.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click "Angular". &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stackblitz will create a "Hello, World" Angular application for you.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: &lt;a href="https://stackblitz.com/edit/angular-ivy-nlem87"&gt;https://stackblitz.com/edit/angular-ivy-nlem87&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>stackblitz</category>
    </item>
  </channel>
</rss>
