<?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: David Garcia</title>
    <description>The latest articles on DEV Community by David Garcia (@davidgarcia).</description>
    <link>https://dev.to/davidgarcia</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%2F1627730%2Fdee7d909-64d7-48d6-a5da-4b8315b72bd8.png</url>
      <title>DEV Community: David Garcia</title>
      <link>https://dev.to/davidgarcia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/davidgarcia"/>
    <language>en</language>
    <item>
      <title>🧩 Understanding Why Omit and Pick Fail with Union Types</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Wed, 07 May 2025 07:16:34 +0000</pubDate>
      <link>https://dev.to/davidgarcia/understanding-why-omit-and-pick-fail-with-union-types-357</link>
      <guid>https://dev.to/davidgarcia/understanding-why-omit-and-pick-fail-with-union-types-357</guid>
      <description>&lt;p&gt;&lt;strong&gt;Omit&lt;/strong&gt; and &lt;strong&gt;Pick&lt;/strong&gt; are some of the most loved utility types in TypeScript. They let you create new types by excluding or selecting specific properties from an existing type.&lt;br&gt;
However, when you use them with &lt;strong&gt;union types&lt;/strong&gt;, their behavior can be misleading - and in some cases, break your type expectations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type Employee = {
 id: string
 name: string
 job_name: string
}
type Customer = {
 id: string
 name: string
 company: string
}
type Person = Employee | Customer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❌ Problem: Using Omit Directly&lt;/strong&gt;&lt;br&gt;
Suppose you want to remove the id field from all personas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type PersonWithoutId = Omit&amp;lt;Person, 'id'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧨 Actual Result:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type PersonWithoutId = {
 name: string
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only name survives. The fields job_name and company are lost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;br&gt;
Because Omit is &lt;strong&gt;not distributive&lt;/strong&gt; over union types. It collapses the union into a common structure, then removes the property - resulting in a simplified, lossy type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DistributiveOmit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can fix this by explicitly distributing Omit across each union member:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type DistributiveOmit&amp;lt;T, K extends PropertyKey&amp;gt; = T extends any
 ? Omit&amp;lt;T, K&amp;gt;
 : never

type PersonWithoutId = DistributiveOmit&amp;lt;Person, 'id'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ Expected Result:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type PersonWithoutId =
 | { name: string; job_name: string }
 | { name: string; company: string }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧪 Same Fix for Pick&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type DistributivePick&amp;lt;T, K extends keyof T&amp;gt; = T extends any
 ? Pick&amp;lt;T, K&amp;gt;
 : never

type BasicaPerson = DistributivePick&amp;lt;Person, 'id' | 'name'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🧠 Summary Table&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fjt2ntb9qhy1bnp8c9657.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fjt2ntb9qhy1bnp8c9657.png" alt="Image description" width="726" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🔎 Do you know the Sensors panel in DevTools?</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Thu, 20 Feb 2025 11:28:31 +0000</pubDate>
      <link>https://dev.to/davidgarcia/do-you-know-the-sensors-panel-in-devtools-59bm</link>
      <guid>https://dev.to/davidgarcia/do-you-know-the-sensors-panel-in-devtools-59bm</guid>
      <description>&lt;p&gt;🔄 How to use it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open DevTools (F12 or Ctrl+Shift+I in Chrome).&lt;/li&gt;
&lt;li&gt;Go to the More tools &amp;gt; Sensors tab.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1️⃣ Override Geolocation&lt;/p&gt;

&lt;p&gt;Simulates the user’s location anywhere in the world.&lt;/p&gt;

&lt;p&gt;Example: If you’re developing a location-based app, you can test how it behaves in New York, Tokyo, or Buenos Aires without moving.&lt;/p&gt;

&lt;p&gt;2️⃣ Simulate Device Orientation&lt;/p&gt;

&lt;p&gt;Modifies accelerometer and gyroscope values to test device rotation changes.&lt;/p&gt;

&lt;p&gt;Example: If you’re building an augmented reality app or a responsive website, you can check how it behaves when rotating the device.&lt;/p&gt;

&lt;p&gt;3️⃣ Force Touch Events&lt;/p&gt;

&lt;p&gt;Simulates touch interactions on mobile devices.&lt;/p&gt;

&lt;p&gt;Example: If you’re optimizing touch gestures (swipes, pinches, long presses), you can test them without a physical device.&lt;/p&gt;

&lt;p&gt;4️⃣ Emulate an Inactive Sensor&lt;/p&gt;

&lt;p&gt;Simulates disabled or inactive sensors, such as proximity detection.&lt;/p&gt;

&lt;p&gt;Example: Useful for testing how an app behaves when certain sensors are unavailable on the user’s device.&lt;/p&gt;

&lt;p&gt;👉 Have you tried these options in your projects? 🚀&lt;/p&gt;

&lt;p&gt;ℹ️ More info on Google’s website:&lt;br&gt;
&lt;a href="https://developer.chrome.com/docs/devtools/sensors?hl=en" rel="noopener noreferrer"&gt;https://developer.chrome.com/docs/devtools/sensors?hl=en&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devtools</category>
      <category>sensors</category>
    </item>
    <item>
      <title>🧹 Remove them with a single Fish Shell command:</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Wed, 19 Feb 2025 06:09:39 +0000</pubDate>
      <link>https://dev.to/davidgarcia/remove-them-with-a-single-fish-shell-command-52jg</link>
      <guid>https://dev.to/davidgarcia/remove-them-with-a-single-fish-shell-command-52jg</guid>
      <description>&lt;p&gt;1️⃣ Save the following script in:&lt;br&gt;
📂 .config/fish/functions/git-delete-branches.fish&lt;/p&gt;

&lt;p&gt;2️⃣ Execute the command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git-delete-branches "&amp;lt;regex&amp;gt;"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🔹 Finds and deletes local/remote branches matching a regex.&lt;br&gt;
🔹 Asks for confirmation to avoid surprises.&lt;br&gt;
🔹 Saves time and keeps your repo clean.&lt;/p&gt;

&lt;p&gt;📌 Full code and explanation 👉&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>fish</category>
      <category>git</category>
      <category>gitdeletebranch</category>
    </item>
    <item>
      <title>⚡ Master WebStorm with these key shortcuts to navigate and edit faster!</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Mon, 17 Feb 2025 20:43:27 +0000</pubDate>
      <link>https://dev.to/davidgarcia/master-webstorm-with-these-key-shortcuts-to-navigate-and-edit-faster-3de2</link>
      <guid>https://dev.to/davidgarcia/master-webstorm-with-these-key-shortcuts-to-navigate-and-edit-faster-3de2</guid>
      <description>&lt;p&gt;If you use JetBrains, these shortcuts will make you fly through your.&lt;/p&gt;

&lt;p&gt;You can find them in the Keymap settings:&lt;/p&gt;

&lt;p&gt;🔹 Jump between functions&lt;br&gt;
Path: Main Menu → Navigate → Navigate in File → Next Method&lt;/p&gt;

&lt;p&gt;🔹 Move between changes in a file&lt;br&gt;
Path: Main Menu → Navigate → Navigate in File → Change Navigation Actions → Previous Change&lt;/p&gt;

&lt;p&gt;🔹 Navigate references without Ctrl + F&lt;br&gt;
Path: Main Menu → Edit → Find Usages → Next Highlighted&lt;/p&gt;

&lt;p&gt;🔹 Return to the last edit location&lt;br&gt;
Path: Main Menu → Navigate → Last Edit Location&lt;/p&gt;

&lt;p&gt;🔹 Quickly select text (closer to the function closure = more selection)&lt;br&gt;
Path: Editor Actions → Extend Selection&lt;/p&gt;

&lt;p&gt;Did you know these? 🚀&lt;/p&gt;

</description>
      <category>webstorm</category>
      <category>jetbrains</category>
      <category>shorcuts</category>
    </item>
    <item>
      <title>💡 5 little-known Git commands that will improve your workflow.</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Wed, 12 Feb 2025 07:23:29 +0000</pubDate>
      <link>https://dev.to/davidgarcia/5-little-known-git-commands-that-will-improve-your-workflow-242n</link>
      <guid>https://dev.to/davidgarcia/5-little-known-git-commands-that-will-improve-your-workflow-242n</guid>
      <description>&lt;p&gt;There's more to Git than commit, merge and checkout. Here are 5 commands that can make your life easier:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1️⃣ git switch - Switch branches without risk&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before Git 2.23, git checkout did too many things: switch branches, restore files and more. Now, git switch is a clearer and safer option:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Switch&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;an&lt;/span&gt; &lt;span class="nx"&gt;existing&lt;/span&gt; &lt;span class="nx"&gt;branch&lt;/span&gt;
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Creates&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;switches&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;branch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No more fear of overwriting files by mistake.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2️⃣ git restore - Revert changes without hassles&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To undo changes without modifying the branch or history:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;restore&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Discards&lt;/span&gt; &lt;span class="nx"&gt;uncommitted&lt;/span&gt; &lt;span class="nx"&gt;changes&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;restore&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;staged&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Removes&lt;/span&gt; &lt;span class="nx"&gt;changes&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;staging&lt;/span&gt; &lt;span class="nx"&gt;area&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid errors with checkout and reset, better separating operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3️⃣ git maintenance - Keep your repo fast and clean&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Large repos can get slow. git maintenance automates cleanup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;maintenance&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Triggers&lt;/span&gt; &lt;span class="nx"&gt;automatic&lt;/span&gt; &lt;span class="nx"&gt;maintenance&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;maintenance&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Runs&lt;/span&gt; &lt;span class="nx"&gt;optimization&lt;/span&gt; &lt;span class="nx"&gt;tasks&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reduces git status, fetch and log time effortlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4️⃣ git sparse-checkout - Work in monorepos without downloading everything&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you only need certain folders from a giant repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;sparse&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;sparse&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="kd"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;directory1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;directory2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download only what you need and save disk space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5️⃣ git worktree - Work on several branches without changing directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you need to work on different branches without stashing or changing folders:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;worktree&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;  
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ideal for revising code without affecting your main branch.&lt;/p&gt;

&lt;p&gt;Translated with &lt;a href="http://www.DeepL.com/Translator" rel="noopener noreferrer"&gt;www.DeepL.com/Translator&lt;/a&gt; (free version)&lt;/p&gt;

</description>
      <category>git</category>
      <category>developer</category>
    </item>
    <item>
      <title>💡 5 comandos de Git poco conocidos que mejorarán tu flujo de trabajo</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Wed, 12 Feb 2025 07:20:34 +0000</pubDate>
      <link>https://dev.to/davidgarcia/5-comandos-de-git-poco-conocidos-que-mejoraran-tu-flujo-de-trabajo-6o5</link>
      <guid>https://dev.to/davidgarcia/5-comandos-de-git-poco-conocidos-que-mejoraran-tu-flujo-de-trabajo-6o5</guid>
      <description>&lt;p&gt;Git tiene más que commit, merge y checkout. Aquí tienes 5 comandos que pueden hacerte la vida más fácil:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1️⃣ git switch - Cambia de rama sin riesgos&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Antes de Git 2.23, git checkout hacía demasiadas cosas: cambiaba de rama, restauraba archivos y más. Ahora, git switch es una opción más clara y segura:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;  &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Cambia&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;una&lt;/span&gt; &lt;span class="nx"&gt;rama&lt;/span&gt; &lt;span class="nx"&gt;existente&lt;/span&gt;
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="nx"&gt;nueva&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;rama&lt;/span&gt;   &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Crea&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="nx"&gt;cambia&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;una&lt;/span&gt; &lt;span class="nx"&gt;nueva&lt;/span&gt; &lt;span class="nx"&gt;rama&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ya no hay miedo de sobrescribir archivos por error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2️⃣ git restore - Revierte cambios sin complicaciones&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Para deshacer cambios sin modificar la rama o el historial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;restore&lt;/span&gt; &lt;span class="nx"&gt;archivo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;         &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Descarta&lt;/span&gt; &lt;span class="nx"&gt;cambios&lt;/span&gt; &lt;span class="nx"&gt;no&lt;/span&gt; &lt;span class="nx"&gt;confirmados&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;restore&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;staged&lt;/span&gt; &lt;span class="nx"&gt;archivo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Quita&lt;/span&gt; &lt;span class="nx"&gt;cambios&lt;/span&gt; &lt;span class="nx"&gt;del&lt;/span&gt; &lt;span class="nx"&gt;área&lt;/span&gt; &lt;span class="nx"&gt;de&lt;/span&gt; &lt;span class="nx"&gt;staging&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Evita errores con checkout y reset, separando mejor las operaciones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3️⃣ git maintenance - Mantén tu repo rápido y limpio&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Los repos grandes pueden volverse lentos. git maintenance automatiza la limpieza:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;maintenance&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt;  &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Activa&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="nx"&gt;mantenimiento&lt;/span&gt; &lt;span class="nx"&gt;automático&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;maintenance&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt;    &lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;Ejecuta&lt;/span&gt; &lt;span class="nx"&gt;tareas&lt;/span&gt; &lt;span class="nx"&gt;de&lt;/span&gt; &lt;span class="nx"&gt;optimización&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reduce el tiempo de git status, fetch y log sin esfuerzo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4️⃣ git sparse-checkout - Trabaja en monorepos sin descargar todo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Si solo necesitas ciertas carpetas de un repo gigante:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;sparse&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;  
&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;sparse&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;checkout&lt;/span&gt; &lt;span class="kd"&gt;set&lt;/span&gt; &lt;span class="nx"&gt;directorio1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;directorio2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Descarga solo lo necesario y ahorra espacio en disco.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5️⃣ git worktree - Trabaja en varias ramas sin cambiar de directorio&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Si necesitas trabajar en diferentes ramas sin hacer stash o cambiar de carpeta:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;worktree&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt; &lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;  
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="p"&gt;..&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;branch&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ideal para revisar código sin afectar tu rama principal.&lt;/p&gt;

</description>
      <category>git</category>
      <category>developer</category>
    </item>
    <item>
      <title>Beyond Code: The Role of a Software Developer/Architect</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Mon, 10 Feb 2025 06:13:15 +0000</pubDate>
      <link>https://dev.to/davidgarcia/beyond-code-the-role-of-a-software-developerarchitect-11cc</link>
      <guid>https://dev.to/davidgarcia/beyond-code-the-role-of-a-software-developerarchitect-11cc</guid>
      <description>&lt;p&gt;Being a software architect is not just about defining technical structures but also about making life easier for your team. It is a technical leadership role that balances vision, development, and collaboration. Here are some key principles I apply and consider essential for a software architect:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Constant Migration:&lt;/strong&gt;&lt;br&gt;
No technical debt: Don’t postpone framework and library updates (always migrate to stable versions). Keep everything up to date in each sprint to prevent future bottlenecks and ensure smooth development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Refactor within the Sprint:&lt;/strong&gt;&lt;br&gt;
Clean code—don’t put off until tomorrow what you can do today. AI can be your ally.&lt;br&gt;
Help the team understand why clean code makes their lives easier. Refactor with the team, not for the team.&lt;br&gt;
Incremental refactoring prevents technical debt accumulation and improves code maintainability. If another developer joins the project, it should be a great place to work, not a maze of obsolete code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Explore and Automate:&lt;/strong&gt;&lt;br&gt;
Don’t wait for perfect tools. If you see someone performing repetitive tasks, ask yourself if they can be automated.&lt;br&gt;
Create simple tools that save the team time.&lt;br&gt;
Share and teach how to use these automations.&lt;br&gt;
Don’t overcomplicate things—sometimes a simple script is better than an elaborate solution.&lt;/p&gt;

&lt;p&gt;Some useful script examples:&lt;/p&gt;

&lt;p&gt;Auto-merge in Jenkins to prevent unnecessary development flow blockages.&lt;/p&gt;

&lt;p&gt;Automatic task generation in Jira with predefined assignments.&lt;/p&gt;

&lt;p&gt;Release process automation to reduce manual errors and accelerate deployments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Teamwork:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Support the team daily with mentorship and technical guidance.&lt;/p&gt;

&lt;p&gt;Encourage collaborative challenges. Solving a task together improves solutions and fosters learning.&lt;/p&gt;

&lt;p&gt;Promote effective communication and knowledge sharing among team members. For example, organize a meeting to explain how you plan to solve something or how you’ve solved it, discussing the pros and cons—not just the final result.&lt;/p&gt;

&lt;p&gt;Remember that everyone has something valuable to contribute. Listen to and appreciate all team members' opinions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Learning Culture:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Share what you learn, no matter how small (even a simple shortcut can save hours of development).&lt;/p&gt;

&lt;p&gt;Learn from everyone, even juniors—they are often up to date with the latest trends.&lt;/p&gt;

&lt;p&gt;Don’t be afraid to say, "I don’t know, but we can figure it out together."&lt;/p&gt;

&lt;p&gt;Celebrate curiosity and the desire to learn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 IDE Productivity:&lt;/strong&gt;&lt;br&gt;
Mastering shortcuts and functionalities in your development environment is crucial. Many underestimate what a good IDE or customized setup can do for speed and efficiency. Tools like WebStorm (which I personally find much better than VSCode) or advanced Neovim customization can significantly enhance productivity. (I’ve been using Neovim for a couple of months and am still adapting).&lt;/p&gt;

&lt;p&gt;🔹 Long-Term Thinking:&lt;br&gt;
A good software architect should design with scalability, maintainability, and flexibility in mind. The technical decisions made today will impact the product’s lifespan in the future.&lt;/p&gt;

&lt;p&gt;🔹 Adaptability and Continuous Learning:&lt;br&gt;
Technology evolves constantly. Stay up to date with new trends, frameworks, and best practices. Experimenting and learning is a fundamental part of the role.&lt;/p&gt;

&lt;p&gt;An architect must balance technical vision, code, and collaboration. What other skills do you think are essential for this role? 🚀&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>architecture</category>
      <category>development</category>
      <category>developer</category>
    </item>
    <item>
      <title>Más Allá del Código: El Rol de un Desarrollador/Arquitecto de Software</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Mon, 10 Feb 2025 05:59:59 +0000</pubDate>
      <link>https://dev.to/davidgarcia/mas-alla-del-codigo-el-rol-de-un-desarrolladorarquitecto-de-software-1khc</link>
      <guid>https://dev.to/davidgarcia/mas-alla-del-codigo-el-rol-de-un-desarrolladorarquitecto-de-software-1khc</guid>
      <description>&lt;p&gt;Ser arquitecto de software no es solo definir estructuras técnicas, sino facilitar la vida de tu equipo. Es un rol de liderazgo técnico que equilibra visión, desarrollo y colaboración. Algunas claves que aplico y pienso que son esenciales para un arquitecto de software son:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Migración constante:&lt;/strong&gt; No deuda técnica: No dejes la actualización del framework y librerías “para después” (siempre migraciones de versiones estables) y actualiza en cada sprint para evitar bloqueos futuros y asegurar un desarrollo fluido.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Refactoriza en el sprint:&lt;/strong&gt; Código limpio, no dejes para mañana lo que puedas hacer hoy. La IA será tu buen aliado. Ayuda al equipo a entender por qué el código limpio les hace la vida más fácil. Refactoriza con el equipo, no para el equipo. La refactorización incremental evita la acumulación de deuda técnica y mejora la mantenibilidad del código. Si otro desarrollador cae en el proyecto, que sea un buen lugar para trabajar, no un laberinto de código obsoleto.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Explora y automatiza:&lt;/strong&gt; No esperes herramientas perfectas. Si ves que alguien hace algo repetitivo, pregúntate si se puede automatizar. Crea herramientas simples que ahorren tiempo al equipo. Comparte y enseña cómo usar estas automatizaciones. No compliques las cosas; a veces un script simple es mejor que una solución elaborada.&lt;/p&gt;

&lt;p&gt;Algunos ejemplos de scripts útiles:&lt;/p&gt;

&lt;p&gt;Auto-merge en Jenkins para evitar bloqueos innecesarios en el flujo de desarrollo.&lt;br&gt;
Generación automática de tareas en Jira con asignaciones predefinidas.&lt;br&gt;
Automatización del proceso de release para reducir errores manuales y acelerar despliegues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Trabajo en equipo:&lt;/strong&gt; Apoya al equipo en el día a día con mentoría y acompañamiento técnico.&lt;br&gt;
Fomenta retos colaborativos. Resolver una tarea entre varios mejora las soluciones y fomenta el aprendizaje.&lt;br&gt;
Promueve la comunicación efectiva y el intercambio de conocimientos entre los miembros del equipo. Por ejemplo, organiza una reunión y explica cómo piensas resolver algo o cómo lo has resuelto, junto con sus pros y contras, no solo el resultado final.&lt;br&gt;
Recuerda que cada persona tiene algo valioso que aportar. Escucha y valora las opiniones de todos los miembros del equipo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Cultura de aprendizaje:&lt;/strong&gt; Comparte lo que aprendes, por pequeño que sea (un simple atajo, por ejemplo, puede ahorrarte horas de desarrollo).&lt;br&gt;
Aprende de todos, incluso de los más júniors, muchas veces están al tanto de las últimas tendencias.&lt;br&gt;
No tengas miedo de decir “no sé, pero podemos averiguarlo juntos”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 Productividad en el IDE:&lt;/strong&gt; Dominar atajos y funcionalidades del entorno de desarrollo es clave. Muchos subestiman lo que un buen IDE o configuración personalizada puede hacer por su velocidad y eficiencia. Herramientas como WebStorm (para mí, mucho mejor que VSCode) o la personalización avanzada de Neovim pueden mejorar enormemente la productividad. (Llevo un par de meses en Neovim, aun en adaptación).&lt;/p&gt;

&lt;p&gt;🔹 Pensar en el largo plazo: Un buen arquitecto de software debe diseñar con escalabilidad, mantenimiento y flexibilidad en mente. Las decisiones técnicas de hoy impactarán la vida útil del producto en el futuro.&lt;/p&gt;

&lt;p&gt;🔹 Adaptabilidad y aprendizaje continuo: La tecnología evoluciona constantemente. Mantente al día con nuevas tendencias, frameworks y mejores prácticas. Experimentar y aprender es parte fundamental del rol.&lt;/p&gt;

&lt;p&gt;Un arquitecto debe equilibrar visión técnica, código y colaboración. ¿Qué otras habilidades crees que son clave en este rol? 🚀&lt;/p&gt;

</description>
      <category>developer</category>
      <category>architecture</category>
    </item>
    <item>
      <title>📌 Strongly Typed Forms in Angular Without Duplicating Interfaces</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Tue, 04 Feb 2025 21:12:06 +0000</pubDate>
      <link>https://dev.to/davidgarcia/strongly-typed-forms-in-angular-without-duplicating-interfaces-1972</link>
      <guid>https://dev.to/davidgarcia/strongly-typed-forms-in-angular-without-duplicating-interfaces-1972</guid>
      <description>&lt;p&gt;Angular’s documentation suggests defining both interfaces and a manually typed form model. But with TypeScript and recursive types, we can avoid duplication! 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Define a generic type:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;IToForm&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="kr"&gt;keyof&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;infer&lt;/span&gt; &lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;FormArray&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;U&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;FormGroup&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;IToForm&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormControl&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;U&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;FormControl&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;FormGroup&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;IToForm&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;FormControl&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;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;Now, create automatically typed forms:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;customerForm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;FormGroup&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;IToForm&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="na"&gt;addresses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormArray&lt;/span&gt;&lt;span class="p"&gt;([]),&lt;/span&gt;
  &lt;span class="na"&gt;preferences&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormGroup&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;newsletter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;FormControl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&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="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Benefits:&lt;br&gt;
🔹 No key name errors.&lt;br&gt;
🔹 Autocomplete in the editor.&lt;br&gt;
🔹 Less repetitive code.&lt;br&gt;
🔹 If you change the model, the entire code will be affected.&lt;/p&gt;

&lt;p&gt;📢 Have you tried this approach in your Angular forms? 🚀&lt;/p&gt;

</description>
      <category>angular</category>
      <category>angularforms</category>
      <category>typescript</category>
    </item>
    <item>
      <title>🚀 A Better Alternative to .get() in Angular Forms</title>
      <dc:creator>David Garcia</dc:creator>
      <pubDate>Tue, 04 Feb 2025 18:28:22 +0000</pubDate>
      <link>https://dev.to/davidgarcia/a-better-alternative-to-get-in-angular-forms-47mj</link>
      <guid>https://dev.to/davidgarcia/a-better-alternative-to-get-in-angular-forms-47mj</guid>
      <description>&lt;p&gt;If you’re using form.get('field') to access a control in a FormGroup, you’re not alone. It’s the most common approach, but there’s a &lt;strong&gt;safer and more type-friendly alternative.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 Why use .controls instead of .get()?&lt;br&gt;
**&lt;br&gt;
✅ **Type Safety&lt;/strong&gt; – .controls returns the exact type (FormControl, FormGroup, etc.), eliminating unnecessary type assertions.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Easier Access to Methods&lt;/strong&gt; – With a FormArray, for example, you can directly use form.controls.items.push(...).&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Better Intellisense&lt;/strong&gt; – Your IDE will autocomplete control names accurately.&lt;/p&gt;

&lt;p&gt;🔹 A small change that makes a big difference in your code. Do you use it, or are you still sticking with .get()? 💬&lt;/p&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
      <category>angularforms</category>
    </item>
  </channel>
</rss>
