<?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: ivangcode</title>
    <description>The latest articles on DEV Community by ivangcode (@ivangcode).</description>
    <link>https://dev.to/ivangcode</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%2F679370%2F71f9ecaa-9d9f-4c0f-8af5-fb0a701d3bdc.png</url>
      <title>DEV Community: ivangcode</title>
      <link>https://dev.to/ivangcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ivangcode"/>
    <language>en</language>
    <item>
      <title>TypeScript: Everything you need to know!</title>
      <dc:creator>ivangcode</dc:creator>
      <pubDate>Wed, 07 Jun 2023 20:53:19 +0000</pubDate>
      <link>https://dev.to/ivangcode/typescript-everything-you-need-to-know-3l8l</link>
      <guid>https://dev.to/ivangcode/typescript-everything-you-need-to-know-3l8l</guid>
      <description>&lt;p&gt;Welcome, friends!&lt;/p&gt;

&lt;p&gt;If you've ever worked with JavaScript or encountered it during technical interviews, you may have heard of TypeScript. In this blog post, we'll explore what TypeScript is, its advantages, and how you can leverage its features to write better and more reliable code. Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding TypeScript
&lt;/h2&gt;

&lt;p&gt;At its core, TypeScript is an extension of JavaScript that introduces static typing. It was developed by Microsoft to address scalability issues often encountered in large JavaScript codebases. By adding types to JavaScript, TypeScript enables developers to catch errors and ensure type correctness during development, leading to more robust and maintainable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Choose TypeScript?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Enhanced Productivity:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TypeScript provides tooling support and excellent editor integration, making it a joy to work with.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type Safety&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Static typing allows you to catch type-related errors at compile time, before executing your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring TypeScript Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Type Annotations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In TypeScript, you can explicitly declare variable types using type annotations. This helps TypeScript infer the expected type and provides early feedback in case of type mismatches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ivan&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, we declare the variable &lt;code&gt;myName&lt;/code&gt; as a string. If we attempt to assign a different data type to this variable, TypeScript will raise an error, highlighting the issue right in your editor.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functions and Type Definitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TypeScript allows you to define types for functions, making your code more self-documenting and ensuring type safety.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;CreatePerson&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;createPerson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CreatePerson&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ivan&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;createPerson&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`The following person has been created: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code snippet above, we define a type &lt;code&gt;CreatePerson&lt;/code&gt; for a function that takes a string argument and returns &lt;code&gt;void&lt;/code&gt;. This enhances code readability and enforces type correctness when calling the &lt;code&gt;createPerson&lt;/code&gt; function.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Advanced Type Features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;TypeScript offers a wide range of advanced type features, such as union types, intersection types, and mapped types. These features empower developers to create expressive and flexible types tailored to their specific needs.&lt;/p&gt;

&lt;p&gt;For example, you can create an intersection type to combine multiple types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;  
&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ivan&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the &lt;code&gt;Person&lt;/code&gt; type is created by combining the &lt;code&gt;Name&lt;/code&gt; and &lt;code&gt;Age&lt;/code&gt; types using the &lt;code&gt;&amp;amp;&lt;/code&gt; operator. This allows you to create rich and complex type definitions that accurately represent your data structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended Extensions
&lt;/h2&gt;

&lt;p&gt;To enhance your TypeScript development experience, here are a couple of recommended VSCode extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error Lens&lt;/strong&gt;: Provides inline error messages and visual enhancements for quick error detection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Prettier Errors&lt;/strong&gt;: Improves the display of TypeScript errors, making them more readable and informative.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've taken your first steps into the world of TypeScript. We've covered the basics, including what TypeScript is and its benefits. Remember, TypeScript is a powerful tool that brings static typing to JavaScript, enhancing productivity, code quality, and maintainability.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Do not forget to take a look at the TypeScript docs &lt;a href="https://www.typescriptlang.org/"&gt;TypeScript&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>development</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Resumen: Ten cuidado con lo que pides - "The Clean Coder"</title>
      <dc:creator>ivangcode</dc:creator>
      <pubDate>Sun, 20 Nov 2022 05:41:53 +0000</pubDate>
      <link>https://dev.to/ivangcode/resumen-ten-cuidado-con-lo-que-pides-the-clean-coder-4o27</link>
      <guid>https://dev.to/ivangcode/resumen-ten-cuidado-con-lo-que-pides-the-clean-coder-4o27</guid>
      <description>&lt;p&gt;Este es un breve resumen del libro de &lt;strong&gt;Robert C. Martin "The Clean Coder"&lt;/strong&gt;, para compartir los conocimientos y mi percepción de este gran libro. Espero lo disfrutes y aprendas algo nuevo hoy.&lt;/p&gt;

&lt;p&gt;😊 Let's do this!&lt;/p&gt;

&lt;p&gt;Es fácil ser un no-profesional, poco comprometido e irresponsable por las acciones que ejecutas en tu trabajo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;¿Cómo identificarlo?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aquí Robert nos da un ejemplo hipotético:&lt;br&gt;
Que pasaría si un programador comete un error que le cuesta a la compañía $10,000.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Un programador no-profesional diría: "Esas cosas pasan".&lt;/li&gt;
&lt;li&gt;Por el contrario uno comprometido, pagaría esa cantidad, Y sí. Se siente muy diferente cuando es tu propio dinero ¿verdad?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pues así es como se siente el profesionalismo, es siempre tener ese sentido de responsabilidad y no es nada fácil, por eso; &lt;strong&gt;Ten cuidado con lo que pides&lt;/strong&gt; y si decides hacerlo, sé un ejemplo de ello.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Resumen de Requisito Previo / Introducción de "The Clean Coder"</title>
      <dc:creator>ivangcode</dc:creator>
      <pubDate>Sun, 20 Nov 2022 05:25:50 +0000</pubDate>
      <link>https://dev.to/ivangcode/resumen-de-requisito-previo-introduccion-de-the-clean-coder-4i9c</link>
      <guid>https://dev.to/ivangcode/resumen-de-requisito-previo-introduccion-de-the-clean-coder-4i9c</guid>
      <description>&lt;p&gt;Este es un breve resumen del libro de &lt;strong&gt;Robert C. Martin "The Clean Coder"&lt;/strong&gt;, para compartir los conocimientos y mi percepción de este gran libro. Espero lo disfrutes y aprendas algo nuevo hoy.&lt;/p&gt;

&lt;p&gt;😊 Let's do this!&lt;/p&gt;

&lt;p&gt;En este capítulo el autor habla de varias experiencias que ha vivido como programador, todos sus errores y algunos logros, como un profesional debe actuar y que acciones debería evitar.&lt;/p&gt;

&lt;p&gt;Robert C. Martin trabajó para una empresa en donde el y sus compañeros desarrollaron un proyecto, dicho proyecto se terminó y los dueños no les dieron ni el 3% de las utilidades de este. Esto sin duda alguna lo provocó a el y sus compañeros, entonces ellos decidieron renunciar de una manera agresiva, insultando y gritando a su jefe.&lt;br&gt;
Robert quedó desempleado y no consiguió ningún empleo durante varios meses, entró en una "bajón" hasta que su madre le dijo que ya era hora de comer una gran rebanada de pastel de la humildad, es decir, pedir perdón por su comportamiento y suplicar a su ex jefe para regresar a su anterior empleo. &lt;br&gt;
Le hizo caso a su madre, le dieron su anterior empleo y pudo desarrollarse muy bien durante 8 meses más hasta que renunció y quedó en buenos términos con su ex empleador.&lt;/p&gt;

&lt;p&gt;Sin duda alguna aquí nos habla de lo importante que es el &lt;strong&gt;respeto&lt;/strong&gt; y la &lt;strong&gt;gratitud&lt;/strong&gt; de tener un empleo, a veces no recibimos la mejor gratificación, sin embargo, hay que agradecer siempre en donde es que estamos parados. También una gran lección es, tener un plan y evitar actuar de manera emocional, usar siempre la cabeza y analizar la mayor cantidad de opciones que tenemos.&lt;/p&gt;

&lt;p&gt;Sin duda alguna, una gran lección que Robert aprendió por las malas y gracias a su madre.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
