<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Terminal Root</title>
    <description>Um pouco de muito sobre C++, Programação e Desenvolvimento de Games e Web.
</description>
    <link>https://terminalroot.com.br/</link>
    <atom:link href="https://terminalroot.com.br/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 01 Apr 2026 12:23:31 +0000</pubDate>
    <lastBuildDate>Wed, 01 Apr 2026 12:23:31 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Gere Circuitos Lógicos com Python</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/python/python-tip-02.jpg&quot; alt=&quot;Gere Circuitos Lógicos com Python&quot; title=&quot;Desenhe e conecte portas: AND, OR, NOT, NAND, etc&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;dependências&quot;&gt;Dependências&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Windows, instale o &lt;a href=&quot;https://pip.pypa.io/en/stable/installation/&quot;&gt;PIP&lt;/a&gt; e depois instale o Schemdraw com o PIP:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;schemdraw&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Em GNU, Linux e UNIX, crie um ambiente virtual e instale com o PIP:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; ~/.local/bin
python &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; venv ~/.local/bin/venv
&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; ~/.local/bin/venv/bin/activate
pip &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;schemdraw&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Código Python:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;schemdraw&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;schemdraw.logic&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;logic&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;schemdraw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Drawing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;logic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;And&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;inputs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;blue&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;logic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Or&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;green&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;logic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Not&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;red&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;draw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;aprenda-python&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/python&quot;&gt;Aprenda Python&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;httpsterminalrootcombrpython&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/python&quot;&gt;https://terminalroot.com.br/python&lt;/a&gt;&lt;/h3&gt;

</description>
        <pubDate>Wed, 25 Mar 2026 10:56:19 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/gere-circuitos-logicos-com-python.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/gere-circuitos-logicos-com-python.html</guid>
        
        <category>python</category>
        
        
      </item>
    
      <item>
        <title>Instale esse Scanner de Rede Moderno modo TUI</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/go/nibble.jpg&quot; alt=&quot;Instale esse Scanner de Rede Moderno modo TUI&quot; title=&quot;Feito em Go e muito rápido e sem dor de cabeça.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Se você já usou ferramentas como &lt;a href=&quot;https://terminalroot.com.br/2018/07/escaneado-redes-com-nmap.html&quot;&gt;nmap&lt;/a&gt; e achou pesado, verboso ou lento demais para tarefas simples, o &lt;strong&gt;Nibble&lt;/strong&gt; resolve exatamente esse problema.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nibble&lt;/strong&gt; é um scanner de rede open-source focado em simplicidade, velocidade e usabilidade. Ele permite descobrir dispositivos e serviços na sua rede local sem precisar decorar comandos complexos ou configurar nada manualmente.Funciona em &lt;a href=&quot;https://terminalroot.com.br/tags#gnulinux&quot;&gt;GNU/Linux&lt;/a&gt;, &lt;a href=&quot;https://terminalroot.com.br/tags#macos&quot;&gt;macOS&lt;/a&gt; e &lt;a href=&quot;https://terminalroot.com.br/tags#windows&quot;&gt;Windows&lt;/a&gt; (x86 e ARM).&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;instalação&quot;&gt;Instalação&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;brew install backendsystems/tap/nibble&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pipx install nibble-cli&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install -g @backendsystems/nibble&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;go install github.com/backendsystems/nibble@latest&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ou rodar direto com:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npx @backendsystems/nibble
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;Para mais informações acesse o &lt;a href=&quot;https://github.com/backendsystems/nibble&quot;&gt;repositório&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Wed, 25 Mar 2026 10:37:46 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/instale-esse-scanner-de-rede-moderno-modo-tui.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/instale-esse-scanner-de-rede-moderno-modo-tui.html</guid>
        
        <category>go</category>
        
        <category>tui</category>
        
        <category>terminal</category>
        
        <category>rede</category>
        
        
      </item>
    
      <item>
        <title>Os 10 Melhores Monitores para Programadores</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/monitores.jpg&quot; alt=&quot;Os 10 Melhores Monitores para Programadores&quot; title=&quot;🖥️ Levando em consideração qualidade de imagem, ergonomia, funcionalidades e conforto para longas sessões de código.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Esses monitores são ótimos para programadores, oferecendo desde &lt;strong&gt;alta resolução e precisão de cores&lt;/strong&gt; até &lt;strong&gt;design ergonômico&lt;/strong&gt; para longas sessões de codificação. O &lt;strong&gt;tamanho, a qualidade da tela e a ergonomia&lt;/strong&gt; são aspectos cruciais que podem melhorar significativamente a experiência de programação.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;01-dell-ultrasharp-p2725h&quot;&gt;01. &lt;a href=&quot;https://amzn.to/4bQuMoZ&quot;&gt;Dell UltraSharp P2725H&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/01.jpg&quot; alt=&quot;01&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;P2725H&lt;/strong&gt; oferece uma tela &lt;strong&gt;4K de 27 polegadas&lt;/strong&gt;, com ótima precisão de cores, ideal para programadores que precisam de clareza em detalhes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: IPS, excelente cobertura de cores (95% DCI-P3), portas USB-C com carregamento.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que trabalham com gráficos, design ou precisam de uma tela com resolução muito alta.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4bQuMoZ&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;02-lg-4wn80c-b-ultrawide&quot;&gt;02. &lt;a href=&quot;https://amzn.to/4szcorX&quot;&gt;LG 4wn80c-b ultrawide&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/02.jpg&quot; alt=&quot;02&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;4wn80c-b&lt;/strong&gt; é um monitor &lt;strong&gt;ultrawide&lt;/strong&gt; de 34 polegadas com resolução &lt;strong&gt;1440p&lt;/strong&gt; que oferece uma ótima experiência multitarefa.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3440 x 1440 (UltraWide)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Painel IPS, design curvado, excelente para produtividade, ajuste de altura e inclinação.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que fazem &lt;strong&gt;multitasking&lt;/strong&gt; e precisam de mais espaço na tela para abrir várias janelas ou códigos simultaneamente.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4szcorX&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;03-asus-proart-pa278qv&quot;&gt;03. &lt;a href=&quot;https://amzn.to/4t2fjco&quot;&gt;ASUS ProArt PA278QV&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/03.jpg&quot; alt=&quot;03&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Focado em &lt;strong&gt;precisão de cores&lt;/strong&gt;, o &lt;strong&gt;PA278QV&lt;/strong&gt; é perfeito para programadores que também trabalham com design ou edição gráfica.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 2560 x 1440 (QHD)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Calibração de cores de fábrica, painel IPS, suporte ergonômico (ajuste de altura, inclinação, rotação).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que precisam de um monitor preciso para edição de imagens ou desenvolvimento de interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4t2fjco&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;04-benq-pd2705u&quot;&gt;04. &lt;a href=&quot;https://amzn.to/4bBImMI&quot;&gt;BenQ PD2705U&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/04.jpg&quot; alt=&quot;04&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;PD2705U&lt;/strong&gt; é um monitor 4K de &lt;strong&gt;27 polegadas&lt;/strong&gt; com excelente performance para programadores que necessitam de uma tela grande e com excelente &lt;strong&gt;precisão de cores&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Painel IPS, design ergonômico, modos de exibição especializados para programadores (como o modo de leitura).&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que precisam de alta resolução para multitarefas e atividades de design.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4bBImMI&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;05-samsung-odyssey-ai-tv-55-oled-4k-s85f&quot;&gt;05. &lt;a href=&quot;https://amzn.to/4uNZdES&quot;&gt;Samsung Odyssey AI TV 55” OLED 4K S85F&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/05.jpg&quot; alt=&quot;05&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;Odyssey AI TV 55” OLED 4K S85F ** é um monitor **curvo&lt;/strong&gt; de 55 polegadas, ideal para programadores que preferem um monitor mais imersivo e com excelente taxa de atualização.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Curvatura de 1000R, taxa de atualização de 240Hz, tempo de resposta rápido, painel VA.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que também são gamers ou preferem uma tela curva para uma melhor experiência de trabalho imersivo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4uNZdES&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;06-acer-predator-x34&quot;&gt;06. &lt;a href=&quot;https://amzn.to/4dJBxeJ&quot;&gt;Acer Predator X34&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/06.jpg&quot; alt=&quot;06&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;X34&lt;/strong&gt; é um monitor &lt;strong&gt;ultrawide curvo&lt;/strong&gt; de 34 polegadas, excelente para programadores que trabalham com múltiplos projetos ou janelas.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3440 x 1440 (UltraWide)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Curvatura 1900R, taxa de atualização de 100Hz, painel IPS, suporte G-Sync.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que buscam um monitor de alta qualidade com um campo de visão amplo para multitarefas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4dJBxeJ&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;07-dell-p2719h&quot;&gt;07. &lt;a href=&quot;https://amzn.to/487jviV&quot;&gt;Dell P2719H&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/07.jpg&quot; alt=&quot;07&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;P2719H&lt;/strong&gt; é um monitor de &lt;strong&gt;27 polegadas&lt;/strong&gt; com uma ótima relação custo-benefício, ideal para programadores que buscam um display de qualidade sem gastar muito.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 1920 x 1080 (Full HD)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Painel IPS, borda fina, design ajustável em altura, rotação e inclinação.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que precisam de um monitor confiável e confortável para trabalhar longas horas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/487jviV&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;08-philips-276e8vjsb&quot;&gt;08. &lt;a href=&quot;https://amzn.to/3PtJsmy&quot;&gt;Philips 276E8VJSB&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/08.jpg&quot; alt=&quot;08&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Valor: &lt;strong&gt;R$ 750,00&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;O &lt;strong&gt;276E8VJSB&lt;/strong&gt; é um monitor &lt;strong&gt;4K de 27 polegadas&lt;/strong&gt; com uma ótima relação de custo-benefício, ideal para quem quer alta resolução sem gastar tanto.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Painel IPS, excelente desempenho em cores e contrastes.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que querem um monitor com excelente resolução e boa qualidade de imagem para tarefas diárias e leitura de código.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/3PtJsmy&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;09-lg-ultragear-27gn750-27&quot;&gt;09. &lt;a href=&quot;https://amzn.to/4rYZWAH&quot;&gt;LG UltraGear 27GN750-27&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/09.jpg&quot; alt=&quot;09&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;LG 27UK850-W&lt;/strong&gt; é um monitor 4K de 27 polegadas com ótima precisão de cores, sendo uma excelente escolha para programadores e profissionais criativos.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Conexões USB-C, painel IPS, suporte HDR10.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que buscam um monitor com boa qualidade de imagem e conexão USB-C para facilitar a configuração.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4rYZWAH&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;10-vivo-monitor-ultrawide--suporte-para-laptop&quot;&gt;10. &lt;a href=&quot;https://amzn.to/4dsnaM3&quot;&gt;VIVO Monitor Ultrawide + suporte para laptop&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/assets/img/hardware/monitores/10.jpg&quot; alt=&quot;10&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;O &lt;strong&gt;VIVO Monitor Ultrawide + suporte para laptop&lt;/strong&gt; é um monitor &lt;strong&gt;4K de 49 polegadas&lt;/strong&gt; que combina design minimalista com excelente precisão de cores, ideal para programadores e designers gráficos.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Resolução&lt;/strong&gt;: 3840 x 2160 (4K)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Características&lt;/strong&gt;: Painel IPS, ajustes ergonômicos (altura, rotação, inclinação), baixo consumo de energia.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ideal para&lt;/strong&gt;: programadores que buscam um monitor altamente preciso e ergonômico para trabalho prolongado.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://amzn.to/4dsnaM3&quot; class=&quot;btn btn-danger btn-lg&quot;&gt;Clique aqui para adquirir esse Monitor&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;veja-também&quot;&gt;Veja também:&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/2023/09/conheca-10-teclados-mecanicos-sem-fio-e-ergonomicos-que-vale-a-pena-ter.html&quot;&gt;Conheça 10 Teclados Mecânicos, Sem-fio e Ergonômicos que vale à pena ter&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/2025/02/os-10-melhores-acessorios-de-informatica-para-um-desenvolvedor.html&quot;&gt;Os 10 Melhores Acessórios de Informática para um Desenvolvedor&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/2025/05/os-10-melhores-acessorios-de-informatica-para-um-desenvolvedor-parte-2.html&quot;&gt;Os 10 Melhores Acessórios de Informática para um Desenvolvedor – Parte 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/2025/10/top-10-melhores-servidores-e-nas.html&quot;&gt;Top 10 melhores Servidores e NAS&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/2025/11/os-20-melhores-notebooks-para-programadores-em-2026.html&quot;&gt;Os 20 Melhores Notebooks para Programadores em 2026&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
        <pubDate>Wed, 25 Mar 2026 10:09:59 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/os-10-melhores-monitores-para-programadores.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/os-10-melhores-monitores-para-programadores.html</guid>
        
        <category>hardware</category>
        
        <category>amazon</category>
        
        
      </item>
    
      <item>
        <title>Baixe vídeos do Youtube com esse App TUI</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/go/xytz.jpg&quot; alt=&quot;Baixe vídeos do Youtube com esse App TUI&quot; title=&quot;▶️ Mais um utilitário feito com Go.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;xytz&lt;/code&gt; é um projeto open source simples e muito útil pra quem curte terminal que é um frontend &lt;a href=&quot;https://terminalroot.com.br/tags#tui&quot;&gt;TUI&lt;/a&gt; pro &lt;em&gt;yt-dlp&lt;/em&gt; feito em &lt;a href=&quot;https://terminalroot.com.br/tags#go&quot;&gt;Go&lt;/a&gt; usando &lt;a href=&quot;https://terminalroot.com.br/2025/07/crie-lindas-interfaces-para-o-terminal-com-essa-lib-go.html&quot;&gt;Bubble Tea&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Busca vídeos do YouTube direto no terminal&lt;/li&gt;
  &lt;li&gt;Navegação por canal (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/channel&lt;/code&gt;) e playlist (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/playlist&lt;/code&gt;)&lt;/li&gt;
  &lt;li&gt;Escolha de qualidade/formatos antes de baixar&lt;/li&gt;
  &lt;li&gt;Download com progresso, velocidade e ETA&lt;/li&gt;
  &lt;li&gt;Resume de downloads interrompidos&lt;/li&gt;
  &lt;li&gt;Histórico de buscas&lt;/li&gt;
  &lt;li&gt;Atalhos estilo Vim&lt;/li&gt;
  &lt;li&gt;Playback direto via mpv (sem baixar) ([pkg.go.dev][1])&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- SQUARE - GAMES ROOT --&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;ins class=&quot;adsbygoogle&quot; style=&quot;display:inline-block;width:336px;height:280px&quot; data-ad-client=&quot;ca-pub-2838251107855362&quot; data-ad-slot=&quot;5351066970&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;instalação&quot;&gt;Instalação&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Via Go:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;go &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;github.com/xdagiz/xytz@latest&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Via &lt;a href=&quot;https://terminalroot.com.br/tags#curl&quot;&gt;cURL&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;curl &lt;span class=&quot;nt&quot;&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/xdagiz/xytz/main/install.sh | bash&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Homebrew (macOS)&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;xdagiz/tap/xytz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Arch&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;paru &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; xytz-bin &lt;span class=&quot;c&quot;&gt;# or yay -S xytz-bin&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Scoop (Windows)&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;scoop bucket add xdagiz https://github.com/xdagiz/scoop-bucket.git
scoop &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;xdagiz/xytz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Após instalar basta rodar:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;xytz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;E um guia rápido em:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;xytz &lt;span class=&quot;nt&quot;&gt;--help&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;p&gt;Para mais informações acesse o &lt;a href=&quot;https://github.com/xdagiz/xytz&quot;&gt;repositório&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Tue, 24 Mar 2026 10:08:52 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/baixe-videos-do-youtube-com-esse-app-tui.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/baixe-videos-do-youtube-com-esse-app-tui.html</guid>
        
        <category>go</category>
        
        <category>tui</category>
        
        <category>terminal</category>
        
        <category>youtube</category>
        
        
      </item>
    
      <item>
        <title>Gere Arte com Python (HSV Spiral)</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/python/python-tip-01.jpg&quot; alt=&quot;Gere Arte com Python (HSV Spiral)&quot; title=&quot;⭕ A cada iteração, o ângulo muda e a cor avança no espectro HSV, criando esse efeito de espiral com gradiente arco-íris.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Usando &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;turtle&lt;/code&gt; e &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;colorsys&lt;/code&gt; para gerar um padrão geométrico colorido.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;dependências&quot;&gt;Dependências&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;No &lt;a href=&quot;https://terminalroot.com.br/tags#windows&quot;&gt;Windows&lt;/a&gt; com &lt;a href=&quot;https://winstall.app/apps/CarlWenrich.PythonTkGuiBuilder&quot;&gt;WinGet&lt;/a&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;winget &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--id&lt;/span&gt; CarlWenrich.PythonTkGuiBuilder&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Em &lt;a href=&quot;https://terminalroot.com.br/tags#gnulinux&quot;&gt;distros GNU/Linux com APT&lt;/a&gt;:&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;python3-tk&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;código-python&quot;&gt;Código Python&lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main.py&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;colorsys&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;turtle&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;turtle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Turtle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;turtle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Screen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bgcolor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;black&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;speed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;36&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;460&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;colorsys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hsv_to_rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;145&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Depois basta rodar:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;python main.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;aprenda-python&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/python&quot;&gt;Aprenda Python&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;httpsterminalrootcombrpython&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/python&quot;&gt;https://terminalroot.com.br/python&lt;/a&gt;&lt;/h3&gt;

</description>
        <pubDate>Mon, 23 Mar 2026 12:09:11 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/gere-arte-com-python-hsv-spiral.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/gere-arte-com-python-hsv-spiral.html</guid>
        
        <category>python</category>
        
        
      </item>
    
      <item>
        <title>Gerencie pacotes APT com interface moderna no terminal</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/go/aptui.jpg&quot; alt=&quot;Gerencie pacotes APT com interface moderna no terminal&quot; title=&quot;📦 Feito com Go que funciona como um frontend para o APT.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;O APTUI é uma &lt;a href=&quot;https://terminalroot.com.br/tags#tui&quot;&gt;TUI (Terminal User Interface)&lt;/a&gt; escrita em &lt;a href=&quot;https://terminalroot.com.br/tags#go&quot;&gt;Go&lt;/a&gt; que funciona como um frontend para o APT.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;A proposta é simples: &lt;strong&gt;fazer tudo que você já faz com APT, mas sem sair da tela e sem ficar digitando comandos repetitivos&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Principais recursos&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Filtro em tempo real enquanto você digita&lt;/li&gt;
  &lt;li&gt;Busca fuzzy (não precisa nome exato)&lt;/li&gt;
  &lt;li&gt;Fallback para &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-cache search&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- SQUARE - GAMES ROOT --&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;ins class=&quot;adsbygoogle&quot; style=&quot;display:inline-block;width:336px;height:280px&quot; data-ad-client=&quot;ca-pub-2838251107855362&quot; data-ad-slot=&quot;5351066970&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;instalação&quot;&gt;Instalação&lt;/h2&gt;

&lt;h3 id=&quot;via-go&quot;&gt;Via Go&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;go &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;github.com/mexirica/aptui@latest&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;ou-via-apt-debianubuntu&quot;&gt;Ou via APT (Debian/Ubuntu)&lt;/h3&gt;
&lt;blockquote&gt;
  &lt;p&gt;(repositório próprio disponível no projeto)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Depois basta rodar:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;aptui&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;p&gt;Para mais informações acesse o &lt;a href=&quot;https://github.com/mexirica/aptui&quot;&gt;repositório&lt;/a&gt;.&lt;/p&gt;

</description>
        <pubDate>Mon, 23 Mar 2026 11:09:49 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/gerencie-pacotes-apt-com-interface-moderna-no-terminal.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/gerencie-pacotes-apt-com-interface-moderna-no-terminal.html</guid>
        
        <category>go</category>
        
        <category>tui</category>
        
        <category>terminal</category>
        
        <category>gnulinux</category>
        
        
      </item>
    
      <item>
        <title>Gerencie suas bases SQL via Terminal com esse App</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/go/pam.jpg&quot; alt=&quot;Gerencie suas bases SQL via Terminal com esse App&quot; title=&quot;📟 Para desenvolvedores, DBAs e analistas que precisam de uma ferramenta leve, rápida e poderosa para diferentes bancos de dados no terminal.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Pam é uma ferramenta de linha de comando (&lt;a href=&quot;https://terminalroot.com.br/tags#cli&quot;&gt;CLI&lt;/a&gt;) minimalista, escrita em &lt;a href=&quot;https://terminalroot.com.br/tags#go&quot;&gt;Go&lt;/a&gt;, projetada para facilitar o gerenciamento e a execução de consultas &lt;a href=&quot;https://terminalroot.com.br/tags#sql&quot;&gt;SQL&lt;/a&gt; em múltiplos bancos de dados. Inspirada no universo de “The Office”, Pam homenageia a personagem que organiza tudo com eficiência.&lt;/p&gt;

&lt;h3 id=&quot;principais-destaques&quot;&gt;Principais Destaques&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Biblioteca de Queries:&lt;/strong&gt; Salve e organize suas consultas SQL mais usadas, facilitando o acesso e reuso.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Multi-banco de dados:&lt;/strong&gt; Compatível com PostgreSQL, MySQL, SQLite, Oracle, SQL Server, ClickHouse e Firebird.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Interface &lt;a href=&quot;https://terminalroot.com.br/tags#tui&quot;&gt;TUI (Terminal User Interface)&lt;/a&gt;:&lt;/strong&gt; Navegação focada no teclado, com atalhos inspirados no Vim, permitindo manipulação eficiente dos resultados das queries.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Edição Direta:&lt;/strong&gt; Atualize células, exclua linhas e edite SQL diretamente na tabela de resultados.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Exportação de Dados:&lt;/strong&gt; Exporte resultados em formatos como &lt;a href=&quot;https://terminalroot.com.br/2023/05/como-fazer-parser-de-csv-com-cpp-moderno.html&quot;&gt;CSV&lt;/a&gt;, &lt;a href=&quot;https://terminalroot.com.br/2025/01/como-consumir-apis-com-curl-e-cpp-no-terminal.html&quot;&gt;JSON&lt;/a&gt;, SQL, &lt;a href=&quot;https://terminalroot.com.br/2026/01/notes-um-aplicativo-de-anotacoes-rapido-bonito-e-open-source.html&quot;&gt;Markdown&lt;/a&gt; ou&lt;a href=&quot;https://terminalroot.com.br/tags#html&quot;&gt; HTML&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Parâmetros em Queries:&lt;/strong&gt; Suporte a consultas parametrizadas, facilitando buscas dinâmicas sem precisar reescrever SQL.&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- SQUARE - GAMES ROOT --&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;ins class=&quot;adsbygoogle&quot; style=&quot;display:inline-block;width:336px;height:280px&quot; data-ad-client=&quot;ca-pub-2838251107855362&quot; data-ad-slot=&quot;5351066970&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;instalação&quot;&gt;Instalação&lt;/h2&gt;

&lt;p&gt;Você pode instalar Pam via Go, baixando o binário diretamente do repositório de releases, ou usando &lt;a href=&quot;https://terminalroot.com.br/2021/12/nixos-um-sistema-operacional-para-programadores.html&quot;&gt;Nix/NixOS&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;go &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;github.com/eduardofuncao/pam/cmd/pam@latest&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;uso-básico&quot;&gt;Uso Básico&lt;/h2&gt;

&lt;p&gt;Após instalar, basta inicializar uma conexão com o banco de dados desejado:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;pam init mydb postgres &lt;span class=&quot;s2&quot;&gt;&quot;postgresql://user:pass@localhost:5432/mydb&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Adicione queries à sua biblioteca:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;pam add list_users &lt;span class=&quot;s2&quot;&gt;&quot;SELECT * FROM users&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;E execute-as de forma interativa:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;pam run list_users&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Exemplo:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://private-user-images.githubusercontent.com/45571086/535609147-b62bec1d-2255-4d02-9b7f-1c99afbeb664.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzI0NjAwMDIsIm5iZiI6MTc3MjQ1OTcwMiwicGF0aCI6Ii80NTU3MTA4Ni81MzU2MDkxNDctYjYyYmVjMWQtMjI1NS00ZDAyLTliN2YtMWM5OWFmYmViNjY0LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzAyVDEzNTUwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwZmNkYjE4OGNlYWI5ZTk1MGFmM2Q3YzdhYWJhNGQ5N2VjNTZhYTk0NjIyMDY2ODg4ZWYxYjQ3MTNhNDk4N2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oihmYpe5xuETxb5WPDYGJl4qRt0qqNCmGTZoP_o3Dd8&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A interface TUI permite navegação com atalhos do tipo Vim (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;j&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;k&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;h&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;l&lt;/code&gt;), cópia de células (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;y&lt;/code&gt;), exportação de dados (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x&lt;/code&gt;), edição de células (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;u&lt;/code&gt;), exclusão de linhas (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;D&lt;/code&gt;), entre outros comandos rápidos.&lt;/p&gt;

&lt;p&gt;Pam armazena suas configurações em &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/pam/config.yaml&lt;/code&gt;, permitindo ajustar limites de linhas, largura de colunas e esquemas de cores para a interface.&lt;/p&gt;

&lt;p&gt;O aplicativo oferece exemplos de comandos para conectar-se facilmente a diversos tipos de bancos de dados, incluindo PostgreSQL, &lt;a href=&quot;https://terminalroot.com.br/tags#mysql&quot;&gt;MySQL&lt;/a&gt;, SQL Server, Oracle, SQLite, ClickHouse e Firebird.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Para mais informações acesso o &lt;a href=&quot;https://github.com/eduardofuncao/pam&quot;&gt;repositório&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Mon, 02 Mar 2026 11:01:59 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/03/gerencie-suas-bases-sql-via-terminal-com-esse-app.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/03/gerencie-suas-bases-sql-via-terminal-com-esse-app.html</guid>
        
        <category>go</category>
        
        <category>tui</category>
        
        <category>cli</category>
        
        <category>comando</category>
        
        
      </item>
    
      <item>
        <title>Como otimizar o comando cd para voltar várias pastas de uma só vez</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/bash/cd-menos.jpg&quot; alt=&quot;Como otimizar o comando cd para voltar várias pastas de uma só vez&quot; title=&quot;Perca menos tempo contando quantas pasta vc precisa voltar com esse hack. 😃&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Todos do &lt;a href=&quot;https://terminalroot.com.br/tags#gnu&quot;&gt;mundo UNIX/GNU&lt;/a&gt; usam constantemente o &lt;a href=&quot;https://terminalroot.com.br/2014/09/alguns-comandos-gnulinux-por-categorias.html&quot;&gt;comando cd&lt;/a&gt; para entrar em pastas pelo terminal.&lt;/p&gt;

&lt;p&gt;O comando &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd&lt;/code&gt;, também conhecido por &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chdir&lt;/code&gt;, é um comando implementado em interfaces de linha de comandos de diversos sistemas operacionais (&lt;a href=&quot;https://terminalroot.com.br/tags#unix&quot;&gt;Unix&lt;/a&gt; ou qualquer um do &lt;a href=&quot;https://terminalroot.com.br/tags#bsd&quot;&gt;tipo Unix&lt;/a&gt;, DOS, &lt;a href=&quot;https://terminalroot.com.br/tags#windows&quot;&gt;Windows&lt;/a&gt;, OS/2 e AmigaOS).&lt;/p&gt;

&lt;p&gt;Nos sistemas &lt;a href=&quot;https://terminalroot.com.br/tags#gnu&quot;&gt;GNU&lt;/a&gt;(usado pela maioria das distros Linux) ele é um &lt;em&gt;shell builtin&lt;/em&gt;, ou seja, é um pouco mais complicado de fazer um &lt;a href=&quot;https://terminalroot.com.br/2021/06/como-criar-aplicar-e-usar-o-comando-patch.html&quot;&gt;patch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;O comando &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd&lt;/code&gt; é muito útil, no entanto, uma das coisas mais &lt;em&gt;chatas&lt;/em&gt; é quando você entra em muitas pastas e deseja voltar somente um quantidade exata e precisa rodar comando exemplo isso:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ../../../../../../
&lt;span class=&quot;c&quot;&gt;# Ou&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ..&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Em ambos os casos acima, é necessário voltar &lt;em&gt;6 vezes&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Mas, podemos criar um &lt;a href=&quot;https://terminalroot.com.br/tags#bash&quot;&gt;função Bash&lt;/a&gt; que diminue essa quantidade de escrita para facilitar ir de forma mais rápida e &lt;em&gt;like a boss&lt;/em&gt; para a 6º pasta atrás sem muita dificuldade, assim: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd -6&lt;/code&gt;, basta adicionar essa função abaixo ao final do seu &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~ ^-[0-9]+&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;#-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&quot;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; i&amp;lt;n&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; i++&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do
            &lt;/span&gt;path+&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;../&quot;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;done
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;builtin cd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;builtin cd&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Depois releia o seu &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bashrc&lt;/code&gt; com o comando: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exec $SHELL&lt;/code&gt; ou &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source ~/.bashrc&lt;/code&gt; e depois é só testar:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-6&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Ou seja, use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-&lt;/code&gt;(traço/menos) o número de pastas atrás que deseja, exemplos: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd -8&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd- 7&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd -11&lt;/code&gt;,…&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Lembrando que para ir para a pasta pessoal basta rodar: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd&lt;/code&gt;(sem argumentos) e para retornar onde estava, use: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd -&lt;/code&gt; sem definir nenhum número!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Simples e prático, né?!&lt;/p&gt;

&lt;!-- SQUARE - GAMES ROOT --&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;ins class=&quot;adsbygoogle&quot; style=&quot;display:inline-block;width:336px;height:280px&quot; data-ad-client=&quot;ca-pub-2838251107855362&quot; data-ad-slot=&quot;5351066970&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/p&gt;

</description>
        <pubDate>Fri, 20 Feb 2026 13:13:49 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/02/como-otimizar-o-comando-cd-para-voltar-varias-pastas-de-uma-so-vez.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/02/como-otimizar-o-comando-cd-para-voltar-varias-pastas-de-uma-so-vez.html</guid>
        
        <category>gnu</category>
        
        <category>bash</category>
        
        <category>shell</category>
        
        <category>terminal</category>
        
        <category>comandos</category>
        
        
      </item>
    
      <item>
        <title>Vix: o &apos;Node.js&apos; do C++, sem garbage collector</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/cpp/vix-cpp.jpg&quot; alt=&quot;Vix: o &apos;Node.js&apos; do C++, sem garbage collector&quot; title=&quot;🌐 Um runtime C++20 voltado para a construção de servidores web e APIs modernas, combinando I/O assíncrono, arquitetura modular e foco extremo em performance.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vix&lt;/code&gt; é &lt;strong&gt;um runtime/framework moderno em &lt;a href=&quot;https://terminalroot.com.br/tags#cpp&quot;&gt;C++20&lt;/a&gt;&lt;/strong&gt; para construir aplicações back-end de alto desempenho e distribuídas (offline-first, peer-to-peer etc.) — tipo alternativa nativa ao Node/Deno, com HTTP async, roteamento, ORM e módulos.&lt;/p&gt;

&lt;p&gt;Serve para criar &lt;strong&gt;servidores web, APIs e apps distribuídos em C++&lt;/strong&gt; com ergonomia contemporânea (sem garbage collector, sem overhead de frameworks “velhos”). Tem:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Servidor HTTP async (Asio)&lt;/li&gt;
  &lt;li&gt;Roteamento, middleware, JSON nativo&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://terminalroot.com.br/tags#cli&quot;&gt;CLI&lt;/a&gt; pra scaffold/build/run&lt;/li&gt;
  &lt;li&gt;Módulos opcionais (ORM, WebSockets, utilitários)
Tudo pensado para performance e aplicativos offline/P2P.&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- SQUARE - GAMES ROOT --&gt;
&lt;script async=&quot;&quot; src=&quot;//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;&lt;ins class=&quot;adsbygoogle&quot; style=&quot;display:inline-block;width:336px;height:280px&quot; data-ad-client=&quot;ca-pub-2838251107855362&quot; data-ad-slot=&quot;5351066970&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;instalação&quot;&gt;Instalação&lt;/h2&gt;

&lt;p&gt;Clone o repositório e compile com &lt;a href=&quot;https://terminalroot.com.br/tags#cmake&quot;&gt;CMake&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;git clone https://github.com/vixcpp/vix.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;vix
cmake &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-B&lt;/span&gt; build &lt;span class=&quot;nt&quot;&gt;-DCMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Release
cmake &lt;span class=&quot;nt&quot;&gt;--build&lt;/span&gt; build &lt;span class=&quot;nt&quot;&gt;-j&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;Opcional: instale headers/artefatos no sistema (conforme docs do projeto).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Para usar como dependência em seu projeto, inclua os headers/libs compilados e configure CMake para linkar com “vix”.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;exemplo-básico-hello-world-http&quot;&gt;Exemplo básico (Hello world HTTP)&lt;/h2&gt;
&lt;p&gt;Crie um arquivo &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main.cpp&lt;/code&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-cpp&quot; data-lang=&quot;cpp&quot;&gt;&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;vix.hpp&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vix&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[](&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello world from Vix!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8080&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Compile com seu &lt;em&gt;CMakeLists&lt;/em&gt; que linka o runtime Vix. Ao rodar, acesse&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost:8080&lt;/code&gt;.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Para mais informações acesse: &lt;a href=&quot;https://github.com/vixcpp/vix&quot;&gt;https://github.com/vixcpp/vix&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Fri, 30 Jan 2026 12:47:39 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/01/vix-o-nodejs-do-cpp-sem-garbage-collector.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/01/vix-o-nodejs-do-cpp-sem-garbage-collector.html</guid>
        
        <category>cpp</category>
        
        <category>cppdaily</category>
        
        <category>web</category>
        
        
      </item>
    
      <item>
        <title>10 Recursos Modernos do Java que Desenvolvedores Sêniores Usam</title>
        <description>&lt;p&gt;&lt;img src=&quot;/assets/img/java/java-menos-codigo.jpg&quot; alt=&quot;10 Recursos Modernos do Java que Desenvolvedores Sêniores Usam&quot; title=&quot;☕ Para reduzir significativamente sua base de código Java.&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Se você ainda está digitando getters, setters, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;equals()&lt;/code&gt; e &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hashCode()&lt;/code&gt; manualmente, ou se seus &lt;em&gt;Data Transfer Objects&lt;/em&gt; (DTOs) parecem ter sido escritos em 2012, você está perdendo o segredo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Você está escrevendo &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; demais.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Já trabalhei em equipes que passaram semanas debatendo &lt;em&gt;Lombok&lt;/em&gt; versus frameworks de imutabilidade, só para introduzir problemas complexos de &lt;em&gt;build&lt;/em&gt; e &lt;em&gt;bugs&lt;/em&gt; ocultos. A &lt;em&gt;Java Virtual Machine&lt;/em&gt; (JVM) moderna — especificamente &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; 17 LTS e versões posteriores — já resolveu esses problemas nativamente.&lt;/p&gt;

&lt;p&gt;Isso não é apenas “açúcar sintático”. Esses recursos reduzem fundamentalmente o código repetitivo (&lt;em&gt;boilerplate&lt;/em&gt;), melhoram a legibilidade do código e, mais importante, permitem otimizações mais profundas do compilador que reduzem a carga cognitiva.&lt;/p&gt;

&lt;p&gt;Este é o verdadeiro “código secreto” para construir microsserviços mais rápidos, sustentáveis e baratos.&lt;/p&gt;

&lt;p&gt;Aqui estão os 10 recursos que os desenvolvedores sêniores utilizam para reduzir sua base de código &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; pela metade.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;1-record-o-exterminador-de-boilerplate&quot;&gt;1. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;record&lt;/code&gt;: O Exterminador de &lt;em&gt;Boilerplate&lt;/em&gt;&lt;/h2&gt;

&lt;p&gt;Esta é a maior conquista para classes centradas em dados. Se o propósito principal de uma classe é armazenar dados, use um &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;record&lt;/code&gt;. Eles são imutáveis e geram automaticamente construtores, getters, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;equals()&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;hashCode()&lt;/code&gt; e &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;toString()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A matemática é simples: 10 linhas de configuração se tornam uma.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-java--16&quot;&gt;A Maneira Antiga (Java &amp;lt; 16)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// User.java (aproximadamente 25 linhas de boilerplate + 2 campos)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;username&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Mais 15 linhas de getters, equals, hashcode e toString...&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-java-17&quot;&gt;A Maneira Nova (Java 17+)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// User.java (1 linha)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;record&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Uso:&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;theIndieDev&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;userId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Os acessadores têm o nome do campo&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Observação:&lt;/strong&gt; Os &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;record&lt;/code&gt; são imutáveis por padrão, o que quase sempre é o que você quer em uma arquitetura moderna. Se você precisa de mutabilidade, geralmente está modelando uma entidade com estado, não um DTO, e deve usar uma classe tradicional.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Aprenda &lt;strong&gt;Java&lt;/strong&gt; da forma correta:&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;https://terminalroot.com.br/java&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;2-pattern-matching-para-instanceof-adeus-ao-inferno-dos-casts&quot;&gt;2. &lt;em&gt;Pattern Matching&lt;/em&gt; para &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;instanceof&lt;/code&gt;: Adeus ao Inferno dos &lt;em&gt;Casts&lt;/em&gt;&lt;/h2&gt;

&lt;p&gt;Quantas vezes você já escreveu a mesma sequência cansativa: verificar o tipo e, em seguida, fazer o &lt;em&gt;cast&lt;/em&gt; explícito? Agora o compilador faz o &lt;em&gt;cast&lt;/em&gt; para você, dentro do bloco, desde que a verificação seja bem-sucedida.&lt;/p&gt;

&lt;p&gt;Isso economiza uma linha, mas, mais criticamente, limpa instantaneamente a lógica aninhada.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga&quot;&gt;A Maneira Antiga&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Cast explícito necessário&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Length: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova&quot;&gt;A Maneira Nova&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// &apos;s&apos; é automaticamente convertida para String e está no escopo&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;o&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Length: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// &apos;s&apos; está fora do escopo aqui&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;3-expressões-switch-o-simplificador-de-fluxo&quot;&gt;3. Expressões &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt;: O Simplificador de Fluxo&lt;/h2&gt;

&lt;p&gt;As declarações tradicionais &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; eram uma fonte de &lt;em&gt;bugs&lt;/em&gt; sutis devido ao &lt;em&gt;fall-through&lt;/em&gt; acidental e, além disso, eram apenas declarações — você não podia atribuir o resultado a uma variável.&lt;/p&gt;

&lt;p&gt;As expressões &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt; corrigem isso garantindo um resultado e usando a sintaxe de seta (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-&amp;gt;&lt;/code&gt;) para eliminar a necessidade do &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-1&quot;&gt;A Maneira Antiga&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dayType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;MONDAY:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;FRIDAY:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;dayType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Busy&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// O break é crucial!&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;SATURDAY:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;SUNDAY:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;dayType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Weekend&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;dayType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Normal&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-uma-única-expressão&quot;&gt;A Maneira Nova (Uma Única Expressão)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dayType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;day&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;MONDAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;FRIDAY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Busy&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;SATURDAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;SUNDAY&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Weekend&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Normal&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;Aprenda &lt;strong&gt;Java&lt;/strong&gt; da forma correta:&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;https://terminalroot.com.br/java&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;4-classes-seladas-sealed-classes-o-power-up-arquitetural&quot;&gt;4. Classes Seladas (&lt;em&gt;Sealed Classes&lt;/em&gt;): O &lt;em&gt;Power-Up&lt;/em&gt; Arquitetural&lt;/h2&gt;

&lt;p&gt;As classes seladas, introduzidas no &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; 17, não têm como objetivo direto reduzir linhas de código. Elas servem para reduzir possíveis &lt;em&gt;bugs&lt;/em&gt; e permitir que o compilador ajude na correção.&lt;/p&gt;

&lt;p&gt;Agora você pode declarar explicitamente quais classes ou &lt;em&gt;records&lt;/em&gt; podem implementar ou estender um tipo selado, impondo uma hierarquia controlada.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Impondo que apenas Circle, Square e Rectangle podem ser formas&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Shape&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;permits&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Circle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Square&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Rectangle&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;record&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Circle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;double&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Shape&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Square&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;implements&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Shape&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;cm&quot;&gt;/* ... */&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Qualquer classe que não seja explicitamente &apos;permitida&apos; não pode implementar Shape&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;A mágica acontece quando você combina isso com uma Expressão &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;switch&lt;/code&gt;. O compilador agora pode garantir que você tratou todos os subtipos possíveis, eliminando a necessidade de uma cláusula &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;default&lt;/code&gt; defensiva. Isso é poderoso para modelagem &lt;em&gt;Domain-Driven Design&lt;/em&gt; (DDD).&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;5-blocos-de-texto-text-blocks-o-salvador-do-sqljson&quot;&gt;5. Blocos de Texto (&lt;em&gt;Text Blocks&lt;/em&gt;): O Salvador do SQL/JSON&lt;/h2&gt;

&lt;p&gt;Se seu código &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; lida com strings de várias linhas — consultas SQL, &lt;em&gt;payloads&lt;/em&gt; JSON, trechos HTML ou arquivos de configuração complexos — você provavelmente já teve strings concatenadas feias com caracteres &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\n&lt;/code&gt; inseridos manualmente.&lt;/p&gt;

&lt;p&gt;Os Blocos de Texto (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&quot;&quot;&quot;...&quot;&quot;&quot;&lt;/code&gt;) resolvem esse problema de forma elegante.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-2&quot;&gt;A Maneira Antiga&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;JSON_PAYLOAD&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;{\n&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;  \&quot;name\&quot;: \&quot;AccountCreatedEvent\&quot;,\n&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;  \&quot;timestamp\&quot;: \&quot;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;\&quot;\n&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;}&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-1&quot;&gt;A Maneira Nova&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;JSON_PAYLOAD&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&quot;
    {
      &quot;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;: &quot;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;AccountCreatedEvent&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;,
      &quot;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timestamp&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;: &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;
    }
    &quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;formatted&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Funciona muito bem com .formatted()!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;6-inferência-de-tipo-de-variável-local-var-despoluindo-o-código&quot;&gt;6. Inferência de Tipo de Variável Local (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;var&lt;/code&gt;): Despoluindo o Código&lt;/h2&gt;

&lt;p&gt;Esse recurso, muitas vezes mal compreendido, tem como objetivo reduzir o ruído causado por declarações de tipo redundantes. A chave são as variáveis locais onde o tipo é claro a partir do contexto.&lt;/p&gt;

&lt;p&gt;Você economiza na digitação, mas o benefício real são linhas mais limpas, especialmente com genéricos.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-3&quot;&gt;A Maneira Antiga&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;userMap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;();&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;BufferedReader&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reader&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BufferedReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FileReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;data.txt&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// ...&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-2&quot;&gt;A Maneira Nova&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// O tipo é óbvio a partir do lado direito (RHS)&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;userMap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;();&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Ainda suficientemente explícito para legibilidade&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reader&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BufferedReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FileReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;data.txt&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// ...&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Sabedoria do Dev Sênior:&lt;/strong&gt; Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;var&lt;/code&gt; apenas onde o tipo seja imediatamente óbvio no lado direito (RHS). Não o use para ofuscar tipos de retorno de métodos ou para campos.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;7-melhorias-no-optional-menos-código-defensivo&quot;&gt;7. Melhorias no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Optional&lt;/code&gt;: Menos Código Defensivo&lt;/h2&gt;

&lt;p&gt;A classe &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Optional&lt;/code&gt; é essencial para programação no estilo funcional, mas versões mais antigas tornavam tarefas comuns muito verbosas. O &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; adicionou métodos mais limpos para tornar o tratamento de erros e efeitos colaterais mais elegantes.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-pré-java-11&quot;&gt;A Maneira Antiga (Pré-Java 11)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Tratando um valor ausente com erro&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;optionalValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;orElseThrow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NoSuchElementException&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Missing value&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Tratando efeitos colaterais de sucesso ou falha&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;optionalValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ifPresent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doSomething&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;optionalValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;isPresent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;doSomethingElse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-java-11&quot;&gt;A Maneira Nova (Java 11+)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Maneira mais limpa de lançar uma exceção&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;optionalValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;orElseThrow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;NoSuchElementException:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Maneira mais limpa de lidar com efeitos colaterais&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;optionalValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ifPresentOrElse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;doSomething&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;doSomethingElse&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;Aprenda &lt;strong&gt;Java&lt;/strong&gt; da forma correta:&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;https://terminalroot.com.br/java&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;8-melhorias-na-api-de-streams-takewhile--dropwhile&quot;&gt;8. Melhorias na API de &lt;em&gt;Streams&lt;/em&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;takeWhile&lt;/code&gt; / &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dropWhile&lt;/code&gt;)&lt;/h2&gt;

&lt;p&gt;A API de &lt;em&gt;Streams&lt;/em&gt; é a base do &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; funcional moderno. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;takeWhile&lt;/code&gt; e &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dropWhile&lt;/code&gt; permitem uma filtragem poderosa, baseada em condições e com curto-circuito.&lt;/p&gt;

&lt;p&gt;Em vez de consumir todo o &lt;em&gt;stream&lt;/em&gt; com um &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;filter&lt;/code&gt; genérico, você pode parar a iteração imediatamente quando uma condição for atendida, levando a um processamento mais rápido de grandes conjuntos de dados.&lt;/p&gt;

&lt;h3 id=&quot;o-conceito&quot;&gt;O Conceito&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Dados: [1, 2, 4, 6, 9, 10, 12]&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// takeWhile: Pega elementos *enquanto* o predicado for verdadeiro, depois para.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Exemplo: takeWhile(n -&amp;gt; n &amp;lt; 5) retorna [1, 2, 4]&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// dropWhile: Descarta elementos *enquanto* o predicado for verdadeiro, depois retorna o restante.&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Exemplo: dropWhile(n -&amp;gt; n &amp;lt; 5) retorna [6, 9, 10, 12]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;9-collectorstounmodifiablelistsetmap-defensivo-por-padrão&quot;&gt;9. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Collectors.toUnmodifiableList/Set/Map&lt;/code&gt;: Defensivo por Padrão&lt;/h2&gt;

&lt;p&gt;Em versões mais antigas do Java, os desenvolvedores constantemente se esquecia de encapsular coleções mutáveis em cópias defensivas (por exemplo, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Collections.unmodifiableList(...)&lt;/code&gt;). Essa é uma fonte clássica de problemas de concorrência e corrupção de estado.&lt;/p&gt;

&lt;p&gt;Agora, você pode coletar diretamente em uma lista imutável.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-4&quot;&gt;A Maneira Antiga&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mutableResults&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(...)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;collect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Collectors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Mais tarde, você poderia retornar assim, permitindo modificação externa:&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// return mutableResults; // PERIGO!&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// A maneira defensiva era verbosa:&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;safeList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(...)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;collect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Collectors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;collectingAndThen&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Collectors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(),&lt;/span&gt;
        &lt;span class=&quot;nl&quot;&gt;Collections:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unmodifiableList&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-java-10&quot;&gt;A Maneira Nova (Java 10+)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Uma linha, garantidamente imutável e segura&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;safeList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(...)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Esta é a sintaxe simplificada do [Java](https://terminalroot.com.br/java/) 16+&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// OU (para [Java](https://terminalroot.com.br/java/) 10+)&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;safeList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(...)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;collect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Collectors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toUnmodifiableList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;blockquote&gt;
  &lt;p&gt;Aprenda &lt;strong&gt;Java&lt;/strong&gt; da forma correta:&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;https://terminalroot.com.br/java&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;10-streamtolist-o-finalizador-de-streams&quot;&gt;10. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Stream::toList()&lt;/code&gt;: O Finalizador de &lt;em&gt;Streams&lt;/em&gt;&lt;/h2&gt;

&lt;p&gt;Embora &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Collectors.toList()&lt;/code&gt; exista há muito tempo, o método de instância &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Stream::toList()&lt;/code&gt; (Java 16+) é uma maneira concisa e sem &lt;em&gt;boilerplate&lt;/em&gt; de finalizar um &lt;em&gt;stream&lt;/em&gt; em uma &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;List&lt;/code&gt; padrão e imodificável.&lt;/p&gt;

&lt;p&gt;É o máximo economizador de linhas para a operação de &lt;em&gt;Stream&lt;/em&gt; mais comum.&lt;/p&gt;

&lt;h3 id=&quot;a-maneira-antiga-verbosamente&quot;&gt;A Maneira Antiga (Verbosamente)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;names&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;employees&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;Employee:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;collect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Collectors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h3 id=&quot;a-maneira-nova-conciso-e-seguro&quot;&gt;A Maneira Nova (Conciso e Seguro)&lt;/h3&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;nc&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;names&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;employees&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;stream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;Employee:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Uma única chamada de método&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;conclusão-pare-de-escrever-código-descartável&quot;&gt;Conclusão: Pare de Escrever Código Descartável&lt;/h2&gt;

&lt;p&gt;A complexidade no software empresarial raramente está na lógica de negócio em si; está no “tecido conjuntivo” — o código repetitivo (&lt;em&gt;boilerplate&lt;/em&gt;), as cópias defensivas, as instruções &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;break&lt;/code&gt; esquecidas e os &lt;em&gt;casts&lt;/em&gt; manuais.&lt;/p&gt;

&lt;p&gt;O &lt;a href=&quot;https://terminalroot.com.br/java/&quot;&gt;Java&lt;/a&gt; moderno (17+) foi projetado para eliminar esse “tecido conjuntivo”. Ao adotar esses 10 recursos, você não está apenas agradando ao compilador; está libertando seu cérebro da carga cognitiva. &lt;strong&gt;O código que você não escreve é código que não pode ter bugs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Se você mantém uma grande base de código, insisto fortemente para que você pare de usar os padrões antigos e verbosos e comece a migrar seus DTOs para &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;record&lt;/code&gt; hoje mesmo. Essa única mudança sozinha lhe dará uma redução imediata e quantificável de 50% na contagem de linhas em seus modelos de dados.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pare de escrever código descartável. Comece a escrever lógica de negócio.&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;curso-de-java-para-iniciantes&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;Curso de Java para Iniciantes&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;httpsterminalrootcombrjava&quot;&gt;&lt;a href=&quot;https://terminalroot.com.br/java&quot;&gt;https://terminalroot.com.br/java&lt;/a&gt;&lt;/h3&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;span style=&quot;font-size:9px;&quot;&gt;Via: &lt;em&gt;medium.com/@martinastaberger/&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;

</description>
        <pubDate>Fri, 30 Jan 2026 12:34:47 +0000</pubDate>
        <link>https://terminalroot.com.br/2026/01/10-recursos-modernos-do-java-que-desenvolvedores-seniores-usam.html</link>
        <guid isPermaLink="true">https://terminalroot.com.br/2026/01/10-recursos-modernos-do-java-que-desenvolvedores-seniores-usam.html</guid>
        
        <category>java</category>
        
        
      </item>
    
  </channel>
</rss>
