<?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: aburra12</title>
    <description>The latest articles on DEV Community by aburra12 (@aburra12).</description>
    <link>https://dev.to/aburra12</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%2F820144%2F85387160-f015-4e4c-a086-4f547940f26e.png</url>
      <title>DEV Community: aburra12</title>
      <link>https://dev.to/aburra12</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aburra12"/>
    <language>en</language>
    <item>
      <title>What am I currently reading 📚 📚</title>
      <dc:creator>aburra12</dc:creator>
      <pubDate>Thu, 24 Feb 2022 08:15:52 +0000</pubDate>
      <link>https://dev.to/aburra12/what-am-i-currently-reading-3l3m</link>
      <guid>https://dev.to/aburra12/what-am-i-currently-reading-3l3m</guid>
      <description>&lt;p&gt;&lt;a href="https://noidea.dog/glue"&gt;https://noidea.dog/glue&lt;/a&gt; - A coworker shared this article and it is amazing to understand how much important glue work is for a project and what it means for a Senior Engineer to be that glue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://livebook.manning.com/book/the-art-of-unit-testing-third-edition/welcome/v-6/1"&gt;https://livebook.manning.com/book/the-art-of-unit-testing-third-edition/welcome/v-6/1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Powerful insights from Chapter 1 : &lt;br&gt;
So, what’s a “good” unit test?&lt;/p&gt;

&lt;p&gt;Unit tests should run quickly and be consistent in its results (it always returns the same result if you don’t change anything between runs).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;should have full control of the code under test.&lt;/li&gt;
&lt;li&gt;should be fully isolated (runs independently of other tests).&lt;/li&gt;
&lt;li&gt;should run in memory without requiring system files, networks, databases.&lt;/li&gt;
&lt;li&gt;should be as synchronous and linear as possible when it makes sense. (no parallel threads if we can help it)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wait... Synchronous??? What about asyncs/awaits..&lt;/p&gt;

&lt;p&gt;From a unit testing point of view, we should find a way to make the processes happening through a single path in a unit of work, from entry point to exit point, as synchronous as possible. That might mean triggering callbacks directly from the test, or it might mean faking the time in the test to the point &lt;strong&gt;where the test does not need to wait for any async code to finish executing&lt;/strong&gt;, unless there’s no other choice (at that point it might not be a unit test, but the situations can vary quite a bit).&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>learning</category>
      <category>unittesting</category>
      <category>testyourcodebetter</category>
    </item>
    <item>
      <title>My prep towards AWS Solutions Architect certification</title>
      <dc:creator>aburra12</dc:creator>
      <pubDate>Thu, 24 Feb 2022 07:58:03 +0000</pubDate>
      <link>https://dev.to/aburra12/how-am-i-preparing-for-aws-solutions-architect-certification-3290</link>
      <guid>https://dev.to/aburra12/how-am-i-preparing-for-aws-solutions-architect-certification-3290</guid>
      <description>&lt;p&gt;First things first : 1. I finally made up my mind to take this certification. have been putting it off since last October..phew &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Purchased course material from Udemy - costed about $40( got a good deal) Here's the link to purchase - &lt;a href="https://www.udemy.com/course/aws-certified-solutions-architect-associate-saa-c02/"&gt;https://www.udemy.com/course/aws-certified-solutions-architect-associate-saa-c02/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are a total of 30 Sections with each section divided into little pieces for easy digestion ( love that!) &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Course starts off with AWS Cloud Overview - Regions, Tour of the Console &amp;amp; Services in AWS &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Major topics &lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;IAM &amp;amp; AWS CLI &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EC2 Fundamentals &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EC2 Solutions Architect Associate Level &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EC2 Instance Storage &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;High Availability &amp;amp; Scalability - ELB &amp;amp; ASG &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RDS + Aurora + ElastiCache&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Route 53&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amazon S3 &amp;amp; Athena&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS SDK, IAM Roles &amp;amp; Policies &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CloudFront &amp;amp; AWS Global Accelerator &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS Storage Extras&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SQS, SNS, Kinesis, Active MQ&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Containers on AWS : ECS, Fargate, ECR &amp;amp;EKS &lt;br&gt;
and many more...&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>productivity</category>
      <category>tutorial</category>
      <category>aws</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Task Vs Thread ( C#) </title>
      <dc:creator>aburra12</dc:creator>
      <pubDate>Thu, 24 Feb 2022 07:39:20 +0000</pubDate>
      <link>https://dev.to/aburra12/task-vs-thread-c-197c</link>
      <guid>https://dev.to/aburra12/task-vs-thread-c-197c</guid>
      <description>&lt;p&gt;Notes gathered from different sources: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System threads are nothing but resources for tasks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Key differences between Task and Thread&lt;/p&gt;

&lt;p&gt;Usually you hear Task is a higher level concept than thread... and that's what this phrase means:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can't use Abort/ThreadAbortedException, you should support cancel event in your "business code" periodically testing &lt;strong&gt;token.IsCancellationRequested&lt;/strong&gt; flag (also avoid long or timeoutless connections e.g. to db, otherwise you will never get a chance to test this flag). By the similar reason &lt;strong&gt;Thread.Sleep(delay) call should be replaced with Task.Delay(delay, token) call&lt;/strong&gt; (passing token inside to have possibility to interrupt delay)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Code sample for Cancellation Tokens in my github repo : &lt;a href="https://github.com/aburra12/TaskCancellation"&gt;https://github.com/aburra12/TaskCancellation&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;There are no &lt;strong&gt;thread's&lt;/strong&gt; Suspend and Resume methods functionality with tasks. Instance of task can't be reused either.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But you get two new tools:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a) continuations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;// continuation with ContinueWhenAll - execute the delegate, when ALL&lt;br&gt;
// tasks[] had been finished; other option is ContinueWhenAny&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Task.Factory.ContinueWhenAll( 
   tasks,
   () =&amp;gt; {
       int answer = tasks[0].Result + tasks[1].Result;
       Console.WriteLine("The answer is {0}", answer);
   }
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;b) nested/child tasks&lt;br&gt;
//StartNew - starts task immediately, parent ends whith child&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var parent = Task.Factory.StartNew
(() =&amp;gt; {
          var child = Task.Factory.StartNew(() =&amp;gt;
         {
         //...
         });
      },  
      TaskCreationOptions.AttachedToParent
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The task can return a result. There is no direct mechanism to return the result from a thread.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A task can have multiple processes happening at the same time. Threads can only have one task running at a time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A new Thread()is not dealing with Thread pool thread, whereas Task does use thread pool thread.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;How to create a Task&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static void Main(string[] args) {  
    Task &amp;lt; string &amp;gt; obTask = Task.Run(() =&amp;gt; (  
        return“ Hello”));  
    Console.WriteLine(obTask.result);  
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How to create a Thread&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static void Main(string[] args) {  
    Thread thread = new Thread(new ThreadStart(getMyName));  
    thread.Start();  
}  
public void getMyName() {} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>taskvsthread</category>
      <category>csharp</category>
      <category>parallelprogramming</category>
      <category>async</category>
    </item>
  </channel>
</rss>
