<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Diego Novais - Software Engineer]]></title><description><![CDATA[Software Engineer | Elixir | Phoenix | Ruby | Ruby On Rails | Technical Writer.]]></description><link>https://blog.diegonovais.com.br</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1683259075538/JxMPl-SKg.png</url><title>Diego Novais - Software Engineer</title><link>https://blog.diegonovais.com.br</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Nov 2026 09:39:45 GMT</lastBuildDate><atom:link href="https://blog.diegonovais.com.br/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Closures: block, proc e lambda - Ruby]]></title><description><![CDATA[Blocks, Procs e Lambdas são referenciados de maneira geral como “closure” e que por sua vez são uns dos aspectos mais poderosos do Ruby e também um dos…]]></description><link>https://blog.diegonovais.com.br/closures-block-proc-e-lambda-ruby</link><guid isPermaLink="true">https://blog.diegonovais.com.br/closures-block-proc-e-lambda-ruby</guid><category><![CDATA[closure]]></category><category><![CDATA[lambda]]></category><category><![CDATA[Ruby]]></category><category><![CDATA[Developer]]></category><category><![CDATA[proc]]></category><dc:creator><![CDATA[Diego Novais]]></dc:creator><pubDate>Tue, 09 May 2023 14:44:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/VlZYu3nZIRI/upload/228f489399c93ecb7aba69a03f22e100.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Blocks, Procs e Lambdas são referenciados de maneira geral como “closure” e que por sua vez são uns dos aspectos mais poderosos do Ruby e também um dos mais complexos.</p>
<p>Para entedermos melhor que são closures precisamos compreender alguns conceitos:</p>
<h3 id="heading-escopo-lexico">Escopo léxico</h3>
<p>O escopo léxico serve para identificar qual o valor de uma variável em determinado lugar do código, daí o conceito chamado <strong>Closest Variable Wins</strong> (A variável mais próxima vence), ou seja, a atribuição de valor mais próxima dessa variável, será quem define o valor da mesma.</p>
<p>Ou seja, definindo as variáveis com o mesmo valor, mais próxima do comando <code>puts "#{prefix} #{name}"</code>, estas variáveis dentro do escopo terá o valor "Sra" e "Loren" e não mais "Sr" e "Diego" como foram definidas anteriormente. Essa é uma regra do escopo léxico, a variável mais próxima, vence.</p>
<pre><code class="lang-ruby">prefix = <span class="hljs-string">'Sr'</span>
name = <span class="hljs-string">'Diego'</span>

<span class="hljs-number">4</span>.times <span class="hljs-keyword">do</span>
    prefix = <span class="hljs-string">'Sra'</span>
    name = <span class="hljs-string">'Loren'</span>
    msg = <span class="hljs-string">'Olá!'</span>

    puts <span class="hljs-string">"<span class="hljs-subst">#{msg}</span> <span class="hljs-subst">#{prefix}</span> <span class="hljs-subst">#{name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Sra Loren
=&gt; Sra Loren
=&gt; Sra Loren
=&gt; Sra Loren
</code></pre>
<h3 id="heading-variavel-livre">Variável livre</h3>
<p>Variável livre é uma variável definida em um escopo acima do escopo atual, ou seja no escopo pai. A variável livre no exemplo acima, seriam então as variáveis <code>prefix</code> e <code>name</code> definidas nas primeiras linhas. Ja a variável <code>msg</code> utilizada está dentro do mesmo escopo de execução, portanto não é uma variável livre.</p>
<h2 id="heading-closures">Closures</h2>
<p>"Uma função que pode ser guardada como variável", talvez essa seja a definição mais famosa de Closure. Segundo Wei Hao em seu livro Mastering Ruby Closures, os conceitos acima comentados (escopo léxico e variável livre) são alguns dos principais conceitos para se entender Closures, como o mesmo explica, "Closure é uma função que o seu corpo referencia uma variável declarada no escopo pai". Segundo o Ruby Guides as Closures "capturam o escopo de execução atual" e "carregam variáveis e métodos vindos do contexto atual em que foram definidas", mas "não carregam valores e sim referências, portanto se as variáveis forem alteradas após criadas, as Procs sempre terão a última versão dessa variável".</p>
<p>Closure é uma funcionalidade que permite escrever um pedaço de código que:</p>
<ul>
<li><p>Pode ser atribuído e ou passado como parâmetro.</p>
</li>
<li><p>Uma função que pode ser guardada como variável</p>
</li>
<li><p>Pode ser executado em qualquer lugar.</p>
</li>
<li><p>E referenciam variáveis no contexto onde são criados.</p>
</li>
</ul>
<h2 id="heading-block">Block</h2>
<p>Ruby blocks como o Ruby Guides define, "são pequenas funções anônimas que podem ser passadas nos métodos". Podemos identificar Ruby Blocks quando vemos ou escrevemos no código comandos dentro dos <code>do / end</code> ou entre chaves <code>{block}</code> e os argumentos vão dentro de pipes <code>|args|</code>. Métodos famosos como o <code>.each</code>, <code>.times</code> e outros são bons exemplos de Blocks.</p>
<pre><code class="lang-ruby">method { <span class="hljs-params">|i|</span> ... }

method <span class="hljs-keyword">do</span> <span class="hljs-params">|i|</span>
  ...
<span class="hljs-keyword">end</span>
</code></pre>
<p>Ex. usando o <code>each</code>:</p>
<pre><code class="lang-ruby">[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>].each <span class="hljs-keyword">do</span> <span class="hljs-params">|number|</span>
  puts number
<span class="hljs-keyword">end</span>
</code></pre>
<p>Ex. usando o <code>times</code>:</p>
<pre><code class="lang-ruby">prefix = <span class="hljs-string">'Sr'</span>
name = <span class="hljs-string">'Diego'</span>

<span class="hljs-number">4</span>.times <span class="hljs-keyword">do</span>
    puts <span class="hljs-string">"<span class="hljs-subst">#{prefix}</span> <span class="hljs-subst">#{name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Sr Diego
=&gt; Sr Diego
=&gt; Sr Diego
=&gt; Sr Diego
</code></pre>
<h3 id="heading-como-criar-um-block">Como criar um block?</h3>
<p>Imagine o seguinte cenário, onde devemos criar um método para ira concatenar por meio de interpolação o seu primeiro nome e seu ultimo nome</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">full_name</span></span>
    first_name = <span class="hljs-string">'Diego'</span>
    last_name = <span class="hljs-string">'Novais'</span>

    <span class="hljs-string">"<span class="hljs-subst">#{first_name}</span> <span class="hljs-subst">#{last_name}</span>"</span>
<span class="hljs-keyword">end</span>

puts full_name

=&gt; Diego Novais
</code></pre>
<p>Se formos refatorar o método usando block:</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">full_name</span></span>
    <span class="hljs-keyword">yield</span>
<span class="hljs-keyword">end</span>

full_name <span class="hljs-keyword">do</span>
    first_name = <span class="hljs-string">'Diego'</span>
    last_name = <span class="hljs-string">'Novais'</span>

    <span class="hljs-string">"<span class="hljs-subst">#{first_name}</span> <span class="hljs-subst">#{last_name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Diego Novais
</code></pre>
<p>Podemos deixar nosso block mais dinâmico passando argumentos para nosso método e assim utilizando como parâmetros em nosso block:</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">full_name</span><span class="hljs-params">(prefix)</span></span>
    puts prefix + <span class="hljs-keyword">yield</span>
<span class="hljs-keyword">end</span>

full_name(<span class="hljs-string">'Sr. '</span>) <span class="hljs-keyword">do</span> <span class="hljs-params">|prefix|</span>
    first_name = <span class="hljs-string">'Diego'</span>
    last_name = <span class="hljs-string">'Novais'</span>

    <span class="hljs-string">"<span class="hljs-subst">#{first_name}</span> <span class="hljs-subst">#{last_name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Sr. Diego Novais
</code></pre>
<p>Como ultimo exemplo para fixar vamos criar nosso próprio <code>each</code> :</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">my_each</span><span class="hljs-params">(array)</span></span>
  i = <span class="hljs-number">0</span>

  <span class="hljs-keyword">while</span> i &lt; array.size <span class="hljs-keyword">do</span>
    <span class="hljs-keyword">yield</span> array[i]
    i += <span class="hljs-number">1</span>
  <span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span>

array = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>]

my_each(array) <span class="hljs-keyword">do</span> <span class="hljs-params">|number|</span>
  puts number
<span class="hljs-keyword">end</span>
</code></pre>
<p>Podemos também passar um block como parâmetro para um método:</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">full_name</span><span class="hljs-params">(&amp;block)</span></span>
    block.call
<span class="hljs-keyword">end</span>

full_name <span class="hljs-keyword">do</span>
    first_name = <span class="hljs-string">'Diego'</span>
    last_name = <span class="hljs-string">'Novais'</span>

    <span class="hljs-string">"<span class="hljs-subst">#{first_name}</span> <span class="hljs-subst">#{last_name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Diego Novais
</code></pre>
<p>Mais um exemplo:</p>
<pre><code class="lang-ruby"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">full_name</span><span class="hljs-params">(prefix, &amp;block)</span></span>
    puts prefix + block.call
<span class="hljs-keyword">end</span>

full_name(<span class="hljs-string">'Sr. '</span>) <span class="hljs-keyword">do</span> <span class="hljs-params">|prefix|</span>
    first_name = <span class="hljs-string">'Diego'</span>
    last_name = <span class="hljs-string">'Novais'</span>

    <span class="hljs-string">"<span class="hljs-subst">#{first_name}</span> <span class="hljs-subst">#{last_name}</span>"</span>
<span class="hljs-keyword">end</span>

=&gt; Sr. Diego Novais
</code></pre>
<h2 id="heading-proc">Proc</h2>
<p>Um <strong>Proc</strong> se parece bastante com uma <strong>lambda</strong>, porém, caso não passe os argumentos não será disparado nenhum erro, pois um <code>proc</code> não se importa se irá passar um argumento ou não., vamos analisar isso com um pouco mais de código:</p>
<pre><code class="lang-ruby">say_something = proc { puts <span class="hljs-string">"Something..."</span>  }
say_something.call

=&gt; Something...
</code></pre>
<p>ou ...</p>
<pre><code class="lang-ruby">say_something = Proc.new <span class="hljs-keyword">do</span>
    puts <span class="hljs-string">'Something...'</span>
<span class="hljs-keyword">end</span>

say_something.call

=&gt; Something...
</code></pre>
<p>Podemos também passar argumentos para um <strong>Proc</strong>:</p>
<pre><code class="lang-ruby">say_something = Proc.new <span class="hljs-keyword">do</span> <span class="hljs-params">|name|</span>
    puts <span class="hljs-string">"Hello <span class="hljs-subst">#{name}</span>"</span>
<span class="hljs-keyword">end</span>

say_something.call(<span class="hljs-string">'Diego'</span>)

=&gt; Hello Diego
</code></pre>
<p>Se não passarmos o argumento para um Proc, ele não ira se importar e não ira disparar um erro, considerando o exemplo anterior:</p>
<pre><code class="lang-ruby">say_something.call

=&gt; Hello
</code></pre>
<h2 id="heading-lambda">Lambda</h2>
<p>Uma <strong>Lambda</strong> se parece mais com uma <strong>função</strong> do que uma <strong>Proc</strong>, principalmente pelo fato de respeitar os argumentos e pelo seu retorno, vamos analisar isso com um pouco mais de código, começando por algumas formas de definir um Lambda:</p>
<pre><code class="lang-ruby"><span class="hljs-comment"># say_something = lambda { puts "Something..."  }</span>
<span class="hljs-comment"># ou...</span>

say_something = -&gt; { puts <span class="hljs-string">"Something..."</span>  }
say_something.call

=&gt; Something...
</code></pre>
<p>Podemos também passar argumentos para uma lambda:</p>
<pre><code class="lang-ruby">say_something = -&gt; (name) { puts <span class="hljs-string">"Hello <span class="hljs-subst">#{name}</span>"</span>  }
say_something.call(<span class="hljs-string">'Diego'</span>)

=&gt; Hello Diego
</code></pre>
<p>Obs.: se não passarmos o argumento um lambda dispara um erro.</p>
<h3 id="heading-lambda-como-blocos">Lambda como blocos</h3>
<p>Podemos também criar lambdas como blocks:</p>
<pre><code class="lang-ruby">say_something = lambda <span class="hljs-keyword">do</span> <span class="hljs-params">|name|</span>
    puts <span class="hljs-string">"Hello <span class="hljs-subst">#{name}</span>"</span>
<span class="hljs-keyword">end</span>

say_something.call(<span class="hljs-string">'Diego'</span>)
</code></pre>
<p>Espero que este conteúdo possa ter te ajudado a compreender mais sobre Closures, block, proc e lambda. Te vejo no próximo conteúdo.</p>
]]></content:encoded></item><item><title><![CDATA[Setting the version of a Gem on Gemfile]]></title><description><![CDATA[Greetings Rubysts, Setting the version of a Gem in the Gemfile is an essential step in managing dependencies for a Ruby project. The Gemfile allows you to…]]></description><link>https://blog.diegonovais.com.br/setting-the-version-of-a-gem-on-gemfile</link><guid isPermaLink="true">https://blog.diegonovais.com.br/setting-the-version-of-a-gem-on-gemfile</guid><category><![CDATA[Ruby]]></category><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[dependency management]]></category><category><![CDATA[software development]]></category><category><![CDATA[Gemfile]]></category><dc:creator><![CDATA[Diego Novais]]></dc:creator><pubDate>Tue, 09 May 2023 03:21:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/qayNP9ccw9E/upload/88561eaa88f2511d5324c4006cc60536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Greetings Rubysts,</p>
<p>Setting the version of a Gem in the Gemfile is an essential step in managing dependencies for a Ruby project. The Gemfile allows you to specify the version of a Gem that your project requires, ensuring that all project contributors are using the same version of the Gem and minimizing the risk of compatibility issues. This can be especially important if your project relies on multiple Gems or if you are working on a large team. Additionally, specifying the version of a Gem in the Gemfile can help ensure that your project remains stable and secure by allowing you to control when and how updates to the Gem are applied. Below are some examples of how to do this:</p>
<ol>
<li><strong>Use a specific version:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>, <span class="hljs-string">'1.2.3'</span>
</code></pre>
<p>In this example, we set the specific version <code>1.2.3</code> of the Gem <code>example_gem</code>.</p>
<ol>
<li><strong>Setting only a range of compatible versions of the Gem:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>, <span class="hljs-string">'~&gt; 1.2.0'</span>
</code></pre>
<p>This means that your project depends on the gem called example_gem, and the specified version should be greater than or equal to 1.2.0, but less than 1.3.0.</p>
<p>In other words, the ~&gt; operator allows for minor updates (the last version number) to be automatically installed, as long as the major version (first number) and the minor version (second number) remain the same.</p>
<p>For example, if a new version 1.2.5 or 1.2.6 is released, the Bundler will allow it to be automatically installed, but if a new version 1.3.0 is released, the Bundler will not automatically update because that version is no longer within the specified range of constraint.</p>
<ol>
<li><strong>Setting an interval between the accepted versions of the Gem:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>, <span class="hljs-string">'&gt;= 1.2.0'</span>, <span class="hljs-string">'&lt; 1.3.0'</span>
</code></pre>
<p>In this example, only the versions greater than <code>1.2.0</code> and less than <code>1.3.0</code> will be accepted.</p>
<ol>
<li><strong>Setting the last version of the gem:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>
</code></pre>
<p>In this case, the most recent version of the gem will be installed.</p>
<ol>
<li><strong>Setting a custom repository and branch for the gem:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>, <span class="hljs-symbol">git:</span> <span class="hljs-string">'https://github.com/user/example_gem.git'</span>, <span class="hljs-symbol">branch:</span> <span class="hljs-string">'master'</span>
</code></pre>
<p>Here the gem <code>example_gem</code> will be installed from a custom repository on Github and its branch.</p>
<ol>
<li><strong>Setting a local path for the gem:</strong></li>
</ol>
<pre><code class="lang-ruby">gem <span class="hljs-string">'example_gem'</span>, <span class="hljs-symbol">path:</span> <span class="hljs-string">'/path/to/exam_gem'</span>
</code></pre>
<p>In some cases, it may be necessary or useful to install a Gem from a local path instead of from a remote source such as <a target="_blank" href="http://rubygems.org">rubygems.org</a>. This can be helpful for development and testing purposes, for example, when you are working on a Gem locally and want to test it in another project without publishing it to a remote repository. In this case, the Gemfile includes the gem example_gem with the path to the local directory where the Gem is stored. This approach can help streamline development and testing processes and ensure that the Gem is being used consistently across projects.</p>
<p>I hope that this content was useful for you! See you in the next article!</p>
]]></content:encoded></item><item><title><![CDATA[Fixing the error: can't find gem bundler]]></title><description><![CDATA[Greetings friends! If you are in a rails project and need to install the gem bundler, but you got this error: The best way to install the gem bundler and…]]></description><link>https://blog.diegonovais.com.br/fixing-the-error-cant-find-gem-bundler</link><guid isPermaLink="true">https://blog.diegonovais.com.br/fixing-the-error-cant-find-gem-bundler</guid><category><![CDATA[Bundler]]></category><category><![CDATA[Ruby on Rails]]></category><category><![CDATA[error fixing]]></category><dc:creator><![CDATA[Diego Novais]]></dc:creator><pubDate>Wed, 26 Apr 2023 13:28:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/5b6AfmGN9AE/upload/2abcd07336347ace889436f74d23c4d1.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Greetings friends!</p>
<p>If you are in a rails project and need to install the gem <code>bundler</code>, but you got this error:</p>
<pre><code class="lang-bash">can<span class="hljs-string">'t find gem bundler (&gt;= 0.a)</span>
</code></pre>
<p>The best way to install the gem bundler and avoid or fix this error is to install the bundler gem by getting the specific version contained in the <code>Gemfile.lock</code> with the command below:</p>
<pre><code class="lang-bash">gem install bundler -v <span class="hljs-string">"<span class="hljs-subst">$(grep -A 1 <span class="hljs-string">"BUNDLED WITH"</span> Gemfile.lock | tail -n 1)</span>"</span>
</code></pre>
<p>I hope that this content helps you! See you in the next article!</p>
]]></content:encoded></item><item><title><![CDATA[Installing lower version of Ruby using ASDF]]></title><description><![CDATA[Installing lower version of Ruby using ASDF]]></description><link>https://blog.diegonovais.com.br/installing-lower-version-of-ruby-using-asdf</link><guid isPermaLink="true">https://blog.diegonovais.com.br/installing-lower-version-of-ruby-using-asdf</guid><category><![CDATA[Ruby]]></category><category><![CDATA[Installation]]></category><category><![CDATA[Developer]]></category><category><![CDATA[tips and tricks]]></category><dc:creator><![CDATA[Diego Novais]]></dc:creator><pubDate>Mon, 17 Apr 2023 22:01:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/VKLJ-BJlszE/upload/ff884b51ca7c75ad6f3c83b23b5963e5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Greetings! The other day, I was having trouble installing a lower version of <strong>Ruby</strong> using <code>ASDF</code> and after trying to solve around a bit, I figured out a solution. This solution might not work for everyone, but I wanted to share it in case it helps.  </p>
<p>If you need to install a lower version of <strong>Ruby</strong> using <code>ASDF</code> and you are using a <strong>Mac OS</strong> and a chip <strong>M1</strong>:</p>
<pre><code class="lang-bash">asdf install ruby 2.5.6
</code></pre>
<p>and get this error:</p>
<pre><code class="lang-bash">Downloading openssl-1.1.1q.tar.gz...
-&gt; https://dqw8nmjcqpjn7.cloudfront.net/d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
Installing openssl-1.1.1q...
patching file <span class="hljs-string">'test/v3ext.c'</span>
Installed openssl-1.1.1q to /Users/diegonovais/.asdf/installs/ruby/2.5.6

Downloading ruby-2.5.6.tar.gz...
-&gt; https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.6.tar.gz
Installing ruby-2.5.6...

WARNING: ruby-2.5.6 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

ruby-build: using readline from homebrew

BUILD FAILED (macOS 13.1 using ruby-build 20220910.1)

Inspect or clean up the working tree at /var/folders/tz/30dwng7x0yj3wx155zn208rh0000gn/T/ruby-build.20230417122109.83173.Iy6xtk
Results logged to /var/folders/tz/30dwng7x0yj3wx155zn208rh0000gn/T/ruby-build.20230417122109.83173.log

Last 10 <span class="hljs-built_in">log</span> lines:
compiling ../.././ext/psych/yaml/emitter.c
compiling ../.././ext/psych/yaml/parser.c
5 warnings generated.
26 warnings generated.
linking shared-object zlib.bundle
1 warning generated.
linking shared-object psych.bundle
436 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2
</code></pre>
<p><strong>To fix it</strong>, you need to run the following command:</p>
<pre><code class="lang-bash">RUBY_CFLAGS=<span class="hljs-string">"-w"</span> asdf install ruby 2.5.6
</code></pre>
<p>I hope that this content helps you! See you in the next article!</p>
]]></content:encoded></item><item><title><![CDATA[4 Stages Of Problem Solving]]></title><description><![CDATA[As software developers, we are faced with an array of tasks and problems that require our attention and expertise daily. To address these challenges, based…]]></description><link>https://blog.diegonovais.com.br/4-stages-of-problem-solving</link><guid isPermaLink="true">https://blog.diegonovais.com.br/4-stages-of-problem-solving</guid><category><![CDATA[Productivity]]></category><category><![CDATA[problem solving skills]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Diego Novais]]></dc:creator><pubDate>Wed, 12 Apr 2023 19:08:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1681326366547/eaff4cad-ca8e-4997-b39c-57bdc9c62603.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As software developers, we are faced with an array of tasks and problems that require our attention and expertise daily. To address these challenges, based on my studies, I rely on a problem-solving strategy that consists of four stages.</p>
<p><img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zxgsw28dzccqjj4lwz8q.png" alt="4 Stages Of Problem Solving" /></p>
<h3 id="heading-1-analyze">1 - Analyze</h3>
<p>The first stage involves understanding the available resources and constraints of the problem. By assessing the resources at our disposal and identifying any limitations, we can gain a clear understanding of what is required to solve the problem effectively.</p>
<h3 id="heading-2-plan">2 - Plan</h3>
<p>The second stage is to write a program that outlines the steps needed to solve the problem. This plan of action serves as a roadmap that guides us toward a successful resolution.</p>
<h3 id="heading-3-implement">3 - Implement</h3>
<p>The third stage is to execute the program to obtain the desired results. By doing so, we can confirm that our solution is indeed effective and meets the requirements of the problem.</p>
<h3 id="heading-4-evaluate">4 - Evaluate</h3>
<p>Lastly, we match the results of the program with the desired output to determine if the problem has been successfully solved. This allows us to verify that our solution is accurate and meets the expectations of the stakeholders involved.</p>
<p>By following this four-stage problem-solving strategy, software developers can approach problems in a structured and systematic manner, leading to more efficient and effective solutions.</p>
<p>This four-stage problem-solving strategy is not only effective in the context of software development but can also be applied to various real-life situations. By breaking down complex problems into smaller, more manageable steps and following a structured approach, we can approach challenges with greater confidence and achieve successful outcomes.</p>
]]></content:encoded></item></channel></rss>