<?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: The Eagle 🦅</title>
    <description>The latest articles on DEV Community by The Eagle 🦅 (@raulpenate).</description>
    <link>https://dev.to/raulpenate</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%2F1448148%2Ff8b50751-bdf0-442f-b760-e67291a5d744.jpeg</url>
      <title>DEV Community: The Eagle 🦅</title>
      <link>https://dev.to/raulpenate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raulpenate"/>
    <language>en</language>
    <item>
      <title>Manual de supervivencia Git de Ned 📚</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Mon, 16 Sep 2024 14:06:02 +0000</pubDate>
      <link>https://dev.to/raulpenate/manual-de-supervivencia-de-git-de-ned-l3i</link>
      <guid>https://dev.to/raulpenate/manual-de-supervivencia-de-git-de-ned-l3i</guid>
      <description>&lt;h1&gt;
  
  
  Introducción
&lt;/h1&gt;

&lt;p&gt;¡Bienvenido a al Manual de supervivencia de Git de Ned! 📚 En este manual, aprenderás comandos esenciales de Git como &lt;code&gt;git checkout&lt;/code&gt; y &lt;code&gt;git restore&lt;/code&gt; para deshacer cambios, &lt;code&gt;git stash&lt;/code&gt; para guardar trabajo no commiteado temporalmente, &lt;code&gt;git cherry-pick&lt;/code&gt; para extraer commits específicos de una rama a otra y &lt;code&gt;git reflog&lt;/code&gt; para recuperar "commits perdidos". Ya sea que estés corrigiendo un error, cambiando prioridades porque tu jefe lo decidió, o restaurando código eliminado, estos comandos te ayudarán a manejar escenarios comunes con confianza. ¡Así que, adentrémonos y dominemos Git juntos!&lt;/p&gt;

&lt;p&gt;Esto es lo que aprenderemos hoy:&lt;/p&gt;




&lt;h2&gt;
  
  
  Índice 📋
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episodio 1: Primer Día de Trabajo y Errores&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Usando &lt;code&gt;git checkout&lt;/code&gt; para restaurar archivos de un commit anterior.&lt;/li&gt;
&lt;li&gt;Guardar cambios no commiteados con &lt;code&gt;git restore&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episodio 2: Tenemos una Nueva Prioridad, Houston&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cómo guardar archivos no rastreados con &lt;code&gt;git stash&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Gestionar stashes y recuperarlos cuando sea necesario.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episodio 3: ¡Crisis de CoolFeature!&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Usar &lt;code&gt;git cherry-pick&lt;/code&gt; para seleccionar y aplicar commits específicos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episodio 4: El Drama de "Cambié de Opinión"&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recuperar commits eliminados con &lt;code&gt;git reflog&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Conclusión&lt;/strong&gt;  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Episodio 1: Primer Día de Trabajo y Errores
&lt;/h1&gt;

&lt;p&gt;Supongamos que estamos construyendo una aplicación de mapas para tu lugar de trabajo, y tenemos la siguiente estructura de carpetas:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrb3d60jha1j4enh6xt6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrb3d60jha1j4enh6xt6.png" alt="Estructura de carpetas de React en Vite" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Refactorizamos nuestro archivo &lt;code&gt;main.tsx&lt;/code&gt; porque queremos que &lt;code&gt;MapsApp.tsx&lt;/code&gt; sea nuestro archivo principal de aplicación, pero accidentalmente introducimos un error.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ferzh1rc1l2n8estl51fc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ferzh1rc1l2n8estl51fc.png" alt="Commit con un error en main.tsx" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No nos damos cuenta y procedemos a hacer commit y push al repositorio remoto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsnlj10jio308dfonaz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsnlj10jio308dfonaz0.png" alt="Realizando el proceso de commit" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Por si tienes curiosidad, estoy usando &lt;a href="https://github.com/carloscuesta/gitmoji" rel="noopener noreferrer"&gt;gitmoji&lt;/a&gt; para mensajes de commit geniales.)&lt;/p&gt;

&lt;p&gt;Ahora, ejecutas tu proyecto y te das cuenta de que hay un error en &lt;code&gt;main.tsx&lt;/code&gt; porque la consola te lo dice, pero por alguna razón, no puedes encontrarlo—tal vez estás nervioso, así que...&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  ¿Qué puedo hacer para que no me regañen?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Consejo #1: Restaurar Archivos Salva Vidas
&lt;/h2&gt;

&lt;p&gt;En este escenario, para simplificar, supongamos que ya has hecho push del proyecto antes de la refactorización como buena práctica (de lo contrario, estás en problemas). Usas &lt;code&gt;git log&lt;/code&gt;, y te muestra lo siguiente:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg892gjnyo0goxr786tis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg892gjnyo0goxr786tis.png" alt="Git log" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dado que tienes un archivo anterior bueno, simplemente puedes usar &lt;code&gt;git log&lt;/code&gt; y seleccionar el &lt;em&gt;commit hash&lt;/em&gt; que deseas restaurar. En nuestro caso, es este:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fen2znknc72lcskis6fnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fen2znknc72lcskis6fnr.png" alt="Seleccionando el commit hash" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Luego, procede a escribir:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout 4d7490e src/main.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;¡Y lo has restaurado—tadaa!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6yb3nwyhrn3t85zkhry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6yb3nwyhrn3t85zkhry.png" alt="Archivo restaurado" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Oye, solo tengo un commit en mi proyecto, ¿puedo revertirlo?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Consejo #2: Usa &lt;code&gt;git restore&lt;/code&gt; para Cambios No commiteados
&lt;/h2&gt;

&lt;p&gt;Tienes los siguientes cambios no commiteados en &lt;code&gt;main.tsx&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbgoe2vuo9udkrt8mqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbgoe2vuo9udkrt8mqo.png" alt="Cambios no commiteados" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Puedes confirmar que están no commiteados con un &lt;code&gt;git status&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihemqxjbps1oxql89n3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihemqxjbps1oxql89n3i.png" alt="Git status" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Y tu &lt;code&gt;git log&lt;/code&gt; solo tiene el primer commit, donde creaste tu proyecto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvteqs34gx41nuarimzqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvteqs34gx41nuarimzqb.png" alt="Git log" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tienes dos opciones, una fácil y una difícil:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# La fácil&lt;/span&gt;
git restore src/main.tsx
&lt;span class="c"&gt;# La difícil&lt;/span&gt;
git checkout &lt;span class="nt"&gt;--&lt;/span&gt; src/main.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voy con &lt;code&gt;restore&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmqoxbrwdr9m4o84cfpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmqoxbrwdr9m4o84cfpq.png" alt="Archivo limpio" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;¡Ahora nuestro archivo está limpio de nuevo! ¡Hurra!&lt;/p&gt;




&lt;h1&gt;
  
  
  Episodio 2: Tenemos una Nueva Prioridad, Houston
&lt;/h1&gt;

&lt;p&gt;Ahora, tu jefe o líder de equipo decide que es un buen día para cambiar las prioridades (porque eso es lo suyo). Supongamos que estás creando una nueva página llamada &lt;code&gt;MyCoolPage.tsx&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fia6trt3ktg27fplb9nb9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fia6trt3ktg27fplb9nb9.png" alt="Creando MyCoolPage.tsx" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahora, tienes que decidir: &lt;em&gt;¿Debería hacer commit y luego rebasear los commits, seleccionar los que quiero y hacer squash para que quede limpio?&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Voy a perder demasiado tiempo solo para ese cambio más adelante, ¿Qué puedo hacer?
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Consejo #3: Guárdalo, Hermano
&lt;/h2&gt;

&lt;p&gt;¡Ten cuidado en este caso! Este ejemplo especial implica la creación de un nuevo archivo que no existe en tu repositorio, así que necesitas usar:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash &lt;span class="nt"&gt;--include-untracked&lt;/span&gt;
&lt;span class="c"&gt;# O la bandera más corta&lt;/span&gt;
git stash &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ahora, puedes ver que el archivo ya no está con nosotros:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4pf8fn49mxl3hj9ux3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4pf8fn49mxl3hj9ux3l.png" alt="Archivo guardado en stash" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pero si escribes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Todavía está aquí:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s82o3ezmpa5waehxpha.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s82o3ezmpa5waehxpha.png" alt="Lista de stashes" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;El nombre del stash es &lt;code&gt;stash@{0}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Ahora, tenemos múltiples opciones:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Podemos extraer el stash y eliminarlo de la lista con un simple&lt;/span&gt;
git stash pop
&lt;span class="c"&gt;# O aplicarlo y dejarlo en la lista para que podamos acceder a él más tarde con&lt;/span&gt;
git stash apply stash@&lt;span class="o"&gt;{&lt;/span&gt;número de tu stash&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voy con &lt;code&gt;pop&lt;/code&gt;, y puedes ver que ha vuelto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx22x6x2az90ftakop2bp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx22x6x2az90ftakop2bp.png" alt="Archivo extraído del stash" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cuando intento usar &lt;code&gt;git stash list&lt;/code&gt;, no muestra nada porque al final fue extraído de la lista:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84m4s91gk37g4eecvxz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84m4s91gk37g4eecvxz0.png" alt="Lista de stash vacía" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Episodio 3: ¡Crisis de CoolFeature!
&lt;/h1&gt;

&lt;p&gt;Estás trabajando en una rama diferente para una característica llamada &lt;code&gt;feature/myCoolFeature&lt;/code&gt;, que tiene tres requisitos. Ya has completado dos de ellos, así que tienes dos commits en esa rama.&lt;/p&gt;

&lt;p&gt;Ahora, tu jefe te dice: &lt;em&gt;Oye, necesitamos la &lt;code&gt;CoolFeature&lt;/code&gt; que implementaste desde tu rama, pero solo la primera, ¡y la necesitamos ahora!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zib1nqh3ygxod87h79e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zib1nqh3ygxod87h79e.png" alt="Solicitud urgente" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Podrías crear una rama desde la actual, eliminar el commit HEAD y fusionarlo en &lt;code&gt;main&lt;/code&gt;, pero eso es demasiado para una tarea tan simple.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Oh, hombre, necesito tiempo para esto y ellos lo necesitan ahora, ¿hay una forma más rápida?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Consejo #4: Usa Cherry-Pick para Obtener Ese Commit
&lt;/h2&gt;

&lt;p&gt;Ve a tu rama &lt;code&gt;main&lt;/code&gt; con &lt;code&gt;git checkout main&lt;/code&gt; y obtén el log de la otra rama con:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log feature/myCoolFeature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Luego, selecciona el commit específico:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick 714cf87
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zwxb43zbjv4f38u3ezd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zwxb43zbjv4f38u3ezd.png" alt="Cherry-picking el commit" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;¡Y Linus Torvalds (creador de Git y Linux) salva el día de nuevo! Y si usas &lt;code&gt;git log&lt;/code&gt;, puedes ver que tus cambios están allí:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2378ngae2qmi7bp6ad6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2378ngae2qmi7bp6ad6z.png" alt="Git log de main" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Episodio 4: El Drama de "Cambié de Opinión"
&lt;/h1&gt;

&lt;p&gt;Supongamos que creaste una nueva característica:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w4ww5kh0i9ntgpcm5lz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w4ww5kh0i9ntgpcm5lz.png" alt="feature" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;La agregas y haces&lt;/p&gt;

&lt;p&gt;commit, pero cambias de opinión y decides eliminarla, así que procedes a buscar en Google &lt;code&gt;cómo eliminar un commit&lt;/code&gt;. Encuentras que con un &lt;code&gt;git reset --hard HEAD~1&lt;/code&gt;, procedes a usarlo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhadzci5as6qzsnivfwn2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhadzci5as6qzsnivfwn2.png" alt="Git reset" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Estás bien hasta que te das cuenta de que quieres reutilizar algo de código, pero ahora cuando usas &lt;code&gt;git log&lt;/code&gt;, no puedes encontrarlo. Piensas:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Se ha ido para siempre, ahora voy a perder tiempo...
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Consejo #5: Si No Lo Encuentras en &lt;code&gt;git log&lt;/code&gt;, Es Hora de &lt;code&gt;reflog&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Solo revisa la magia de este comando:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vt8zh99zhe86k9e5m4j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vt8zh99zhe86k9e5m4j.png" alt="Reflog" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahora tienes el hash para restaurar tu commit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ryq622d9fwspypuz1a5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ryq622d9fwspypuz1a5.png" alt="Restaurar" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;¡Otro final feliz!&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusión 🎓
&lt;/h1&gt;

&lt;p&gt;¡Felicidades, has aprobado tu manual de supervivencia Git! 🎉 Al igual que el manual de supervivencia Escolar de Ned 📚, ahora tienes un buen conjunto de herramientas para navegar por los complicados pasillos del control de versiones. Desde usar &lt;code&gt;git checkout&lt;/code&gt; para corregir esos errores accidentales, guardar cambios no commiteados como un profesional, hacer cherry-pick de commits cuando la presión es alta, hasta rescatar trabajos perdidos con &lt;code&gt;git reflog&lt;/code&gt;, estás listo para enfrentar cualquier desafío de Git con confianza. Así que, pon en práctica estos consejos y mantén tus proyectos funcionando sin problemas.&lt;/p&gt;




&lt;p&gt;Agradecimientos especiales a &lt;a href="https://www.youtube.com/c/midudev" rel="noopener noreferrer"&gt;Midu&lt;/a&gt; sin su &lt;a href="https://leanpub.com/aprendiendo-git" rel="noopener noreferrer"&gt;libro de Git&lt;/a&gt;, no habría podido hacer este artículo. 🙏💻✨&lt;/p&gt;




&lt;p&gt;¡Gracias por leer!&lt;/p&gt;

&lt;p&gt;Déjame saber herman@, tus pensamientos o cualquier sugerencia sobre Git en los comentarios abajo 👇&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>learning</category>
      <category>spanish</category>
    </item>
    <item>
      <title>Ned's Declassified Git Survival Guide 📚</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Fri, 13 Sep 2024 22:20:21 +0000</pubDate>
      <link>https://dev.to/raulpenate/neds-declassified-git-survival-guide-4p9e</link>
      <guid>https://dev.to/raulpenate/neds-declassified-git-survival-guide-4p9e</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Welcome to Ned's Declassified Git Survival Guide! 📚 In this guide, you'll learn essential Git commands like &lt;code&gt;git checkout&lt;/code&gt; and &lt;code&gt;git restore&lt;/code&gt; to undo changes, &lt;code&gt;git stash&lt;/code&gt; to save uncommitted work temporarily, &lt;code&gt;git cherry-pick&lt;/code&gt;🍒 to pull specific commits from one branch to another, and &lt;code&gt;git reflog&lt;/code&gt; to recover "lost commits". Whether you're fixing a bug 🐞, changing priorities because your manager decided that, or restoring deleted code, these commands will help you handle common real-case scenarios with confidence 💪. So, let’s dive in and master Git together!&lt;/p&gt;

&lt;p&gt;This is what we'll learn today:&lt;/p&gt;




&lt;h2&gt;
  
  
  Index 📋
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episode 1: First Day of Work &amp;amp; Bugs&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;git checkout&lt;/code&gt; to restore files from a previous commit.&lt;/li&gt;
&lt;li&gt;Saving uncommitted changes with &lt;code&gt;git restore&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episode 2: We've Got a New Priority, Houston&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to stash untracked files with &lt;code&gt;git stash&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Managing stashes and retrieving them when needed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episode 3: The CoolFeature Crisis!&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;git cherry-pick&lt;/code&gt; to select and apply specific commits.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Episode 4: I Changed My Mind Drama&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recovering deleted commits with &lt;code&gt;git reflog&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Episode 1: First Day of Work &amp;amp; Bugs
&lt;/h1&gt;

&lt;p&gt;Let's say we're building a Map Application for your workplace, and we have the following folder structure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrb3d60jha1j4enh6xt6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrb3d60jha1j4enh6xt6.png" alt="Folder structure of React in Vite" width="287" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We refactor our &lt;code&gt;main.tsx&lt;/code&gt; file because we want &lt;code&gt;MapsApp.tsx&lt;/code&gt; to be our main application file, but we accidentally introduce a bug.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ferzh1rc1l2n8estl51fc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ferzh1rc1l2n8estl51fc.png" alt="Commit with a bug in main.tsx" width="628" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We don't realize it and proceed to commit and push it to the remote repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsnlj10jio308dfonaz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzsnlj10jio308dfonaz0.png" alt="Doing the commit process" width="634" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(In case you're curious, I'm using &lt;a href="https://github.com/carloscuesta/gitmoji" rel="noopener noreferrer"&gt;gitmoji&lt;/a&gt; for cool commit messages.)&lt;/p&gt;

&lt;p&gt;Now, you run your project and realize there's a bug in &lt;code&gt;main.tsx&lt;/code&gt; because the console tells you, but for some reason, you can't find it—maybe you're nervous, so...&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  What can I do so I don't get yelled at?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Advice #1: Restoring Files Saves Lives
&lt;/h2&gt;

&lt;p&gt;In this scenario, for simplicity, let's say you've already pushed the project before the refactor as a good practice (otherwise, you're in trouble). You use &lt;code&gt;git log&lt;/code&gt;, and it shows you the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg892gjnyo0goxr786tis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg892gjnyo0goxr786tis.png" alt="Git log" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since you have a previous good file, you can simply use &lt;code&gt;git log&lt;/code&gt; and select the &lt;em&gt;commit hash&lt;/em&gt; that you want to restore. In our case, it's this one:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fen2znknc72lcskis6fnr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fen2znknc72lcskis6fnr.png" alt="Selecting the commit hash" width="659" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, proceed to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout 4d7490e src/main.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you've restored it—tadaa!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6yb3nwyhrn3t85zkhry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6yb3nwyhrn3t85zkhry.png" alt="Restored file" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Hey, I've only got one commit in my project, can I reverse that?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Advice #2: Use &lt;code&gt;git restore&lt;/code&gt; for Uncommitted Changes
&lt;/h2&gt;

&lt;p&gt;You have the following uncommitted changes in &lt;code&gt;main.tsx&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbgoe2vuo9udkrt8mqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdbgoe2vuo9udkrt8mqo.png" alt="Uncommitted changes" width="611" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can confirm they are uncommitted with a &lt;code&gt;git status&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihemqxjbps1oxql89n3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihemqxjbps1oxql89n3i.png" alt="Git status" width="759" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And your &lt;code&gt;git log&lt;/code&gt; only has the first commit, where you created your project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvteqs34gx41nuarimzqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvteqs34gx41nuarimzqb.png" alt="Git log" width="663" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You have two options, one easy and one hard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Easy one&lt;/span&gt;
git restore src/main.tsx
&lt;span class="c"&gt;# Hard one&lt;/span&gt;
git checkout &lt;span class="nt"&gt;--&lt;/span&gt; src/main.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll go with &lt;code&gt;restore&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmqoxbrwdr9m4o84cfpq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmqoxbrwdr9m4o84cfpq.png" alt="Clean file" width="658" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now our file is clean again! Hooray!&lt;/p&gt;




&lt;h1&gt;
  
  
  Episode 2: Hey, We've Got a New Priority, Houston
&lt;/h1&gt;

&lt;p&gt;Now, your manager or team leader decides it's a good day to change priorities (because that’s their thing). Let's say you're creating a new page called &lt;code&gt;MyCoolPage.tsx&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fia6trt3ktg27fplb9nb9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fia6trt3ktg27fplb9nb9.png" alt="Creating MyCoolPage.tsx" width="296" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you have to decide: &lt;em&gt;Should I commit this and then rebase the commits, pick the ones I want, and squash them to make it clean?&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  I'm Going to Spend Too Much Time Just for That Change Later On, What Can I Do?
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Advice #3: Stash It, Bro
&lt;/h2&gt;

&lt;p&gt;Be careful in this case! This special example involves creating a new file that doesn't exist in your repository, so you need to use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash &lt;span class="nt"&gt;--include-untracked&lt;/span&gt;
&lt;span class="c"&gt;# Or the shorter flag&lt;/span&gt;
git stash &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can see the file is no longer with us:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4pf8fn49mxl3hj9ux3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4pf8fn49mxl3hj9ux3l.png" alt="File stashed" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if you write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's still here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s82o3ezmpa5waehxpha.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s82o3ezmpa5waehxpha.png" alt="Stash list" width="718" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The name of the stash is &lt;code&gt;stash@{0}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, we've got multiple options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# We can pop the stash and remove it from the list with a simple&lt;/span&gt;
git stash pop
&lt;span class="c"&gt;# Or apply it and let it stay in the list so we can access it later with&lt;/span&gt;
git stash apply stash@&lt;span class="o"&gt;{&lt;/span&gt;number of your stash&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll go with &lt;code&gt;pop&lt;/code&gt;, and you can see it's back:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx22x6x2az90ftakop2bp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx22x6x2az90ftakop2bp.png" alt="File popped from stash" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I try to use &lt;code&gt;git stash list&lt;/code&gt;, nothing shows up because it ultimatewas popped from the list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84m4s91gk37g4eecvxz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84m4s91gk37g4eecvxz0.png" alt="Empty stash list" width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Episode 3: The CoolFeature Crisis!
&lt;/h1&gt;

&lt;p&gt;You're working in a different branch for a feature called &lt;code&gt;feature/myCoolFeature&lt;/code&gt;, which has three requirements. You've already completed two of them, so you have two commits in that branch.&lt;/p&gt;

&lt;p&gt;Now, your manager tells you: &lt;em&gt;Hey, we need the &lt;code&gt;CoolFeature&lt;/code&gt; you implemented from your branch, but only the first one, and we need it now!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zib1nqh3ygxod87h79e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zib1nqh3ygxod87h79e.png" alt="Urgent request" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You could create a branch from your current one, delete the HEAD commit, and merge it into &lt;code&gt;main&lt;/code&gt;, but that’s too much for such a simple task.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  Oh man, I need time for this and they need it now, is there a faster way?
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Advice #4: Use Cherry-Pick to Get That Commit
&lt;/h2&gt;

&lt;p&gt;GitSurvivalGuide&lt;br&gt;
Go to your &lt;code&gt;main&lt;/code&gt; branch with &lt;code&gt;git checkout main&lt;/code&gt; and get the log from the other branch with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log feature/myCoolFeature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, cherry-pick the specific commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick 714cf87
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zwxb43zbjv4f38u3ezd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zwxb43zbjv4f38u3ezd.png" alt="Cherry-picking the commit" width="738" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And Linus Torvalds (creator of Git &amp;amp; Linux) saves the day again! And if you use &lt;code&gt;git log&lt;/code&gt;, you can see your changes are there:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2378ngae2qmi7bp6ad6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2378ngae2qmi7bp6ad6z.png" alt="Git log of main" width="649" height="538"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Episode 4: The “I Changed My Mind” Drama
&lt;/h1&gt;

&lt;p&gt;Let's say you created a new feature:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w4ww5kh0i9ntgpcm5lz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8w4ww5kh0i9ntgpcm5lz.png" alt="feature" width="294" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You add and commit it, but you change your mind and decide to delete it, so you proceed to Google and search &lt;code&gt;how to delete a commit&lt;/code&gt;. You find that with a &lt;code&gt;git reset --hard HEAD~1&lt;/code&gt;, you proceed to use it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhadzci5as6qzsnivfwn2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhadzci5as6qzsnivfwn2.png" alt="Git reset" width="610" height="51"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You're fine until you realize that you want to reuse some code, but now when you use &lt;code&gt;git log&lt;/code&gt;, you can't find it. You think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  It's gone forever, now I'm going to waste time...
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Advice #5: If You Can't Find It in &lt;code&gt;git log&lt;/code&gt;, It's Time to &lt;code&gt;reflog&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Just check the magic of this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reflog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vt8zh99zhe86k9e5m4j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vt8zh99zhe86k9e5m4j.png" alt="Reflog" width="622" height="65"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you've got the hash to restore your commit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ryq622d9fwspypuz1a5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ryq622d9fwspypuz1a5.png" alt="Reset" width="665" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another happy ending!&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion 🎓
&lt;/h1&gt;

&lt;p&gt;Congrats dawg, you've just aced your Git survival guide! 🎉 Just like Ned’s Declassified School Survival Guide 📚, you now have a nice toolkit to navigate the tricky hallways of version control. From using &lt;code&gt;git checkout&lt;/code&gt; to fix those accidental missteps, stashing away uncommitted changes like a pro, cherry-picking commits when the pressure's on, to rescuing lost work with &lt;code&gt;git reflog&lt;/code&gt;, you're set to tackle any Git challenge with confidence. 📚🛠️ So, put these tips into practice and keep your projects running smoothly.&lt;/p&gt;




&lt;p&gt;Special thanks to &lt;a href="https://www.youtube.com/c/midudev" rel="noopener noreferrer"&gt;Midu&lt;/a&gt; without his &lt;a href="https://leanpub.com/aprendiendo-git" rel="noopener noreferrer"&gt;Git book&lt;/a&gt;, I wouldn't have made this article. 🙏💻✨&lt;/p&gt;




&lt;p&gt;Thank you for reading!&lt;/p&gt;

&lt;p&gt;Let me know, dawg, your thoughts or any suggestions about Git in the comments down below 👇&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>gitsurvivalguide</category>
    </item>
    <item>
      <title>Clean Code vs Mejores Prácticas: ¿Cuál es la Diferencia?</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Sun, 08 Sep 2024 11:58:04 +0000</pubDate>
      <link>https://dev.to/raulpenate/clean-code-vs-mejores-practicas-cual-es-la-diferencia-1im9</link>
      <guid>https://dev.to/raulpenate/clean-code-vs-mejores-practicas-cual-es-la-diferencia-1im9</guid>
      <description>&lt;p&gt;En el desarrollo de software, "Clean Code" y "Mejores Prácticas" son dos conceptos importantes. A veces podrías escuchar comentarios como "Buen trabajo, tu código se ve limpio" o "Aplica mejores prácticas para evitar la deuda técnica la próxima vez". Aunque se superponen, cada uno juega un papel único en la creación de software de alta calidad y mantenible. Vamos a desglosar lo que significa cada término, explorar algunos ejemplos ilustrativos y ver cómo difieren.&lt;/p&gt;

&lt;h3&gt;
  
  
  ¿Qué es "Clean Code"? 📚
&lt;/h3&gt;

&lt;p&gt;"Clean Code" es un libro de Robert C. Martin (Uncle Bob) que proporciona directrices para escribir código que sea fácil de leer, entender y mantener. Aquí hay ocho principios clave que debes conocer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Nombres Significativos&lt;/strong&gt;: Los nombres deben describir claramente lo que hace una variable, función o clase.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: En lugar de &lt;code&gt;x&lt;/code&gt;, usa &lt;code&gt;userAge&lt;/code&gt; si representa la edad de un usuario, y en lugar de &lt;code&gt;calculate&lt;/code&gt;, escribe lo que calcula la función.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Malo&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&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="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Bueno&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateUserAgeInMonths&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userAge&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="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;userAge&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&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;&lt;strong&gt;2. Regla del Boy Scout&lt;/strong&gt;: Deja el código mejor de lo que lo encontraste. Refactoriza y mejora a medida que avanzas.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Si corriges un error y ves código desordenado, límpialo antes de hacer el commit.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Antes&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&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="kr"&gt;any&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getDataFromDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Después&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&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="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;getDataFromDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;user&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;&lt;strong&gt;3. Reducir el Acoplamiento&lt;/strong&gt;: Minimiza las dependencias entre clases para hacer tu base de código más modular.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Usa inyección de dependencias en lugar de codificar las dependencias directamente.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Malo&lt;/span&gt;
   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Bueno&lt;/span&gt;
   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&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;&lt;strong&gt;4. Sé el Autor&lt;/strong&gt;: Escribe código como si contaras una historia. Las funciones deben ser pequeñas y enfocadas.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Piensa en ello como hacer un batido. En lugar de una función gigante que elige frutas, mezcla y sirve, divídela en funciones más pequeñas y enfocadas.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Antes&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeSmoothie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Choosing &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Blending &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; with &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;liquid&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Pouring the smoothie into a glass`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Después&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;chooseFruit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Choosing &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;blend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Blending &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; with &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;liquid&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pourIntoGlass&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Pouring the smoothie into a glass`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeSmoothie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;chooseFruit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nf"&gt;blend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;liquid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nf"&gt;pourIntoGlass&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;&lt;strong&gt;5. DRY (No te Repitas)&lt;/strong&gt;: Evita duplicar código creando componentes reutilizables.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Crea una función auxiliar en lugar de copiar y pegar bloques de código.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Antes&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeDogSound&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="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The dog says: Woof!&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeCatSound&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="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The cat says: Meow!&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="c1"&gt;// Después&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animal&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="nx"&gt;sound&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="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`The &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; says: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sound&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeDogSound&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dog&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Woof&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeCatSound&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Meow&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Comentarios&lt;/strong&gt;: Comenta solo cuando sea necesario y evita explicaciones obvias.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: En lugar de &lt;code&gt;// Increase salary by 10%&lt;/code&gt;, nombra tu función &lt;code&gt;increaseSalaryByPercentage(10)&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Antes&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increaseSalary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="c1"&gt;// Increase salary by 10%&lt;/span&gt;
       &lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;1.10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Después&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increaseSalaryByPercentage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;percentage&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="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&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;&lt;strong&gt;7. Manejo de Errores&lt;/strong&gt;: Maneja los errores de manera clara e inmediata, con mensajes específicos.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Si un archivo no se puede abrir, lanza una excepción con un mensaje sobre la ruta del archivo y el error.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Antes&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="kr"&gt;string&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;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Después&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&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="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Failed to open file &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Pruebas Limpias&lt;/strong&gt;: Asegúrate de que tus pruebas sean rápidas, independientes, repetibles, auto-validables y oportunas.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Escribe pruebas unitarias que se concentren en un aspecto de la funcionalidad a la vez.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Ejemplo de prueba para una función&lt;/span&gt;
   &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;calculateCircleArea&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should correctly calculate the area of a circle&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;calculateCircleArea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeCloseTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;78.54&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;calculateCylinderArea&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should correctly calculate the area of a cylinder&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;calculateCylinderArea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeCloseTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;471.23&lt;/span&gt;&lt;span class="p"&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;h3&gt;
  
  
  ¿Qué son las "Mejores Prácticas"? 🛠️
&lt;/h3&gt;

&lt;p&gt;Las "Mejores Prácticas" son métodos y técnicas probados para mejorar diversos aspectos del desarrollo de software. Aquí hay seis ejemplos clave que también deberías conocer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Pruebas de Código&lt;/strong&gt;: Prueba tu código regularmente para detectar errores temprano.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Usa herramientas como Jest para JavaScript o JUnit para Java para automatizar tus pruebas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Legibilidad&lt;/strong&gt;: Escribe código que sea fácil de leer y entender.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Usa convenciones de nombres consistentes y una clara indentación.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Arquitectura&lt;/strong&gt;: Diseña tu software con una estructura clara.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Aplica patrones como MVC (Modelo-Vista-Controlador) para separar preocupaciones.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Patrones de Diseño&lt;/strong&gt;: Usa patrones establecidos para resolver problemas comunes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: El patrón Singleton asegura que una clase tenga solo una instancia, lo que lo hace ideal para mantener una conexión de base de datos única y eficiente en toda la aplicación. Te dejo un ejemplo en caso de que tengas curiosidad sobre este patrón.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Ejemplo con PostgreSQL&lt;/span&gt;

   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DatabaseConnection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="c1"&gt;// Constructor privado para evitar instanciación directa&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
               &lt;span class="na"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="p"&gt;});&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="c1"&gt;// Método estático para obtener la única instancia de la clase&lt;/span&gt;
       &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
               &lt;span class="c1"&gt;// Crear la instancia si no existe&lt;/span&gt;
               &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
           &lt;span class="p"&gt;}&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&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="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;[]):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Ejemplo de uso de la conexión a base de datos singleton&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Obtener la única instancia de la conexión a base de datos&lt;/span&gt;
   &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SELECT * FROM users WHERE id = $1&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Database query error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Sistemas de Control de Versiones (VCS)&lt;/strong&gt;: Gestiona los cambios de código con herramientas como Git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Sigue los principios ACID para commits: Atomicidad, Consistencia, Aislamiento y Durabilidad.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. DRY y KISS&lt;/strong&gt;: Aplica Don’t Repeat Yourself (DRY) y Keep It Simple and Stupid (KISS).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ejemplo&lt;/strong&gt;: Simplifica funciones complejas y evita el código redundante.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Diferencias Clave 🔍
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alcance&lt;/strong&gt;: "Clean Code" se enfoca en escribir código limpio y mantenible. En contraste, las "Mej&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ores Prácticas" abarcan una gama más amplia de técnicas y estrategias para diversos aspectos del desarrollo de software.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Aplicación&lt;/strong&gt;: "Clean Code" proporciona directrices específicas para mejorar la calidad del código, mientras que las "Mejores Prácticas" ofrecen un enfoque más integral para mejorar la efectividad general del proyecto.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusión 🎯
&lt;/h3&gt;

&lt;p&gt;"Clean Code" es una parte crucial de las Mejores Prácticas, enfocándose en crear código legible y mantenible. Las Mejores Prácticas, por otro lado, abarcan una amplia gama de técnicas para mejorar diferentes aspectos del desarrollo de software. Usar ambos puede mejorar significativamente la calidad y eficiencia de tus proyectos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;¿Cuáles son tus mejores prácticas favoritas para escribir código limpio y gestionar proyectos? Comparte tus consejos y experiencias a continuación—¡ayudémonos mutuamente a evitar esos "dolores de cabeza" y "WTFs" en nuestros viajes de desarrollo!&lt;/strong&gt; 💬&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>programming</category>
      <category>spanish</category>
    </item>
    <item>
      <title>Clean Code vs Best Practices: What’s the Difference?</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Sun, 08 Sep 2024 11:55:40 +0000</pubDate>
      <link>https://dev.to/raulpenate/difference-of-clean-code-vs-best-practices-13lf</link>
      <guid>https://dev.to/raulpenate/difference-of-clean-code-vs-best-practices-13lf</guid>
      <description>&lt;p&gt;In software development, "Clean Code" and "Best Practices" are two important concepts. Sometimes you might hear comments like "Good job buddy, your code looks clean" or "Apply best practices to avoid technical debt next time bro." Although they overlap, they each play unique roles in creating high-quality, maintainable software. Let’s break down what each term means, explore some illustrative examples, and see how they differ.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is "Clean Code"? 📚
&lt;/h3&gt;

&lt;p&gt;"Clean Code" is a book by Robert C. Martin (Uncle Bob) that provides guidelines for writing code that's easy to read, understand, and maintain. Here are eight key principles that you should know:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Meaningful Names&lt;/strong&gt;: Names should clearly describe what a variable, function, or class does.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Instead of &lt;code&gt;x&lt;/code&gt;, use &lt;code&gt;userAge&lt;/code&gt; if it represents a user’s age, and instead of &lt;code&gt;calculate&lt;/code&gt;, write what the function calculates.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Bad&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&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="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Good&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateUserAgeInMonths&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userAge&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="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;userAge&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&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;&lt;strong&gt;2. Boy Scout Rule&lt;/strong&gt;: Leave the code better than you found it. Refactor and improve as you go.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: If you fix a bug and see messy code, clean it up before committing changes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Before&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&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="kr"&gt;any&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getDataFromDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// After&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchUserData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&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="nx"&gt;User&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;getDataFromDatabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;user&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;&lt;strong&gt;3. Reduce Coupling&lt;/strong&gt;: Minimize dependencies between classes to make your codebase more modular.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Use dependency injection instead of hard-coding dependencies.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Bad&lt;/span&gt;
   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Good&lt;/span&gt;
   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UserService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;database&lt;/span&gt;&lt;span class="p"&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;&lt;strong&gt;4. Be the Author&lt;/strong&gt;: Write code as if telling a story. Functions should be small and focused.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Think of it like making a smoothie. Instead of one giant function that picks fruit, blends, and pours, split it into smaller, focused functions.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Before&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeSmoothie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Choosing &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Blending &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; with &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;liquid&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Pouring the smoothie into a glass`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// After&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;chooseFruit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Choosing &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;blend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Blending &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; with &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;liquid&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pourIntoGlass&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="k"&gt;void&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Pouring the smoothie into a glass`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeSmoothie&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&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="nx"&gt;liquid&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="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;chooseFruit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nf"&gt;blend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;liquid&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="nf"&gt;pourIntoGlass&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;&lt;strong&gt;5. DRY (Don’t Repeat Yourself)&lt;/strong&gt;: Avoid duplicating code by creating reusable components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Create a helper function instead of copying and pasting code blocks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Before&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeDogSound&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="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The dog says: Woof!&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeCatSound&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="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The cat says: Meow!&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="c1"&gt;// After&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animal&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="nx"&gt;sound&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="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`The &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; says: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sound&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;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeDogSound&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dog&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Woof&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeCatSound&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;makeAnimalSound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Meow&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Commenting&lt;/strong&gt;: Comment only when necessary and avoid obvious explanations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Instead of &lt;code&gt;// Increase salary by 10%&lt;/code&gt;, name your function &lt;code&gt;increaseSalaryByPercentage(10)&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Before&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increaseSalary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="c1"&gt;// Increase salary by 10%&lt;/span&gt;
       &lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;1.10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// After&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increaseSalaryByPercentage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Employee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;percentage&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="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;employee&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;salary&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;percentage&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&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;&lt;strong&gt;7. Error Handling&lt;/strong&gt;: Handle errors clearly and immediately, with specific messages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: If a file can’t be opened, throw an exception with a message about the file path and error.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Before&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="kr"&gt;string&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;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// After&lt;/span&gt;
   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&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="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Failed to open file &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;filePath&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="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. Clean Testing&lt;/strong&gt;: Ensure your tests are fast, independent, repeatable, self-validating, and timely.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Write unit tests that focus on one aspect of functionality at a time.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="c1"&gt;// Test example for a function&lt;/span&gt;
   &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;calculateCircleArea&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should correctly calculate the area of a circle&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;calculateCircleArea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeCloseTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;78.54&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;calculateCylinderArea&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should correctly calculate the area of a cylinder&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;calculateCylinderArea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBeCloseTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;471.23&lt;/span&gt;&lt;span class="p"&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;h3&gt;
  
  
  What are "Best Practices"? 🛠️
&lt;/h3&gt;

&lt;p&gt;"Best Practices" are proven methods and techniques to improve various aspects of software development. Here are six key examples that you should also know:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Code Testing&lt;/strong&gt;: Regularly test your code to catch bugs early.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Use tools like Jest for JavaScript or JUnit for Java to automate your tests.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Readability&lt;/strong&gt;: Write code that is easy to read and understand.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Use consistent naming conventions and clear indentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Architecture&lt;/strong&gt;: Design your software with a clear structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Apply patterns like MVC (Model-View-Controller) to separate concerns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Design Patterns&lt;/strong&gt;: Use established patterns to solve common problems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: The Singleton pattern ensures a class has only one instance, making it ideal for maintaining a single, efficient database connection throughout the application. I'll leave an example in case you're curious about this pattern.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;   &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pg&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Example with PostgreSQL&lt;/span&gt;

   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DatabaseConnection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="c1"&gt;// Private constructor to prevent direct instantiation&lt;/span&gt;
       &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
               &lt;span class="na"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DATABASE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="p"&gt;});&lt;/span&gt;
           &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="c1"&gt;// Static method to get the single instance of the class&lt;/span&gt;
       &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
               &lt;span class="c1"&gt;// Create instance if it does not exist&lt;/span&gt;
               &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
           &lt;span class="p"&gt;}&lt;/span&gt;
           &lt;span class="c1"&gt;// Return the single instance if it does exist&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;

       &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&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="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;[]):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// Usage example of the singleton database connection&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;DatabaseConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getInstance&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Get the single instance of the database connection&lt;/span&gt;
   &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SELECT * FROM users WHERE id = $1&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
       &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Database query error:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Version Control Systems (VCS)&lt;/strong&gt;: Manage code changes with tools like Git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Follow ACID principles for commits: Atomicity, Consistency, Isolation, and Durability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. DRY and KISS&lt;/strong&gt;: Apply Don’t Repeat Yourself (DRY) and Keep It Simple and Stupid (KISS) principles.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Simplify complex functions and avoid redundant code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key Differences 🔍
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scope&lt;/strong&gt;: "Clean Code" focuses on writing clean, maintainable code. In contrast, "Best Practices" encompass a broader range of techniques and strategies for various aspects of software development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application&lt;/strong&gt;: "Clean Code" provides specific guidelines for improving code quality, while "Best Practices" offers a more comprehensive approach to enhancing overall project effectiveness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion 🎯
&lt;/h3&gt;

&lt;p&gt;"Clean Code" is a crucial part of Best Practices, focusing on creating readable and maintainable code. Best Practices, on the other hand, encompass a wide range of techniques for improving different aspects of software development. Using both can significantly enhance the quality and efficiency of your projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are your favorite best practices for writing clean code and managing projects? Share your tips and experiences below—let’s help each other avoid those "painful headaches" and "WTFs" in our development journeys!&lt;/strong&gt; 💬&lt;/p&gt;

</description>
      <category>cleancoding</category>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Encontrando Tu Propio Camino</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Thu, 29 Aug 2024 10:58:31 +0000</pubDate>
      <link>https://dev.to/raulpenate/encontrando-tu-propio-camino-2p4f</link>
      <guid>https://dev.to/raulpenate/encontrando-tu-propio-camino-2p4f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Érase una vez en un bosque vibrante 🌳, una joven cierva llamada Liora se encontraba preocupada por una serie de desafíos que no podía superar 😔. En busca de sabiduría, decidió consultar a las criaturas más formidables que conocía: el tigre 🐅, el águila 🦅 y el pez 🐟.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  La Valentía del Tigre
&lt;/h2&gt;

&lt;p&gt;Primero, Liora se acercó al tigre, un símbolo de fuerza y coraje 💪🦁.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Tigre poderoso,"&lt;/strong&gt; comenzó, &lt;strong&gt;"¿cómo puedo superar estos obstáculos que se interponen en mi camino?"&lt;/strong&gt; 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El tigre, con su mirada penetrante 👁️, respondió:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Puedo mostrarte el poder de la valentía y la fuerza."&lt;/strong&gt; 💥&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora intentó imitar la valentía del tigre, enfrentando sus desafíos con feroz determinación 💪. Pero, por más que lo intentaba, no podía superarlos. Frustrada 😤, regresó al tigre y preguntó:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"¿Por qué fallé al seguir tu consejo?"&lt;/strong&gt; 🤷‍♀️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El tigre respondió con calma:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Porque, Liora, mi fuerza nace de una vida de batallas en la jungla 🌿. Tu fuerza viene de tu corazón ❤️, no de tus garras. Mi camino nunca fue hecho para ti."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  La Perspectiva del Águila
&lt;/h2&gt;

&lt;p&gt;Luego, Liora subió al alto posadero del águila 🦅.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Gran águila, ¿cómo puedo elevarme por encima de mis desafíos?"&lt;/strong&gt; preguntó 🌄.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El águila, volando alto, respondió:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Puedo enseñarte a ver desde grandes alturas y ganar perspectiva."&lt;/strong&gt; 👀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora intentó adoptar la perspectiva elevada del águila, tratando de ver sus desafíos desde la distancia 🌌. Pero, a pesar de sus esfuerzos, aún no podía encontrar una solución. Regresó al águila, desconcertada 😕.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"¿Por qué fallé al intentar ver como tú lo haces?"&lt;/strong&gt; preguntó.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El águila respondió:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Porque, Liora, yo veo el mundo desde el cielo ☁️, donde todo parece pequeño y distante. Pero tú vives en el suelo 🌍, donde cada detalle importa. Mi perspectiva no está hecha para ti."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  La Adaptabilidad del Pez
&lt;/h2&gt;

&lt;p&gt;Finalmente, Liora nadó hacia el pez que se deslizaba con gracia en el arroyo 🐟.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Pez ágil, ¿cómo puedo navegar por estos problemas?"&lt;/strong&gt; inquirió 🌊.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El pez, nadando sin esfuerzo, dijo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Puedo mostrarte el camino a través de las corrientes."&lt;/strong&gt; 🌊&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora intentó seguir el consejo del pez, moviéndose con el flujo de su entorno 🌊. Pero se encontró arrastrada, incapaz de navegar las corrientes como lo hacía el pez. Exhausta 😩, preguntó al pez:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"¿Por qué no pude tener éxito al seguir tu ejemplo?"&lt;/strong&gt; 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;El pez respondió suavemente:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Porque, Liora, nací en el agua 🌊, donde estoy en casa en las corrientes. Pero tú eres de la tierra 🌍, donde tus pasos guían tu camino. Mi forma de guiarte no puede atravesar tu propio mundo."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  La Sabiduría de la Tortuga
&lt;/h2&gt;

&lt;p&gt;Confundida y desalentada 😔, Liora vagó por el bosque 🌳, sintiéndose perdida e insegura. Entonces, conoció a una tortuga anciana 🐢 que había observado su búsqueda. La tortuga, sabia y constante, dijo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Liora, buscaste consejo del tigre 🐅, el águila 🦅 y el pez 🐟—cada uno notable a su manera. Pero debes recordar, no eres un tigre 🐅, un águila 🦅, o un pez 🐟. Eres una cierva 🦌, y solo tú puedes encontrar el camino que te conviene."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inspirada por las palabras de la tortuga 🌟, Liora abrazó sus fortalezas únicas y comenzó a forjar su propio camino 🌈. Descubrió que, aunque la valentía del tigre 💪, la perspectiva del águila 👀, y la adaptabilidad del pez 🌊 eran valiosas, sus propias cualidades e instintos eran las claves para superar sus desafíos.&lt;/p&gt;

&lt;p&gt;A partir de ese día, Liora enfrentó sus obstáculos con nueva confianza 🌟, sabiendo que la mejor guía provenía de su interior 💖.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflexión
&lt;/h2&gt;

&lt;p&gt;Al igual que Liora, a menudo buscamos orientación en los demás—ya sea a través de libros 📚, mentores 👩‍🏫, familiares 👨‍👩‍👧‍👦, o incluso videos de YouTube 🎥. En el mundo tecnológico actual, encontramos innumerables caminos a seguir y esperamos que al seguirlos, encontraremos el éxito. Es importante intentar y experimentar con estos métodos cuando aún no tenemos el nuestro. La alternativa es no hacer nada y arrepentirse de las oportunidades que perdimos, lo cual es aún más desalentador. A través de este proceso, no solo obtenemos conocimientos sobre el mundo 🌍, sino también aprendemos sobre nosotros mismos 🌟. Descubrimos nuestras propias fortalezas 💪, debilidades 😔, y el camino único que mejor nos conviene. En última instancia, el viaje de intentar y, a veces, fallar, nos ayuda a descubrir nuestro verdadero ser y a desarrollar nuestros propios métodos para el éxito, enseñándonos que las respuestas más significativas provienen de nuestro interior 💖.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusión
&lt;/h2&gt;

&lt;p&gt;No tengas miedo de intentar y fallar 💪; ten miedo de no intentar en absoluto y de nunca descubrir quién eres o de qué eres realmente capaz 🌟.&lt;/p&gt;




&lt;p&gt;Si encontraste esto útil, siéntete libre de dejar un comentario o una reacción. ¡Gracias! 😊&lt;/p&gt;

</description>
      <category>mentalhealth</category>
      <category>career</category>
      <category>productivity</category>
      <category>spanish</category>
    </item>
    <item>
      <title>Finding Your Own Path</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Thu, 29 Aug 2024 10:53:52 +0000</pubDate>
      <link>https://dev.to/raulpenate/finding-your-own-path-202p</link>
      <guid>https://dev.to/raulpenate/finding-your-own-path-202p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Once upon a time in a vibrant forest 🌳, a young deer named Liora found herself troubled by a series of challenges she couldn't overcome 😔. Seeking wisdom, she decided to consult the most formidable creatures she knew: the tiger 🐅, the eagle 🦅, and the fish 🐟.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tiger's Courage
&lt;/h2&gt;

&lt;p&gt;First, Liora approached the tiger, a symbol of strength and courage 💪🦁.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Mighty tiger,"&lt;/strong&gt; she began, &lt;strong&gt;"how can I overcome these obstacles that stand in my way?"&lt;/strong&gt; 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The tiger, with its piercing gaze 👁️, replied:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I can show you the power of bravery and might."&lt;/strong&gt; 💥&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora tried to mimic the tiger’s bravery, confronting her challenges with fierce determination 💪. But no matter how hard she tried, she couldn’t overcome them. Frustrated 😤, she returned to the tiger and asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Why did I fail when I followed your advice?"&lt;/strong&gt; 🤷‍♀️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The tiger calmly responded:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Because, Liora, my strength is born from a lifetime of battles in the jungle 🌿. Your strength comes from your heart ❤️, not your claws. My way was never meant for you."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Eagle's Perspective
&lt;/h2&gt;

&lt;p&gt;Next, Liora went up to the eagle’s lofty perch 🦅.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Great eagle, how do I rise above my challenges?"&lt;/strong&gt; she asked. 🌄&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The eagle, soaring high, answered:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I can teach you to see from great heights and gain perspective."&lt;/strong&gt; 👀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora attempted to adopt the eagle’s lofty perspective, trying to view her challenges from a distance 🌌. But despite her efforts, she still couldn’t find a solution. She returned to the eagle, perplexed 😕.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Why did I fail when I tried to see as you do?"&lt;/strong&gt; she asked.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The eagle replied:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Because, Liora, I see the world from the sky ☁️, where everything appears small and distant. But you live on the ground 🌍, where each detail matters. My perspective is not meant to be yours."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Fish's Adaptability
&lt;/h2&gt;

&lt;p&gt;Finally, Liora swam to the fish gliding gracefully in the stream 🐟.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Swift fish, how can I navigate these troubles?"&lt;/strong&gt; she inquired. 🌊&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fish, swimming effortlessly, said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I can show you the way through the currents."&lt;/strong&gt; 🌊&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liora tried to follow the fish’s advice, moving with the flow of her surroundings 🌊. But she found herself swept away, unable to navigate the currents as the fish did. Exhausted 😩, she asked the fish:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Why couldn’t I succeed by following your example?"&lt;/strong&gt; 🤔&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The fish answered gently:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Because, Liora, I was born in the water 🌊, where I am at home in the currents. But you are of the land 🌍, where your steps guide your path. My way cannot guide you through your own world."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Tortoise's Wisdom
&lt;/h2&gt;

&lt;p&gt;Confused and disheartened 😔, Liora wandered through the forest 🌳, feeling lost and unsure. Then, she met an old tortoise 🐢 who had observed her quest. The tortoise, wise and steady, said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Liora, you sought advice from the tiger 🐅, the eagle 🦅, and the fish 🐟—each remarkable in their own right. But you must remember, you are not a tiger 🐅, an eagle 🦅, or a fish 🐟. You are a deer 🦌, and only you can find the path that suits you."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Inspired by the tortoise's words 🌟, Liora embraced her unique strengths and began to forge her own path 🌈. She discovered that while the tiger’s courage 💪, the eagle’s perspective 👀, and the fish’s adaptability 🌊 were valuable, her own qualities and instincts were the keys to overcoming her challenges.&lt;/p&gt;

&lt;p&gt;From that day on, Liora faced her obstacles with newfound confidence 🌟, knowing that the best guidance came from within 💖.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;Just like Liora, we often seek guidance from others—whether it’s through books 📚, mentors 👩‍🏫, family 👨‍👩‍👧‍👦, or even YouTube videos 🎥. In today’s tech-driven world, we encounter countless paths to follow and hope that by pursuing them, we will find success. It’s important to try and experiment with these methods when we don’t have our own yet. The alternative is to do nothing and regret the opportunities we missed, which is even more disheartening. Through this process, we not only gain insights about the world 🌍 but also learn about ourselves 🌟. We discover our own strengths 💪, weaknesses 😔, and the unique path that suits us best. Ultimately, the journey of trying, and sometimes failing, helps us discover our true selves and develop our own methods for success, teaching us that the most meaningful answers come from within 💖.&lt;/p&gt;

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

&lt;p&gt;Don’t be afraid to try and fail 💪; be afraid of never trying at all and never discovering who you are or what you’re truly capable of 🌟.&lt;/p&gt;




&lt;p&gt;If you found this helpful, feel free to leave a comment or reaction. Thank you! 😊&lt;/p&gt;

</description>
      <category>mentalhealth</category>
      <category>career</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
    <item>
      <title>Si Ya No Sientes Pasión por la Programación, Quizás Nunca Haya Existido</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Mon, 05 Aug 2024 12:11:03 +0000</pubDate>
      <link>https://dev.to/raulpenate/si-ya-no-sientes-pasion-por-la-programacion-quizas-nunca-haya-existido-39j9</link>
      <guid>https://dev.to/raulpenate/si-ya-no-sientes-pasion-por-la-programacion-quizas-nunca-haya-existido-39j9</guid>
      <description>&lt;p&gt;Cambridge define la pasión como &lt;em&gt;un interés extremo en o deseo de hacer algo&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Pero permíteme preguntarte DE NUEVO: &lt;strong&gt;¿por qué tendrías un INTERÉS EXTREMO en o deseo de HACER algo?&lt;/strong&gt; La respuesta es simple. Es porque te brinda algún tipo de beneficio. Y estos beneficios pueden ser cualquier cosa que imaginemos o hayamos experimentado, tales como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sentirse aliviado después de resolver un problema&lt;/li&gt;
&lt;li&gt;Volverse más inteligente o fuerte&lt;/li&gt;
&lt;li&gt;Obtener nuevos conocimientos&lt;/li&gt;
&lt;li&gt;Aumentar tu confianza&lt;/li&gt;
&lt;li&gt;Tener proyectos para mostrar tus habilidades&lt;/li&gt;
&lt;li&gt;Ascender en tu campo o trabajo&lt;/li&gt;
&lt;li&gt;Encontrar un empleo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A medida que envejeces o logras estos objetivos, los beneficios que buscas pueden cambiar:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adquirir bienes materiales&lt;/li&gt;
&lt;li&gt;Planear futuras vacaciones&lt;/li&gt;
&lt;li&gt;Acceder a una mejor atención médica&lt;/li&gt;
&lt;li&gt;Pagar deudas&lt;/li&gt;
&lt;li&gt;Trabajar desde casa&lt;/li&gt;
&lt;li&gt;Mejorar tu calidad de vida&lt;/li&gt;
&lt;li&gt;Simplemente estar empleado&lt;/li&gt;
&lt;li&gt;Prepararte para la jubilación&lt;/li&gt;
&lt;li&gt;Empezar tu propio negocio&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Todos tenemos sueños y expectativas diferentes. Pero recuerda, tu pasión por la programación estaba impulsada por los beneficios que obtenías. Está perfectamente bien encontrar una nueva pasión. Mira a Zuckerberg: es una persona diferente ahora. Pasó de ser visto como un "reptiliano androide" motivado por el lucro, y que vendía una versión del metaverso que parecia de Wii a alguien que ahora está regalando modelos de IA por valor de $10 mil millones para código abierto y medallista de oro en un torneo de BJJ. Ahora es más feliz y humano que nunca. Al igual que él, necesitas encontrar nuevos beneficios en cosas que puedan convertirse en lo que llamamos "pasión", pero primero debes soportar un período de lucha.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcsn5l3bxm1kz98c863k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftcsn5l3bxm1kz98c863k.png" alt="zuckeberg delgado vs zuckerberg musculoso" width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Entonces, si notas que los CEOs y gerentes trabajan sin parar y te ven raro cuando no estás tan entusiasta a su mismo nivel, es porque ellos están obteniendo o van a obtener enormes beneficios. Esto no es pasión; de lo contrario, darían todo el dinero a sus empleados y trabajarían gratis. Para ser justos con ellos, pagaron el costo para estar allí, así como tú lo estás haciendo para tu propia carrera, que es esfuerzo y tiempo.&lt;/p&gt;

&lt;p&gt;Todos somos únicos. Algunas personas están bien con ciertos trabajos mientras que otras no lo están. Si te sientes infeliz o desmotivado, podría ser porque &lt;strong&gt;tus beneficios ya no están alineados con donde estás, y no estás dispuesto a pagar el costo de donde quieres estar&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ¿Qué debería hacer?
&lt;/h3&gt;

&lt;p&gt;Cuando un cliente está insatisfecho con un servicio, busca un nuevo lugar. Piensa en tu carrera de la misma manera: podría ser el momento de un ascenso, un aumento, un nuevo trabajo, un nuevo proyecto, una nueva cultura o un nuevo pasatiempo fuera del trabajo. Tal vez necesites una aventura más grande. Siempre busca el próximo desafío, pero ten en cuenta que hay un costo involucrado. No tengas miedo de pagarlo, pero asegúrate de estar en una posición para permitirlo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1t0wljdwevtz7wjo4s3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1t0wljdwevtz7wjo4s3y.png" alt="alex hormozi sobre la pasión, primero tienes que fracasar durante años antes de que se convierta en tu pasión" width="550" height="462"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;P.D.:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Y si encuentras que te falta pasión en la vida, podría ser debido a la sobreestimulación. La solución es sencilla: da un paso atrás y elimina lo que te está sobreestimulado. No luches contra ello. Como runner y hiker, te puedo decir que alejarse requiere más inteligencia y esfuerzo. Sé inteligente con tus batallas; usa esa energía para hacer un plan que te ayude a llegar a donde quieres estar, pero siempre recuerda que hay un precio que pagar por ese beneficio, y esa es la parte divertida.&lt;/p&gt;

</description>
      <category>spanish</category>
      <category>productivity</category>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>If You No Longer Feel Passion for Programming, It Might Never Have Existed</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Mon, 05 Aug 2024 12:02:52 +0000</pubDate>
      <link>https://dev.to/raulpenate/if-you-no-longer-feel-passion-for-programming-it-might-never-have-existed-279l</link>
      <guid>https://dev.to/raulpenate/if-you-no-longer-feel-passion-for-programming-it-might-never-have-existed-279l</guid>
      <description>&lt;p&gt;This is a &lt;strong&gt;very hot take&lt;/strong&gt;, just like my man ThePrimeagen would say. So, let’s dive into it: &lt;strong&gt;what is passion?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cambridge defines passion as &lt;em&gt;an extreme interest in or wish for doing something&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But let me ask you AGAIN: &lt;strong&gt;why would you have an EXTREME interest in or wish for DOING something?&lt;/strong&gt; The answer is simple. It’s because it brings you some kind of benefit. And these benefits can be anything we imagine or have experienced, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Feeling relieved after solving a problem&lt;/li&gt;
&lt;li&gt;Becoming smarter or stronger&lt;/li&gt;
&lt;li&gt;Gaining new knowledge&lt;/li&gt;
&lt;li&gt;Boosting your confidence&lt;/li&gt;
&lt;li&gt;Having projects to showcase your skills&lt;/li&gt;
&lt;li&gt;Rising to the top in your field or job&lt;/li&gt;
&lt;li&gt;Finding a job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you grow older or achieve these goals, the benefits you seek might shift:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Acquiring material things&lt;/li&gt;
&lt;li&gt;Planning future vacations&lt;/li&gt;
&lt;li&gt;Accessing better healthcare&lt;/li&gt;
&lt;li&gt;Paying off debts&lt;/li&gt;
&lt;li&gt;Working from home&lt;/li&gt;
&lt;li&gt;Improving your quality of life&lt;/li&gt;
&lt;li&gt;Just being employed&lt;/li&gt;
&lt;li&gt;Preparing for retirement&lt;/li&gt;
&lt;li&gt;Starting your own business&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We all have different dreams and expectations. But remember, your passion for programming was driven by the benefits you gained. It’s perfectly okay to find a new passion. Look at Zuckerberg—he’s a different person now. He went from being seen as a profit-driven "robot lizard" selling a Wii version of the metaverse to someone who’s now giving away $10 billion worth of AI models for open source and BJJ gold medalist in a tournament. Now he's happier and more human than ever. Like him, you need to find new benefits in things that may later become the thing we call "passion", but you have to endure a period of struggle first.&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%2Ftcsn5l3bxm1kz98c863k.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%2Ftcsn5l3bxm1kz98c863k.png" alt="zuckeberg skinny vs zuckeberg jacked"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, if you notice CEOs and managers who work non-stop and seem baffled that you’re not as enthusiastic, it’s because they’re getting or are going to get huge benefits. This is not passion; otherwise, they'd give all the money to their employees and work for free. To be fair to them, they paid the cost to be there, just as you are doing for your own career, which is effort and time.&lt;/p&gt;

&lt;p&gt;Everyone is unique. Some people are okay with certain jobs while others aren't. If you’re feeling unhappy or unmotivated, it might be because &lt;strong&gt;your benefits are no longer aligning with where you are, and you’re not willing to pay the cost of where you want to be&lt;/strong&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  What should I do?
&lt;/h3&gt;

&lt;p&gt;When a customer is unhappy with a service, they look for a new place. Think of your career in the same way: it might be time for a promotion, a raise, a new job, new project, new culture or a new hobby outside of work. Maybe you need something more adventurous. Always seek the next challenge, but be aware that there’s a cost involved. Don’t be afraid to pay it, but make sure you’re in a position to afford it.&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%2Fwaugrbxeea7bp216dkzc.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%2Fwaugrbxeea7bp216dkzc.png" alt="alex hormozi about passion, you've to suck first for years before that becomining your passion"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;P.S.:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
And if you find you’re lacking passion in life, it could be due to overstimulation. The fix is straightforward: take a step back and remove what’s overstimulating you. Don’t fight it. As a runner and hiker, I can tell you that stepping away takes more brains and effort. Be smart about your battles; use that energy to make a plan that helps you get to where you want to be, but always remember that there is a price to pay for that benefit, and that's the fun part.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>learning</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>🚀 Guía para principiantes: instalación y uso de GitHub CLI 🛠️</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Tue, 30 Jul 2024 12:11:46 +0000</pubDate>
      <link>https://dev.to/raulpenate/guia-para-principiantes-instalacion-y-uso-de-github-cli-3o2b</link>
      <guid>https://dev.to/raulpenate/guia-para-principiantes-instalacion-y-uso-de-github-cli-3o2b</guid>
      <description>&lt;h1&gt;
  
  
  ¿Por qué usar GitHub CLI?
&lt;/h1&gt;

&lt;p&gt;GitHub CLI lleva GitHub a tu terminal. Te permite &lt;code&gt;clonar&lt;/code&gt;, &lt;code&gt;crear&lt;/code&gt;, &lt;code&gt;bifurcar&lt;/code&gt; y &lt;code&gt;ver repositorios&lt;/code&gt;, así como manejar &lt;code&gt;issues&lt;/code&gt; y &lt;code&gt;pull requests&lt;/code&gt; con comandos para &lt;code&gt;listar&lt;/code&gt;, &lt;code&gt;crear&lt;/code&gt;, &lt;code&gt;ver&lt;/code&gt; y &lt;code&gt;fusionar&lt;/code&gt; estos. También puedes gestionar &lt;code&gt;gists&lt;/code&gt;, &lt;code&gt;activar&lt;/code&gt; y revisar los &lt;code&gt;workflows&lt;/code&gt; de GitHub Actions, y hacer solicitudes directas a la API. Además, tienes opciones de autenticación y configuración disponibles para gestionar el acceso y los &lt;code&gt;settings&lt;/code&gt;, mientras que las funcionalidades de &lt;code&gt;búsqueda&lt;/code&gt; te ayudan a encontrar &lt;code&gt;repositorios&lt;/code&gt;, &lt;code&gt;issues&lt;/code&gt; y más.&lt;/p&gt;




&lt;h1&gt;
  
  
  Parte 1: Instalar GitHub CLI 🔨
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli?tab=readme-ov-file#macos" rel="noopener noreferrer"&gt;macOS 🍎&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;gh está disponible a través de &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;, &lt;a href="https://www.macports.org/" rel="noopener noreferrer"&gt;MacPorts&lt;/a&gt;, &lt;a href="https://docs.conda.io/en/latest/" rel="noopener noreferrer"&gt;Conda&lt;/a&gt;, &lt;a href="https://spack.io/" rel="noopener noreferrer"&gt;Spack&lt;/a&gt;, &lt;a href="https://webinstall.dev/" rel="noopener noreferrer"&gt;Webi&lt;/a&gt;, y como un binario descargable que incluye el instalador para Mac OS &lt;code&gt;.pkg&lt;/code&gt; &lt;a href="https://github.com/cli/cli/releases/tag/v2.53.0" rel="noopener noreferrer"&gt;desde la página de lanzamientos&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Homebrew&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# MacPorts&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;port &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Conda&lt;/span&gt;
conda &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--channel&lt;/span&gt; conda-forge

&lt;span class="c"&gt;# Spack&lt;/span&gt;
spack &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Webi&lt;/span&gt;
curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://webi.sh/gh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli?tab=readme-ov-file#windows" rel="noopener noreferrer"&gt;Windows 🪟&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;gh está disponible a través de &lt;a href="https://github.com/microsoft/winget-cli" rel="noopener noreferrer"&gt;WinGet&lt;/a&gt;, &lt;a href="https://scoop.sh/" rel="noopener noreferrer"&gt;scoop&lt;/a&gt;, &lt;a href="https://chocolatey.org/" rel="noopener noreferrer"&gt;Chocolatey&lt;/a&gt;, &lt;a href="https://docs.conda.io/en/latest/" rel="noopener noreferrer"&gt;Conda&lt;/a&gt;, &lt;a href="https://webinstall.dev/" rel="noopener noreferrer"&gt;Webi&lt;/a&gt;, y como &lt;a href="https://github.com/cli/cli/releases/tag/v2.53.0" rel="noopener noreferrer"&gt;instalador MSI&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# WinGet&lt;/span&gt;
winget &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--id&lt;/span&gt; GitHub.cli

&lt;span class="c"&gt;# scoop&lt;/span&gt;
scoop &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Chocolatey&lt;/span&gt;
choco &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Conda&lt;/span&gt;
conda &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--channel&lt;/span&gt; conda-forge

&lt;span class="c"&gt;# Spack&lt;/span&gt;
spack &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Webi&lt;/span&gt;
curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://webi.sh/gh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;Linux 🐧&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Aquí realmente depende de lo que estés usando; puedes leer la &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;documentación de instalación para Linux&lt;/a&gt; para encontrar lo que necesitas, o verificar aquí los comandos dependiendo de la distribución que estés usando.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Arch&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; github-cli

&lt;span class="c"&gt;# Debian, Ubuntu Linux, Raspberry Pi OS (apt)&lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; wget &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;wget &lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; 755 /etc/apt/keyrings &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; wget &lt;span class="nt"&gt;-qO-&lt;/span&gt; https://cli.github.com/packages/githubcli-archive-keyring.gpg | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/keyrings/githubcli-archive-keyring.gpg &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo chmod &lt;/span&gt;go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [arch=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dpkg &lt;span class="nt"&gt;--print-architecture&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/github-cli.list &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="c"&gt;# Actualizar&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Fedora, CentOS, Red Hat Enterprise Linux (dnf)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s1"&gt;'dnf-command(config-manager)'&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf config-manager &lt;span class="nt"&gt;--add-repo&lt;/span&gt; https://cli.github.com/packages/rpm/gh-cli.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--repo&lt;/span&gt; gh-cli
&lt;span class="c"&gt;# Alternativamente, instalar desde el repositorio comunitario:&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;gh
&lt;span class="c"&gt;# Actualizar&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf update gh

&lt;span class="c"&gt;# openSUSE/SUSE Linux (zypper)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper ref
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper &lt;span class="nb"&gt;install &lt;/span&gt;gh
&lt;span class="c"&gt;# Actualizar&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper ref
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper update gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Parte 2: Iniciar sesión 🔐
&lt;/h1&gt;

&lt;p&gt;Primero escribe en tu terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh auth login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Te pedirá:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? ¿En qué cuenta deseas iniciar sesión?  &lt;span class="o"&gt;[&lt;/span&gt;Usa las flechas para moverte, escribe para filtrar]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; GitHub.com
  GitHub Enterprise Server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Si eliges &lt;code&gt;GitHub.com&lt;/code&gt;, te pedirá:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? ¿Cuál es tu protocolo preferido para las operaciones de Git en este host?  &lt;span class="o"&gt;[&lt;/span&gt;Usa las flechas para moverte, escribe para filtrar]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; HTTPS
  SSH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A continuación, te preguntará tu protocolo y &lt;em&gt;preferencia personal&lt;/em&gt;. Recomiendo &lt;code&gt;SSH&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? ¿Cuál es tu protocolo preferido para las operaciones de Git en este host?  &lt;span class="o"&gt;[&lt;/span&gt;Usa las flechas para moverte, escribe para filtrar]
  HTTPS
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; SSH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ahora solo crea la &lt;code&gt;contraseña&lt;/code&gt; para tu &lt;code&gt;clave SSH&lt;/code&gt;, el título y selecciona cómo te gustaría autenticarte, y &lt;em&gt;si es la primera vez, solo usa Iniciar sesión con un navegador web&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? ¿Generar una nueva clave SSH para agregar a tu cuenta de GitHub? &lt;span class="o"&gt;(&lt;/span&gt;Y/n&lt;span class="o"&gt;)&lt;/span&gt; Y

 Ingresa una frase de contraseña para tu nueva clave SSH &lt;span class="o"&gt;(&lt;/span&gt;Opcional&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="k"&gt;**************************&lt;/span&gt;

? Título para tu clave SSH: &lt;span class="o"&gt;(&lt;/span&gt;GitHub CLI&lt;span class="o"&gt;)&lt;/span&gt; TheMachine-Desktop

? ¿Cómo te gustaría autenticar GitHub CLI?  &lt;span class="o"&gt;[&lt;/span&gt;Usa las flechas para moverte, escribe para filtrar]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Iniciar sesión con un navegador web
  Pegar un token de autenticación

&lt;span class="o"&gt;!&lt;/span&gt; Primero copia tu código de un solo uso: 1234-ABCD
Presiona Enter para abrir github.com en tu navegador... 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎉 ¡Felicidades! 🎉, ahora puedes usar GitHub desde tu terminal 🖥️. Si escribes &lt;code&gt;gh auth status&lt;/code&gt;, deberías obtener algo como esto:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;gh&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
  &lt;span class="err"&gt;✓&lt;/span&gt; &lt;span class="n"&gt;Conectado&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;la&lt;/span&gt; &lt;span class="n"&gt;cuenta&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="nf"&gt;nombredeusuario &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gh&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;yml&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Cuenta&lt;/span&gt; &lt;span class="n"&gt;activa&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Protocolo&lt;/span&gt; &lt;span class="n"&gt;de&lt;/span&gt; &lt;span class="n"&gt;operaciones&lt;/span&gt; &lt;span class="n"&gt;de&lt;/span&gt; &lt;span class="n"&gt;Git&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ssh&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;...&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Ámbitos&lt;/span&gt; &lt;span class="k"&gt;del&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Parte 3: Comandos útiles 📝
&lt;/h1&gt;

&lt;p&gt;Aquí te daré ⭐&lt;strong&gt;Mis 5 comandos principales en GitHub CLI&lt;/strong&gt;🏅 para que te hagas una idea de lo que eres capaz de hacer, pero siéntete libre de revisar la &lt;a href="https://cli.github.com/manual/" rel="noopener noreferrer"&gt;documentación&lt;/a&gt; para obtener un conocimiento más profundo de esta herramienta.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_repo_clone" rel="noopener noreferrer"&gt;1 - Clonar un repositorio de GitHub 🥇&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh repo clone owner/repo&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh repo clone chrislgarry/Apollo-11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
Como estás usando &lt;code&gt;ssh&lt;/code&gt;, también puedes ir a esta sección de un repositorio de GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5tvylo1mbt654ztvtgd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5tvylo1mbt654ztvtgd.png" alt="Mostrando el repositorio de GitHub, la pestaña donde puedes seleccionar http, ssh o github cli" width="800" height="484"&gt;&lt;/a&gt;&lt;br&gt;
Y &lt;code&gt;git clone&lt;/code&gt; de esta manera:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com:chrislgarry/Apollo-11.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Y puedes &lt;code&gt;ver&lt;/code&gt; el &lt;code&gt;README.md&lt;/code&gt; del repositorio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; gh repo view chrislgarry/Apollo-11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2u9929g0j0y6n9easiaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2u9929g0j0y6n9easiaf.png" alt="Terminal mostrando la descripción de GitHub" width="800" height="413"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_repo_create" rel="noopener noreferrer"&gt;2 - Crear un nuevo repositorio en GitHub 🥈&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh repo create repo&lt;/code&gt;, puedes usar opciones como &lt;code&gt;--public&lt;/code&gt;, &lt;code&gt;private&lt;/code&gt;, &lt;code&gt;--description &amp;lt;string&amp;gt;&lt;/code&gt; y &lt;a href="https://cli.github.com/manual/gh_repo_create" rel="noopener noreferrer"&gt;más&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh repo create my-new-repo &lt;span class="nt"&gt;--public&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists" rel="noopener noreferrer"&gt;3 - Crear un nuevo gist 🥉&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh gist create &amp;lt;file&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh gist create file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
También puedes &lt;code&gt;listar&lt;/code&gt; los gists:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh gist list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_issue_create" rel="noopener noreferrer"&gt;4 - Crear un nuevo issue 🏅&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh issue create --title &amp;lt;title&amp;gt; --body &amp;lt;body&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh issue create &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"Título del issue"&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"Cuerpo del issue"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
También puedes &lt;code&gt;crear&lt;/code&gt; issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh issue create &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"Título del issue"&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"

Cuerpo del issue"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ver&lt;/code&gt; issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh issue view &amp;lt;número-del-issue&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Y &lt;code&gt;cerrar&lt;/code&gt; issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh issue close &amp;lt;número-del-issue&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_pr_list" rel="noopener noreferrer"&gt;5 - Listar pull requests 🌟&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh pr list&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh &lt;span class="nb"&gt;pr &lt;/span&gt;list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt;&lt;br&gt;
También puedes &lt;code&gt;ver&lt;/code&gt; la pull request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh &lt;span class="nb"&gt;pr &lt;/span&gt;view &amp;lt;número-del-pr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fusionar&lt;/code&gt; una pull request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr merge &amp;lt;número-del-pr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Y &lt;code&gt;revisarla&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh &lt;span class="nb"&gt;pr &lt;/span&gt;review &lt;span class="nt"&gt;--approve&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"¡Se ve bien!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Pensamientos finales 🎉
&lt;/h1&gt;

&lt;p&gt;GitHub CLI lleva GitHub a tu terminal, ¡haciendo que sea increíblemente poderoso! 🚀 Espero que hayas encontrado útil este post y que te haya inspirado a sacar el máximo provecho de esta herramienta. ¡No olvides suscribirte para recibir más actualizaciones de mis futuros posts! 🙌🖥️&lt;/p&gt;




&lt;h1&gt;
  
  
  Fuentes 📚
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/cli/cli?tab=readme-ov-file#github-cli" rel="noopener noreferrer"&gt;Instalar GitHub CLI&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;Instalar GitHub CLI en Linux&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cli.github.com/manual/" rel="noopener noreferrer"&gt;Manual de GitHub CLI&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/chrislgarry/Apollo-11" rel="noopener noreferrer"&gt;Código de Apollo 11&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Aquí me gustaría agregar una frase personal, pero todavía estoy pensando/buscando una&lt;/em&gt; 😂&lt;/p&gt;

</description>
      <category>spanish</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>github</category>
    </item>
    <item>
      <title>🚀 Begginer's Guide: installing and using GitHub CLI 🛠️</title>
      <dc:creator>The Eagle 🦅</dc:creator>
      <pubDate>Tue, 30 Jul 2024 11:56:19 +0000</pubDate>
      <link>https://dev.to/raulpenate/begginers-guide-installing-and-using-github-cli-30ka</link>
      <guid>https://dev.to/raulpenate/begginers-guide-installing-and-using-github-cli-30ka</guid>
      <description>&lt;h1&gt;
  
  
  Why use GitHub CLI?
&lt;/h1&gt;

&lt;p&gt;GitHub CLI brings GitHub to your terminal. It allows you to &lt;code&gt;clone&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;fork&lt;/code&gt;, and &lt;code&gt;view repositories&lt;/code&gt;, as well as handle &lt;code&gt;issues&lt;/code&gt; and &lt;code&gt;pull&lt;/code&gt; requests with commands to &lt;code&gt;list&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;view&lt;/code&gt;, and &lt;code&gt;merge&lt;/code&gt; them. You can also manage &lt;code&gt;gists&lt;/code&gt;, &lt;code&gt;trigger&lt;/code&gt; and review GitHub Actions &lt;code&gt;workflows&lt;/code&gt;, and make direct API requests. You also have authentication and configuration options are available to manage access and &lt;code&gt;settings&lt;/code&gt;, while &lt;code&gt;search&lt;/code&gt; functionalities help you find &lt;code&gt;repositories&lt;/code&gt;, &lt;code&gt;issues&lt;/code&gt;, and more.&lt;/p&gt;




&lt;h1&gt;
  
  
  Part 1: Install GithubCLI 🔨
&lt;/h1&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli?tab=readme-ov-file#macos" rel="noopener noreferrer"&gt;macOS 🍎&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;gh is available via &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;, &lt;a href="https://www.macports.org/" rel="noopener noreferrer"&gt;MacPorts&lt;/a&gt;, &lt;a href="https://docs.conda.io/en/latest/" rel="noopener noreferrer"&gt;Conda&lt;/a&gt;, &lt;a href="https://spack.io/" rel="noopener noreferrer"&gt;Spack&lt;/a&gt;, &lt;a href="https://webinstall.dev/" rel="noopener noreferrer"&gt;Webi&lt;/a&gt;, and as a downloadable binary including Mac OS installer &lt;code&gt;.pkg&lt;/code&gt; &lt;a href="https://github.com/cli/cli/releases/tag/v2.53.0" rel="noopener noreferrer"&gt;from the releases page&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Homebrew&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# MacPorts&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;port &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Conda&lt;/span&gt;
conda &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--channel&lt;/span&gt; conda-forge

&lt;span class="c"&gt;# Spack&lt;/span&gt;
spack &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Webi&lt;/span&gt;
curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://webi.sh/gh | sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli?tab=readme-ov-file#windows" rel="noopener noreferrer"&gt;Windows 🪟&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;gh is available via &lt;a href="https://github.com/microsoft/winget-cli" rel="noopener noreferrer"&gt;WinGet&lt;/a&gt;, &lt;a href="https://scoop.sh/" rel="noopener noreferrer"&gt;scoop&lt;/a&gt;, &lt;a href="https://chocolatey.org/" rel="noopener noreferrer"&gt;Chocolatey&lt;/a&gt;, &lt;a href="https://docs.conda.io/en/latest/" rel="noopener noreferrer"&gt;Conda&lt;/a&gt;, &lt;a href="https://webinstall.dev/" rel="noopener noreferrer"&gt;Webi&lt;/a&gt;, and as &lt;a href="https://github.com/cli/cli/releases/tag/v2.53.0" rel="noopener noreferrer"&gt;MSI installer&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# WinGet&lt;/span&gt;
winget &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--id&lt;/span&gt; GitHub.cli

&lt;span class="c"&gt;# scoop&lt;/span&gt;
scoop &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Chocolatey&lt;/span&gt;
choco &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Conda&lt;/span&gt;
conda &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--channel&lt;/span&gt; conda-forge

&lt;span class="c"&gt;# Spack&lt;/span&gt;
spack &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Webi&lt;/span&gt;
curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://webi.sh/gh | sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;Linux 🐧&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Here it really depends what you're using, here can you read the &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;linux install documentation&lt;/a&gt; to find what you need, or check here the commands depending the distro you're using.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Arch&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; github-cli

&lt;span class="c"&gt;# Debian, Ubuntu Linux, Raspberry Pi OS (apt)&lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; wget &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;wget &lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; 755 /etc/apt/keyrings &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; wget &lt;span class="nt"&gt;-qO-&lt;/span&gt; https://cli.github.com/packages/githubcli-archive-keyring.gpg | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/keyrings/githubcli-archive-keyring.gpg &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo chmod &lt;/span&gt;go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [arch=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dpkg &lt;span class="nt"&gt;--print-architecture&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/github-cli.list &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="c"&gt;# Upgrade&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gh

&lt;span class="c"&gt;# Fedora, CentOS, Red Hat Enterprise Linux (dnf)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s1"&gt;'dnf-command(config-manager)'&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf config-manager &lt;span class="nt"&gt;--add-repo&lt;/span&gt; https://cli.github.com/packages/rpm/gh-cli.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;gh &lt;span class="nt"&gt;--repo&lt;/span&gt; gh-cli
&lt;span class="c"&gt;#Alternatively, install from the community repository:&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;gh
&lt;span class="c"&gt;#Upgrade&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf update gh

&lt;span class="c"&gt;# openSUSE/SUSE Linux (zypper)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper addrepo https://cli.github.com/packages/rpm/gh-cli.repo
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper ref
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper &lt;span class="nb"&gt;install &lt;/span&gt;gh
&lt;span class="c"&gt;# Upgrade&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper ref
&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper update gh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Part 2: Log in 🔐
&lt;/h1&gt;

&lt;p&gt;First write in your terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh auth login


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here will ask you:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

? What account &lt;span class="k"&gt;do &lt;/span&gt;you want to log into?  &lt;span class="o"&gt;[&lt;/span&gt;Use arrows to move, &lt;span class="nb"&gt;type &lt;/span&gt;to filter]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; GitHub.com
  GitHub Enterprise Server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you choosed &lt;code&gt;Github.com&lt;/code&gt; it will ask you:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

? What is your preferred protocol &lt;span class="k"&gt;for &lt;/span&gt;Git operations on this host?  &lt;span class="o"&gt;[&lt;/span&gt;Use arrows to move, &lt;span class="nb"&gt;type &lt;/span&gt;to filter]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; HTTPS
  SSH


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next it'll ask you your protocol and &lt;em&gt;personal preference&lt;/em&gt; I recommend &lt;code&gt;SSH&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

? What is your preferred protocol &lt;span class="k"&gt;for &lt;/span&gt;Git operationInstall Github CLI &lt;span class="k"&gt;in &lt;/span&gt;Linuxs on this host?  &lt;span class="o"&gt;[&lt;/span&gt;Use arrows to move, &lt;span class="nb"&gt;type &lt;/span&gt;to filter]
  HTTPS
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; SSH


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now just create the &lt;code&gt;password&lt;/code&gt; for your &lt;code&gt;SSH Key&lt;/code&gt;, the title and select how you'd like to autheticate, and &lt;em&gt;if this is your first time just use Login with a web browser&lt;/em&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

? Generate a new SSH key to add to your GitHub account? &lt;span class="o"&gt;(&lt;/span&gt;Y/n&lt;span class="o"&gt;)&lt;/span&gt; Y

 Enter a passphrase &lt;span class="k"&gt;for &lt;/span&gt;your new SSH key &lt;span class="o"&gt;(&lt;/span&gt;Optional&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="k"&gt;**************************&lt;/span&gt;

? Title &lt;span class="k"&gt;for &lt;/span&gt;your SSH key: &lt;span class="o"&gt;(&lt;/span&gt;GitHub CLI&lt;span class="o"&gt;)&lt;/span&gt; TheMachine-Desktop

? How would you like to authenticate GitHub CLI?  &lt;span class="o"&gt;[&lt;/span&gt;Use arrows to move, &lt;span class="nb"&gt;type &lt;/span&gt;to filter]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Login with a web browser
  Paste an authentication token

&lt;span class="o"&gt;!&lt;/span&gt; First copy your one-time code: 1234-ABCD
Press Enter to open github.com &lt;span class="k"&gt;in &lt;/span&gt;your browser... 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🎉 Congratulations 🎉, now you can use Github from your terminal  🖥️.! if you write &lt;code&gt;gh auth status&lt;/code&gt;, you should get something like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;

&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;gh&lt;/span&gt; &lt;span class="n"&gt;auth&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;
  &lt;span class="err"&gt;✓&lt;/span&gt; &lt;span class="n"&gt;Logged&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="nf"&gt;username &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gh&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;yml&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Active&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Git&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt; &lt;span class="n"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ssh&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;...&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Token&lt;/span&gt; &lt;span class="n"&gt;scopes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="bp"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Part 3: Useful commands 📝
&lt;/h1&gt;

&lt;p&gt;Here I'll give you ⭐&lt;strong&gt;My TOP 5 commands in Github CLI&lt;/strong&gt;🏅 so you can build an idea of what you are capable of doing, but feel free to checkout the &lt;a href="https://cli.github.com/manual/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to gain a deeper knowledge of this tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_repo_clone" rel="noopener noreferrer"&gt;1 - Clone a GitHub repository 🥇&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh repo clone owner/repo&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh repo clone chrislgarry/Apollo-11


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
Since you're using &lt;code&gt;ssh&lt;/code&gt; you can also go to this section of a GitHub repo:&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%2Fc5tvylo1mbt654ztvtgd.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%2Fc5tvylo1mbt654ztvtgd.png" alt="Showing Github repo, the tab where you can select http, ssh or github cli"&gt;&lt;/a&gt;&lt;br&gt;
And &lt;code&gt;git clone&lt;/code&gt; it like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

git clone git@github.com:chrislgarry/Apollo-11.git


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And you can &lt;code&gt;view&lt;/code&gt; the &lt;code&gt;README.md&lt;/code&gt; of the repo:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

 gh repo view chrislgarry/Apollo-11


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F2u9929g0j0y6n9easiaf.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%2F2u9929g0j0y6n9easiaf.png" alt="Terminal showing github description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_repo_create" rel="noopener noreferrer"&gt;2 - Create a new repository on GitHub 🥈&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh repo create repo&lt;/code&gt;, you can use flags like &lt;code&gt;--public&lt;/code&gt;, &lt;code&gt;private&lt;/code&gt;, &lt;code&gt;--description &amp;lt;string&amp;gt;&lt;/code&gt; and &lt;a href="https://cli.github.com/manual/gh_repo_create" rel="noopener noreferrer"&gt;more&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh repo create my-new-repo &lt;span class="nt"&gt;--public&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists" rel="noopener noreferrer"&gt;3 - Create a new gist 🥉&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh gist create &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh gist create file.txt


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
You can also &lt;code&gt;list&lt;/code&gt; them:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh gist list


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_issue_create" rel="noopener noreferrer"&gt;4 - Create a new issue 🏅&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh issue create --title &amp;lt;title&amp;gt; --body &amp;lt;body&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh issue create &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"Issue title"&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"Issue body"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt; &lt;br&gt;
You can alse &lt;code&gt;create&lt;/code&gt; issues:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh issue create &lt;span class="nt"&gt;--title&lt;/span&gt; &lt;span class="s2"&gt;"Issue title"&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"Issue body"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;view&lt;/code&gt; issues:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh issue view &amp;lt;issue-number&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;close&lt;/code&gt; issues:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh issue close &amp;lt;issue-number&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://cli.github.com/manual/gh_pr_list" rel="noopener noreferrer"&gt;5 - List pull requests 🌟&lt;/a&gt;:&lt;/strong&gt; &lt;code&gt;gh pr list&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh &lt;span class="nb"&gt;pr &lt;/span&gt;list


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Bonus 🎁:&lt;/strong&gt;&lt;br&gt;
You can also &lt;code&gt;view&lt;/code&gt; the pull request:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh &lt;span class="nb"&gt;pr &lt;/span&gt;view &amp;lt;pr-number&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;merge&lt;/code&gt; a pull request:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

gh pr merge &amp;lt;pr-number&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And &lt;code&gt;review&lt;/code&gt; it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gh &lt;span class="nb"&gt;pr &lt;/span&gt;review &lt;span class="nt"&gt;--approve&lt;/span&gt; &lt;span class="nt"&gt;--body&lt;/span&gt; &lt;span class="s2"&gt;"Looks good!"&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Final Thoughts 🎉
&lt;/h1&gt;

&lt;p&gt;GitHub CLI brings GitHub to your terminal, making it incredibly powerful! 🚀 I hope you found this post helpful and that it has inspired you to make the most of this tool. Don’t forget to subscribe for more updates for my future post! 🙌🖥️&lt;/p&gt;




&lt;h1&gt;
  
  
  Sources 📚
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/cli/cli?tab=readme-ov-file#github-cli" rel="noopener noreferrer"&gt;Install Github CLI&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md" rel="noopener noreferrer"&gt;Install Github CLI in Linux&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cli.github.com/manual/" rel="noopener noreferrer"&gt;Github CLI manual&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/chrislgarry/Apollo-11" rel="noopener noreferrer"&gt;Apollo 11 Code&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Here I'd like to add a personal phrase, but I'm still thinking/looking for one&lt;/em&gt; 😂&lt;/p&gt;

</description>
      <category>github</category>
      <category>terminal</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
