<?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: Gustavo Oliveira</title>
    <description>The latest articles on DEV Community by Gustavo Oliveira (@gustavo_oliveira_1e7fcebe).</description>
    <link>https://dev.to/gustavo_oliveira_1e7fcebe</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%2F1595025%2F1a9d432d-4913-4d34-91e0-6683a55023ca.jpg</url>
      <title>DEV Community: Gustavo Oliveira</title>
      <link>https://dev.to/gustavo_oliveira_1e7fcebe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gustavo_oliveira_1e7fcebe"/>
    <language>en</language>
    <item>
      <title>💡 Pain Is About Avoiding Pain in the Future - Reflections on The Pragmatic Programmer</title>
      <dc:creator>Gustavo Oliveira</dc:creator>
      <pubDate>Tue, 22 Jul 2025 10:41:20 +0000</pubDate>
      <link>https://dev.to/gustavo_oliveira_1e7fcebe/pain-is-about-avoiding-pain-in-the-future-reflections-on-the-pragmatic-programmer-4075</link>
      <guid>https://dev.to/gustavo_oliveira_1e7fcebe/pain-is-about-avoiding-pain-in-the-future-reflections-on-the-pragmatic-programmer-4075</guid>
      <description>&lt;h1&gt;
  
  
  💡 Pain Is About Avoiding Pain in the Future
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Reflections on The Pragmatic Programmer&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Programming is about trying to make the future less painful.&lt;br&gt;&lt;br&gt;
It’s about making things easier for our teammate.&lt;br&gt;&lt;br&gt;
It’s about getting things wrong and being able to bounce back.&lt;br&gt;&lt;br&gt;
It is about good habits.&lt;br&gt;&lt;br&gt;
It’s about understanding your toolset.”&lt;/em&gt;&lt;br&gt;&lt;br&gt;
— &lt;em&gt;The Pragmatic Programmer, 20th Anniversary Edition&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧭 Introduction
&lt;/h2&gt;

&lt;p&gt;When I first read this paragraph from &lt;em&gt;The Pragmatic Programmer&lt;/em&gt;, it really hit me. For most of my career, I was focused on learning technologies and applying them at work. I thought that was enough.&lt;/p&gt;

&lt;p&gt;But I was wrong.&lt;/p&gt;

&lt;p&gt;I used to obsess over writing "clean code" mostly because I didn't want anyone to read my code and think poorly of me. But this reflection made me realize it goes way deeper than that.&lt;/p&gt;

&lt;p&gt;Writing good code isn’t just about elegance or syntax. It’s about &lt;strong&gt;reducing future pain&lt;/strong&gt; — for the next engineer who needs to maintain it, for the company that needs to scale, and for the users who expect stability. It's about making decisions today that reduce friction tomorrow.&lt;/p&gt;

&lt;p&gt;Ultimately, it’s about &lt;strong&gt;empathy&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Good Habits Go Beyond Personal Life
&lt;/h2&gt;

&lt;p&gt;I’ve always cared about good habits — sleep, discipline, learning consistently — but I never realized how directly they impact how I code and how I contribute to the company.&lt;/p&gt;

&lt;p&gt;When I don’t sleep well, I’m more likely to take shortcuts. I may skip testing or delay proper planning. That might not hurt today, but the pain always comes later — for me or someone else.&lt;/p&gt;

&lt;p&gt;Improving just 1% every day — in communication, in focus, in mastery of tools — compounds. And the quality of my work reflects it.&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 Reflections on Each Line
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ "Programming is about trying to make the future less painful."
&lt;/h3&gt;

&lt;p&gt;This made me reflect on times I built projects that scaled to thousands of users — and how much pain I caused by not thinking ahead.&lt;/p&gt;

&lt;p&gt;I once built a system without asking basic architectural questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many data events per minute will we receive?&lt;/li&gt;
&lt;li&gt;What are the limits of our DB connection pool?&lt;/li&gt;
&lt;li&gt;What happens if a user sends a large payload?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was thinking in code, not in &lt;strong&gt;architecture&lt;/strong&gt;. And we paid the price later. Painful scaling, fragile systems, rushed fixes. I now know that a few small questions early on could have saved us hours (or days) of rework.&lt;/p&gt;




&lt;h3&gt;
  
  
  🤝 "It’s about making things easier for our teammate."
&lt;/h3&gt;

&lt;p&gt;This one struck me emotionally.&lt;/p&gt;

&lt;p&gt;Imagine your teammate is your neighbor. They knock on your door asking for help. Would you ignore them? No — you’d offer a hand.&lt;/p&gt;

&lt;p&gt;Why not do the same in code?&lt;/p&gt;

&lt;p&gt;Clear names, good docs, helpful comments — they’re small acts of &lt;strong&gt;professional kindness&lt;/strong&gt;. They turn frustration into flow for the next person.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 "It’s about getting things wrong and being able to bounce back."
&lt;/h3&gt;

&lt;p&gt;We will get things wrong. And that’s okay — &lt;strong&gt;as long as we learn&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the past, I missed planning details. But instead of blaming tools or teammates, I started asking better questions before coding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who is the user?&lt;/li&gt;
&lt;li&gt;What’s the real problem?&lt;/li&gt;
&lt;li&gt;What edge cases are likely?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bouncing back isn’t about perfection. It’s about responsibility.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔧 "It is about good habits."
&lt;/h3&gt;

&lt;p&gt;I now see that my daily routine shapes my engineering. When I take care of my health, stay focused, and practice intention — I write better code.&lt;/p&gt;

&lt;p&gt;Even simple habits like reviewing my commits, naming functions clearly, or taking time to test edge cases — they matter.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧰 "It’s about understanding your toolset."
&lt;/h3&gt;

&lt;p&gt;A good developer doesn’t just write code — they &lt;strong&gt;wield tools with intention&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I’ve spent time improving how I use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My editor (shortcuts, snippets)&lt;/li&gt;
&lt;li&gt;Testing tools (naming, coverage, mocks)&lt;/li&gt;
&lt;li&gt;Git (atomic commits, rebases)&lt;/li&gt;
&lt;li&gt;The terminal (scripts, automation)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mastery isn't about showing off. It’s about &lt;strong&gt;flow&lt;/strong&gt;. When you know your tools, they disappear — and your attention stays on the problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ How I Practice This Today
&lt;/h2&gt;

&lt;p&gt;Here are a few things I now do that reflect this mindset:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Before coding&lt;/strong&gt;, I ask: What value will this bring to the team, user, and company?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I embrace mistakes&lt;/strong&gt; as part of the process — they’re feedback loops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I plan with care&lt;/strong&gt;, like a craftsman: writing tests before features, considering edge cases, and naming things with clarity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I write to the future&lt;/strong&gt; — for the engineer who reads my code months from now (who might be me).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧾 Final Thought
&lt;/h2&gt;

&lt;p&gt;Your code changes the future.&lt;/p&gt;

&lt;p&gt;It may save hours of frustration. Or it may cost them.&lt;/p&gt;

&lt;p&gt;You decide — every time you open your editor.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What about you? Have you ever changed your coding philosophy after reading a single paragraph? Reach out on &lt;a href="https://twitter.com/WebDevFuel" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; — I’d love to hear your story.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mastering Concurrent Programming in Elixir</title>
      <dc:creator>Gustavo Oliveira</dc:creator>
      <pubDate>Wed, 17 Jul 2024 10:32:26 +0000</pubDate>
      <link>https://dev.to/gustavo_oliveira_1e7fcebe/mastering-concurrent-programming-in-elixir-cjf</link>
      <guid>https://dev.to/gustavo_oliveira_1e7fcebe/mastering-concurrent-programming-in-elixir-cjf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Concurrent programming can significantly improve an application's performance, responsiveness, and resource utilization. In this article, we'll explore how Elixir leverages the Erlang Virtual Machine to simplify concurrent operations. Whether you're new to Elixir or seasoned, you'll gain valuable insights and practical tips to elevate your programming skills.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Concurrent Programming in Elixir
&lt;/h2&gt;

&lt;p&gt;Concurrency in programming is key to handling multiple operations simultaneously, leading to improved performance and user experience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improved Performance&lt;/strong&gt;: Efficient utilization of system resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsiveness&lt;/strong&gt;: Ensures that applications handle multiple tasks at once seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Utilization&lt;/strong&gt;: Optimizes the capacity and throughput of the system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Elixir’s Process Model
&lt;/h2&gt;

&lt;p&gt;In Elixir, lightweight processes manage concurrency, inspired by the actor model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spawning Processes
&lt;/h3&gt;

&lt;p&gt;Creating new processes is simple with the &lt;code&gt;spawn&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;
&lt;span class="n"&gt;spawn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Hello from a new process!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Messaging Between Processes
&lt;/h3&gt;

&lt;p&gt;Message passing allows processes to interact while remaining isolated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;send&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="ss"&gt;:hello&lt;/span&gt;

&lt;span class="k"&gt;receive&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="ss"&gt;:hello&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Received a hello message"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;puts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Unknown message"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Linking and Monitoring Processes
&lt;/h3&gt;

&lt;p&gt;Processes can be linked and monitored for fault tolerance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="n"&gt;pid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;spawn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="s2"&gt;"oops"&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;Process&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Leveraging the OTP Framework
&lt;/h2&gt;

&lt;p&gt;Elixir's Open Telecom Platform (OTP) provides a set of libraries and design principles for building robust applications:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Supervisors
&lt;/h3&gt;

&lt;p&gt;Supervisors monitor worker processes and restart them if they fail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="no"&gt;Supervisor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start_link&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;MyWorker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])],&lt;/span&gt; &lt;span class="ss"&gt;strategy:&lt;/span&gt; &lt;span class="ss"&gt;:one_for_one&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Implementing GenServer
&lt;/h3&gt;

&lt;p&gt;GenServer simplifies managing state and server lifecycles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="k"&gt;defmodule&lt;/span&gt; &lt;span class="no"&gt;MyServer&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="no"&gt;GenServer&lt;/span&gt;

  &lt;span class="c1"&gt;# Starts the server&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="n"&gt;start_link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;initial_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="no"&gt;GenServer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start_link&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;__MODULE__&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;initial_value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;name:&lt;/span&gt; &lt;span class="bp"&gt;__MODULE__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="c1"&gt;# Handles synchronous calls&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="n"&gt;handle_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:get&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="ss"&gt;:reply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices for Concurrent Programming
&lt;/h2&gt;

&lt;p&gt;Follow these best practices for effective concurrent programming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Avoid Shared State&lt;/strong&gt;: Keep each process's state independent to prevent conflicts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimize Message Passing&lt;/strong&gt;: Reduce messaging frequency and complexity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design with Supervision&lt;/strong&gt;: Use supervision trees for managing process lifecycles.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Elixir's concurrency model, rooted in the Erlang VM, enables the building of high-performance, fault-tolerant applications. By mastering process management, message passing, and the OTP framework, you'll be well-equipped to harness the full potential of concurrent programming in Elixir.&lt;/p&gt;

&lt;h2&gt;
  
  
  Call to Action
&lt;/h2&gt;

&lt;p&gt;Have you explored Elixir's concurrency features? Share your experiences below. For more, check out our Elixir programming resources.&lt;/p&gt;

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