<?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: Afnaan</title>
    <description>The latest articles on DEV Community by Afnaan (@afnan_ahmed).</description>
    <link>https://dev.to/afnan_ahmed</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%2F1533891%2F53d40598-7d9d-481b-827c-b82cad689a3c.jpeg</url>
      <title>DEV Community: Afnaan</title>
      <link>https://dev.to/afnan_ahmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/afnan_ahmed"/>
    <language>en</language>
    <item>
      <title>What is TypeScript and what are it's advantages and disadvantages?</title>
      <dc:creator>Afnaan</dc:creator>
      <pubDate>Fri, 07 Jun 2024 14:33:11 +0000</pubDate>
      <link>https://dev.to/afnan_ahmed/what-is-typescript-and-what-are-its-advantages-and-disadvantages-3m7h</link>
      <guid>https://dev.to/afnan_ahmed/what-is-typescript-and-what-are-its-advantages-and-disadvantages-3m7h</guid>
      <description>&lt;p&gt;TypeScript is an extension of JavaScript, offering static typing to write straightforward JavaScript code. It provides optional static typing, classes, and interfaces, along with improved code organization and object-oriented programming techniques. TypeScript also offers better development tool support and extends the language with additional features beyond standard decorators. Additionally, it can be converted to plain JavaScript when needed.&lt;/p&gt;

&lt;p&gt;TypeScript is described as a strict superset of JavaScript, adding o&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb97sgli1lz4fjs2mj892.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb97sgli1lz4fjs2mj892.png" alt="Image description"&gt;&lt;/a&gt;ptional static typing and class-based object-oriented programming aligned with ECMAScript 6 standard proposals. It compiles down to plain JavaScript without requiring any runtime library support.&lt;/p&gt;

&lt;p&gt;Advantages of TypeScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;TypeScript highlights errors at compile time, while JavaScript does so at runtime.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript offers the benefits of optional static typing, allowing types to be added to variables, functions, properties, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript supports both strict and static typing, which can help document functions, clarify usage, and reduce cognitive overhead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript is compatible with any browser or JavaScript engine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It provides excellent tooling with features like IntelliSense, offering dynamic hints as code is written.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript aids in code organization and supports interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It offers better documentation for APIs, which helps in reducing bugs during development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript's editor modules provide a seamless IDE developer experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Disadvantages of TypeScript:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;TypeScript can take a long time to compile code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It does not support abstract classes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When using third-party libraries, there may be a need for definition files, which are not always available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The quality of type definition files can vary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript code still needs to be compiled to JavaScript whenever it needs to run in a browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finding TypeScript developers may be challenging, as some developers may not be interested in learning TypeScript, preferring to stick with JavaScript.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Teams transitioning from JavaScript to TypeScript may take time to become productive, with full proficiency in TypeScript taking even longer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TypeScript lacks some features compared to JavaScript, such as Higher Order Functions, Composition, and Generics with Higher Kinds.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Do you know how the code you write in JavaScript gets executed? How JavaScript supports asynchronous execution?</title>
      <dc:creator>Afnaan</dc:creator>
      <pubDate>Tue, 04 Jun 2024 14:20:13 +0000</pubDate>
      <link>https://dev.to/afnan_ahmed/do-you-know-how-the-code-you-write-in-javascript-gets-executed-how-javascript-supports-asynchronous-execution-315d</link>
      <guid>https://dev.to/afnan_ahmed/do-you-know-how-the-code-you-write-in-javascript-gets-executed-how-javascript-supports-asynchronous-execution-315d</guid>
      <description>&lt;p&gt;JavaScript is quite unique in that it’s single-threaded, meaning it processes code in a specific order. But despite this, it manages to handle time-consuming tasks without freezing up. So, how does it do that? Well, let me break it down for you.&lt;/p&gt;

&lt;p&gt;First off, there’s the call stack. Think of it like a stack of plates in a kitchen, where each plate represents a function being executed. When a function is called, a plate is added to the stack. Once that function finishes, its plate is removed. And it operates on a last-in, first-out basis.&lt;br&gt;
Then, there’s the event loop. This is JavaScript’s way of handling asynchronous tasks. It keeps an eye on the call stack, a queue for bigger tasks (macrotasks), and another queue for smaller, immediate tasks (microtasks). It checks if the call stack is empty. If it is, it grabs the first task from the microtask queue and puts it on the stack. It keeps doing this until the microtask queue is empty, and only then does it move on to the macrotask queue.&lt;/p&gt;

&lt;p&gt;Speaking of queues, there are macrotasks and microtasks. Microtasks are for urgent stuff, like Promise callbacks, while macrotasks are for things like I/O operations or timers. And microtasks always come before macrotasks, affecting the order of execution.&lt;/p&gt;

&lt;p&gt;Lastly, there’s the Web API stack, which is part of the browser. When you use functions like setTimeout, they’re handed off to this stack. Once the specified time elapses, the callback function gets added to the macrotask queue. It’s kind of like waiting for a timer to go off before doing something else.&lt;/p&gt;

&lt;p&gt;In a nutshell this happens:&lt;br&gt;
Code execution in JavaScript flows from the call stack ➔ to the event loop ➔ where microtasks take priority over macrotasks ➔ ultimately handling asynchronous tasks while synchronous code continues to execute.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Scripting vs. Programming Languages: Uncover the Key Differences Every Developer Should Know!</title>
      <dc:creator>Afnaan</dc:creator>
      <pubDate>Tue, 04 Jun 2024 14:18:19 +0000</pubDate>
      <link>https://dev.to/afnan_ahmed/scripting-vs-programming-languages-uncover-the-key-differences-every-developer-should-know-3haa</link>
      <guid>https://dev.to/afnan_ahmed/scripting-vs-programming-languages-uncover-the-key-differences-every-developer-should-know-3haa</guid>
      <description>&lt;p&gt;Discover key insights into scripting vs. programming languages that every developer should know! Understanding the difference between scripting and programming languages is key in software development.&lt;br&gt;
Scripting languages are interpreter-based, while programming languages are compiler-based, defining their distinct uses and behaviors. &lt;br&gt;
There are few exceptions here as well.&lt;/p&gt;

&lt;p&gt;Scripting languages are ideal for combining existing components within an application, making them great for integration and automation tasks. They run within an existing program, converting high-level instructions to machine language on-the-fly, without needing prior compilation. This makes them simpler and faster to use, with shorter, easier-to-write code. They don’t create specific file types and typically involve lower maintenance costs. Examples include VB Script, Perl, Ruby, PHP, and JavaScript.&lt;/p&gt;

&lt;p&gt;In contrast, programming languages are used to develop applications from scratch. They compile the entire program into machine language, resulting in standalone, self-executable code. This process requires more complex and lengthy code, offering comprehensive support for data types, UI design, and graphics. While more time-consuming and expensive to maintain, programming languages provide the robustness needed for building large-scale applications. Examples include C, C++, COBOL, Basic, VB, C#, Pascal, and Java.&lt;/p&gt;

&lt;p&gt;Fun fact: The term “scripting language” originates from the early days of computing when scripts were used to automate the execution of tasks on mainframe computers. One of the first scripting languages was JCL (Job Control Language), used in the 1960s to manage and automate job processing on IBM mainframes.&lt;/p&gt;

&lt;h1&gt;
  
  
  javascript #developemnt
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>learning</category>
      <category>development</category>
    </item>
  </channel>
</rss>
