<?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: Mahadi Hasan</title>
    <description>The latest articles on DEV Community by Mahadi Hasan (@mhasancy).</description>
    <link>https://dev.to/mhasancy</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%2F847841%2Fd9e3f6f4-9346-4e71-b0da-31cfdd735803.jpeg</url>
      <title>DEV Community: Mahadi Hasan</title>
      <link>https://dev.to/mhasancy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhasancy"/>
    <language>en</language>
    <item>
      <title>Unit Testing</title>
      <dc:creator>Mahadi Hasan</dc:creator>
      <pubDate>Sun, 24 Apr 2022 17:12:01 +0000</pubDate>
      <link>https://dev.to/mhasancy/unit-testing-1c8k</link>
      <guid>https://dev.to/mhasancy/unit-testing-1c8k</guid>
      <description>&lt;p&gt;Unit testing still causes controversy among developers and product managers. There are both opponents and supporters of this kind of testing. In this article, I’ll highlight the main advantages of unit testing.&lt;br&gt;
What are unit tests, why unit testing is essential, and how do they help developers and business owners? For the answers to these questions and more, read on.&lt;br&gt;
Let’s start with the definition: Unit testing is a software testing method where “units”—the individual components of software—are tested. Developers write unit tests for their code to ensure that the code works correctly. This helps to detect and protect against bugs in the future.&lt;br&gt;
Sometimes developers write unit tests first, then write the code. This approach is also known as test-driven development (TDD). In TDD, requirements are turned into specific test cases; then, the software is improved to pass the new tests. No code is added that hasn’t been proven to meet defined requirements in this approach. Unit testing is similar in that it allows developers to modify code without affecting the functionality of other units or the product as a whole.&lt;br&gt;
Unit tests are usually written in the form of functions and check the value and behaviour of these functions in various scenarios. For example, imagine a function for dividing two numbers: the developer decides to follow the TDD approach, first writing a test with the input of values ‘4’ and ‘2’ (4 divided by 2) with ‘2’ expected as a result. Another example is that when the divisor is zero, we don’t expect that the function will produce a value—we hope it will generate an exception.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Exploring TypeScript</title>
      <dc:creator>Mahadi Hasan</dc:creator>
      <pubDate>Fri, 15 Apr 2022 10:43:41 +0000</pubDate>
      <link>https://dev.to/mhasancy/exploring-typescript-d3j</link>
      <guid>https://dev.to/mhasancy/exploring-typescript-d3j</guid>
      <description>&lt;p&gt;According to the &lt;strong&gt;typescript&lt;/strong&gt; website&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"TypeScript is JavaScript with syntax for types.&lt;/p&gt;

&lt;p&gt;TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's all that does mean. In this case, no matter what you're working with, like javascript, react, angular or etc., that concerns javascript, you gotta go with typescript. It saves time and makes you more confident in finding bugs and errors.&lt;/p&gt;

&lt;p&gt;It has some excellent capabilities, like a throwing compiling error. It continuously monitors your code, whether you edited it or not; if edited, what is the type issue and many more things.&lt;br&gt;
Typescript is really easy to learn. It is a superset of javascript. That's all that it says, meaning it can hold all the javascript valid code along with its features.&lt;/p&gt;

&lt;p&gt;In javascript, we define a variable like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const abc = "Hello world!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in typescript, we have to define its type, whether it is a string, number, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const abs:string = "Hello world!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typescript itself has so may advantages like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Support for modern JavaScript features&lt;/li&gt;
&lt;li&gt;Advanced type system&lt;/li&gt;
&lt;li&gt;Developer tooling support&lt;/li&gt;
&lt;li&gt;Optionally static typing and type inference&lt;/li&gt;
&lt;li&gt;Enhanced IDE support&lt;/li&gt;
&lt;li&gt;Strict null checks&lt;/li&gt;
&lt;li&gt;Compilation&lt;/li&gt;
&lt;li&gt;JavaScript interoperability&lt;/li&gt;
&lt;li&gt;Converting from JavaScript to TypeScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;To be continued.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
