<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elton Minetto on Medium]]></title>
        <description><![CDATA[Stories by Elton Minetto on Medium]]></description>
        <link>https://medium.com/@eminetto?source=rss-4485cf75ad68------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qTdco_kD7pp2M6K9zcBIpA@2x.jpeg</url>
            <title>Stories by Elton Minetto on Medium</title>
            <link>https://medium.com/@eminetto?source=rss-4485cf75ad68------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:43:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@eminetto/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How I Use AI]]></title>
            <link>https://eminetto.medium.com/how-i-use-ai-4791933ea7b3?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/4791933ea7b3</guid>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Thu, 27 Nov 2025 11:00:22 GMT</pubDate>
            <atom:updated>2025-11-28T12:20:24.584Z</atom:updated>
            <content:encoded><![CDATA[<p>In these almost 30 years of my career, I’ve seen many technologies and tools emerge (and die), and looking back, I’ve always had two premises about how to adopt them:</p><ul><li>The tool/technology should make me better</li><li>I should not depend on it to do my work</li></ul><p>That said, I consider the entire “revolution” (actually, I think “evolution” would be a fairer word in this context) of LLMs (and all related technologies) as just another one of these tools. In this post, I’ve been trying to apply these same premises nowadays.</p><h3>The tool/technology should make me better.</h3><p>This is where I feel the most incredible excitement about what we have available today. Using something like Copilot (to exemplify a solution) to explain the code of a legacy project, one I don’t know, or even a language I don’t have experience with, greatly accelerates my learning.</p><p>But the tool I like the most, and think should have more prominence in people’s daily lives, is <a href="https://notebooklm.google.com/">Google NotebookLM</a>. I’ve been using it to learn concepts more quickly. To cite a few examples where I recently used it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AwIC8mXPmM7eKXwj.png" /></figure><p>I collected several sources, such as links, documents, videos, and submitted them. After the information was processed, I asked NotebookLM to create mind maps and audio and video explanations of the basic concepts. Then, I asked more advanced questions to understand the details.</p><p>The result is that I learned new subjects much faster than I would have before, which makes me a better professional and person.</p><p>My colleague, <a href="https://www.linkedin.com/in/diegosana/">Diego Sana</a>, recommended an <a href="https://simonwillison.net/2025/Nov/6/async-code-research/">exciting approach</a> for using Agents to create small research projects for rapid learning. I really liked the approach and want to dedicate some time to test something like that.</p><h3>I should not depend on it to do my work.</h3><p>This is where this text may generate some controversy. Whenever I need to develop a new project, I start by making all the architectural and code design decisions, and only then do I turn to Copilot (or another competitor). My primary language in recent years has been Go, so I start by defining the package structure, structs, and interfaces according to the language/community best practices. With this organized, I start using the LLM/Agent to help me, using prompts to generate small functions, and I review all the code before committing. I also ask it to create unit and integration tests, write documentation, and perform other repetitive tasks that add little to my knowledge. This makes the LLM “hallucinate” less because the context is smaller. It also helps me maintain control over the project’s quality and expertise, which will be very useful as I support and evolve the code.</p><p>There are times when I give up this control and use an Agent to generate all the code for me. Still, usually this is for a script I’ll run a few times, or even a proof of concept that will be discarded in favor of a more structured project.</p><p>And using Copilot to generate pull request documentation is one of the solutions I find most useful in daily life.</p><p>This approach makes me more productive without losing my independence from the tool.</p><p>To finish this text, I want to add some points, anticipating some possible comments 🙂</p><ul><li>This is how I use it in November 2025; I’ll likely change something in the future.</li><li>This is the way I use it, it doesn’t mean I’m 100% correct, or that someone else is wrong. Each person has their own approach to learning and using new technologies.</li><li>I’m not an old man complaining about new technologies, I’m also excited about all the possibilities and novelties emerging every day 🙂</li></ul><p>And you? How have you been using these new solutions?</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/en/post/2025-11-27-how-i-use-ai/"><em>https://eltonminetto.dev</em></a><em> on November 27, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4791933ea7b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Must-have apps and services in 2024]]></title>
            <link>https://eminetto.medium.com/must-have-apps-and-services-in-2024-1535310679fc?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/1535310679fc</guid>
            <category><![CDATA[setapp]]></category>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Mon, 04 Nov 2024 10:01:25 GMT</pubDate>
            <atom:updated>2024-11-05T00:03:07.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J-DS8ll-IDgFmf1n" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This post is part of a tradition I started 10 years ago! Every now and then, I make a list of the apps and services I use on a daily basis and share them in these posts. Discovering new apps is something I love, so I can help someone who has the same taste for new things.</p><p>Interestingly, some apps I’ve been using since 2014, like <a href="https://ia.net/writer">iA Writer</a> (which I’m using to write this post) and <a href="http://bufferapp.com/">Buffer</a>. I’ll talk about both of them in a moment, but first, I want to talk about another tool that’s crucial to my setup: SetApp (horrible pun, but I couldn’t resist).</p><p>I’ve been using <a href="https://setapp.sjv.io/6egdeq?sharedid=aps">Setapp</a> since 2017 and am still a huge fan. Its monthly subscription gives you access to over 250 apps, some for macOS and some for iOS and iPadOS.</p><p>PS: if you sign up through the <a href="https://setapp.sjv.io/6egdeq?sharedid=aps">link</a>, you and I will receive some benefits (which may change depending on the subscription date).</p><p>PS2: Since I use several Setapp apps, I’ll mark them in <em>italics</em> for easy identification.</p><p>Without further ado, let’s get to my list, separated into some categories, as I did in the <a href="https://eltonminetto.dev/post/2022-07-31-aplicativos-indispensaveis-2022/">last post</a> (in portuguese) in this series.</p><h3>Software development</h3><ul><li><a href="https://iterm2.com">iTerm</a> + <a href="https://fishshell.com/">fish</a>. I wrote a <a href="https://eltonminetto.dev/en/post/2023-05-16-improving-terminal/">post</a> explaining my environment settings.</li><li><a href="https://code.visualstudio.com">Visual Studio Code</a>. No introduction is needed, right? I use it mainly for development in Go.</li><li><a href="https://zed.dev">Zed</a> is my second editor. I use it as much as I can because it’s a very lightweight and well-built tool. VSCode wins when I need to debug in Go because it’s better prepared for that.</li><li><a href="https://orbstack.dev">OrbStack</a> is a fast and free Docker Desktop replacement for personal use. It comes with a configured K8s cluster, which is useful for local testing.</li><li><a href="https://github.com/MuhammedKalkan/OpenLens">OpenLens</a>. Although I like using kubectl to manage the local k8s cluster, OpenLens is helpful, especially when I want to show something in a lecture because it is more visual.</li></ul><h3>Productivity</h3><ul><li><a href="https://1password.com">1Password</a>. Password and secret vault. It’s a subscription I’d pay for without thinking twice.</li><li><a href="https://setapp.com/pt-br/apps/cleanmymac"><em>CleanMyMac</em></a><em>. Cleans up macOS and optimizes several performance settings.</em></li><li><a href="https://setapp.com/pt-br/apps/paste"><em>Paste</em></a><em>. This very useful clipboard manager app was a recent addition to my list.</em></li><li><a href="https://setapp.com/pt-br/apps/soulver"><em>Soulver</em></a><em>. Note-taking tool that automatically performs calculations based on the text. Very useful for quick calculations.</em></li><li><a href="https://setapp.com/pt-br/apps/lungo"><em>Lungo</em></a><em>. For those times when I don’t want macOS to go into sleep mode.</em></li><li><a href="https://setapp.com/pt-br/apps/spark-mail"><em>Spark</em></a><em>. Email client with superb usability and some handy features. I’m curious to try </em><a href="https://www.notion.so/product/mail"><em>Notion Mail</em></a><em>, and maybe Spark is in danger of being dropped from my list by 2025</em></li><li><a href="https://setapp.com/pt-br/apps/bartender"><em>Bartender</em></a><em>. Helps organize the clutter of icons in your macOS menu bar.</em></li><li><a href="https://www.notion.so">Notion</a>. My second brain, I write everything down in it.</li><li><a href="https://www.notion.so/product/calendar">Notion Calendar</a>. I’ve been using it since Notion bought the company when it was called Cron.</li><li><a href="https://todoist.com/pt-BR">Todoist</a>. I adopted it this year after using paper notebooks for years and Apple’s Reminders for a while. It’s a great tool and well worth the subscription.</li><li><strong>Google Workspace</strong>. I pay for the plan for one user with my own domain. With this, I have an email and access to Drive, Docs, and other tools.</li><li><strong>Safari</strong> is my main browser, but I still have Google Chrome for some emergencies, like using Google Meet, which is faster in Google’s browser.</li><li><strong>Freeform</strong>. I use this native Apple app to take notes on iPad and MacOS.</li><li><a href="https://readwise.io">Readwise</a>. I recently subscribed to it to centralize the notes I take in e-books and blog posts. It’s still too early to know if I’ll renew the subscription in 2025.</li></ul><h3>Posts and Lectures</h3><ul><li><a href="https://ia.net/writer">iA Writer</a>. I’ve been a fan of the product and company for over 10 years. It’s my favorite Markdown editor.</li><li><a href="http://bufferapp.com/">Buffer</a>. This is another tool I’ve been using for a decade to schedule social media posts.</li><li><a href="https://www.grammarly.com">Grammarly</a> is another tool that I happily renew every year. I use it to help me proofread my <a href="https://eltonminetto.dev/en/">English posts</a>.</li><li><strong>Google Slides</strong>. I have used the excellent <a href="https://www.deckset.com">Deckset</a> for years, but recently, I started using Google Slides to produce slides for my presentations. The advantage is that it is easy to share presentations, but I still miss the practicality of Deckset. Maybe I will rethink this decision at some point.</li><li>For my <a href="https://eltonminetto.dev/en">personal site</a>, I use <a href="https://gohugo.io">Hugo</a>, and I host the markdown files on GitHub. Publishing is done whenever I push to the repository using <a href="https://www.netlify.com">Netlify</a>.</li><li>To manage the newsletters <a href="https://asemanago.dev">A Semana Go</a> and <a href="https://maisquesenior.dev">Mais que Senior</a>, I use <a href="http://substack.com/home">Substack</a>.</li></ul><p>Of course, I always have <strong>Apple Music</strong> open while I work because I can’t live without music. Another must-have category is communication apps like <strong>WhatsApp</strong> and <strong>Telegram</strong>, which are always open to chatting with friends and family.</p><p>You may have noticed the absence of AI tools like <strong>ChatGPT</strong>, right? Although I installed the tool, it has yet to become part of my daily usage flow. However, the vast majority of tools I use have AI features, so I can say that I use technology in the best way I can imagine: without even realizing it.</p><p>If you have any suggestions, you can share them here in the comments. If you find it useful for me to make a similar list of the apps I use on the iPad, use the comments to give me this feedback.</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/en/post/2024-11-04-apps-services-2024/"><em>https://eltonminetto.dev</em></a><em> on November 4, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1535310679fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are microservices made of?]]></title>
            <link>https://medium.com/inside-picpay/what-are-microservices-made-of-43b565bc76cd?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/43b565bc76cd</guid>
            <category><![CDATA[microservices-pattern]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 20:48:48 GMT</pubDate>
            <atom:updated>2024-01-26T20:48:48.546Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oALSxx-PmabOLkUkZ4BmQ.png" /></figure><p>In one of my favorite texts on the subject, <a href="https://tanzu.vmware.com/content/blog/should-that-be-a-microservice-keep-these-six-factors-in-mind">Should That Be a Microservice? Keep These Six Factors in Mind</a>, the author cites one of the factors for using this architecture:</p><p><em>The Freedom to Choose the Right Tech for the Job</em></p><p>This freedom to choose the best technology to solve each problem attracts technology teams a lot. But as Uncle Ben would say, with great power comes great responsibility. If each team chooses a technology and makes a decision thinking only about its local problem, it is likely to generate several headaches in the future. Services with different requirements, levels of quality, and maturity can create difficulties in maintenance, evolution, and availability.</p><p>To mitigate these and other problems, we turn to some literature that can be considered classics about microservices architecture.</p><h3>Templates and Chassis</h3><p>The first important source was the book <a href="https://a.co/d/0xu5PBJ">Microservices Patterns: With Examples in Java</a> by Chris Richardson, who also maintains <a href="https://microservices.io/">https://microservices.io/</a>. He defines several essential patterns a team can use in the book, but I will highlight the <a href="https://microservices.io/patterns/service-template.html">Service Template</a> and the <a href="https://microservices.io/patterns/microservice-chassis.html">Microservice Chassis</a>.</p><p>When we start developing an application, we often spend a significant amount of time implementing the mechanisms to deal with cross-cutting issues such as:</p><ul><li>External configuration — includes credentials and network addresses of external services, such as databases and message brokers;</li><li>Logs — configuration of a centralized log recording structure;</li><li>Health checks — a URL that some monitoring service can “ping” to determine the health of the application;</li><li>Metrics — measures that provide insights into what the application is doing and how it is performing;</li><li>Distributed tracing — instrumentation services that assign each external request a unique identifier passed between services.</li></ul><p>It is not uncommon to spend several hours configuring these mechanisms. If you’re going to spend months or years developing a monolithic application, the initial investment to deal with cross-cutting issues is negligible. The situation is very different, however, if you are developing an application that follows microservice architecture. There may be dozens or hundreds of services, and you will often create new ones, each of which will only take days or weeks to develop. You don’t have the luxury of spending a few days setting up mechanisms to deal with cross-cutting issues.</p><p>To solve this problem, we can use the Service Template, creating a project template that teams can easily replicate. There are several ways to make these templates, from something simple like a project that can be copied and pasted by teams, a <a href="https://docs.github.com/pt/repositories/creating-and-managing-repositories/creating-a-template-repository">model repository</a> on Github, or something more complex. Here at PicPay, we use <a href="https://backstage.spotify.com/">Backstage’s</a> template functionality, the basis for building our IDP.</p><p>However, using just the Service Template ends up causing another problem: code duplication between projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*cN8sik8xVf24GRpd2FoZ3Q.png" /><figcaption>Duplicated code</figcaption></figure><p>When duplicating the template, the process will replicate code between projects, which makes maintenance difficult.</p><p>To solve the duplication problem, we use the Service Template pattern in conjunction with the Microservice Chassis. According to the author:</p><p><em>“Create services in a framework or collection of frameworks that address cross-cutting issues such as exception tracking, logging, health checks, externalized configuration, and distributed tracing.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikv05ivtsX308Zj-o2o6nQ.png" /><figcaption>Template and Chassis together</figcaption></figure><p>Now, the template depends on a series of libraries and frameworks that form the microservices chassis. With this, we remove duplication, as the templates now use the libs that are part of the Chassis. This way, we update all projects created from the template when updating a library.</p><p>But in addition to code, the Chassis defines the components that a microservice must have. To do this, we created an RFC, an internal standardization document that describes all the mandatory and recommended requirements of a microservice. This document contains topics such as Authentication, Authorization, Circuit Break, Rate Limit, Graceful Shutdown, etc. I won’t go through all the items here as it would make the text too long, and which items are essential depends on the company’s context.</p><p>With this documentation, libraries, and templates that implement the Chassis, we have a healthy and scalable way to standardize and disseminate good practices in building microservices.</p><h3>Ready for production</h3><p>The second source we’re using is the excellent book <a href="https://a.co/d/a3U9sYO">Production-Ready Microservices: Building Standardized Systems in a Software Engineering Organization</a> by Susan J. Fowler.</p><p>The author goes through several essential topics that a team must consider so that a microservice can be put into production and be ready to receive traffic. Among the items I can mention:</p><ul><li>Stability and reliability;</li><li>Scalability and performance;</li><li>Fault tolerance and disaster recovery;</li><li>Monitoring;</li><li>Documentation.</li></ul><p>For each of these significant topics, she details important concepts and recommendations on how teams should pay due attention to them.</p><p>At the end of the book, you can find a checklist with questions for each topic above in the appendices. We use this checklist for teams to discuss and review each item and prepare their services to meet these critical requirements.</p><p>Other important literature, such as Sam Newman’s <a href="https://a.co/d/d5emuNm">Building Microservices</a>, is strongly recommended.</p><p>In conclusion, the most critical message here is that there are sources that can help us make microservices architecture a healthy environment instead of a chaotic one, which is the natural tendency if it is not something well thought out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43b565bc76cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-picpay/what-are-microservices-made-of-43b565bc76cd">What are microservices made of?</a> was originally published in <a href="https://medium.com/inside-picpay">Inside PicPay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do que são feitos os microsserviços?]]></title>
            <link>https://medium.com/inside-picpay/do-que-s%C3%A3o-feitos-os-microsservi%C3%A7os-05ecb11f56a6?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/05ecb11f56a6</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 13:18:56 GMT</pubDate>
            <atom:updated>2024-01-18T13:18:56.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BwBcdEPn8CeDTpav8I7qgg.png" /></figure><p>Sei que o meme abaixo já virou clichê mas ele faz bastante sentido neste caso, pois este post tenta responder algumas perguntas parecidas. Não sou o grande Sérgio Chapelin mas vou contar aqui como estamos respondendo essas dúvidas no PicPay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*5363Zw_OhdDyvBvvjXrieA.png" /><figcaption>Clichê mas não resisti</figcaption></figure><p>Em um dos meus textos favoritos sobre o assunto, <a href="https://tanzu.vmware.com/content/blog/should-that-be-a-microservice-keep-these-six-factors-in-mind">Should That Be a Microservice? Keep These Six Factors in Mind</a>, o autor cita como um dos fatores para usarmos esta arquitetura:</p><blockquote>The Freedom to Choose the Right Tech for the Job</blockquote><p>Esta liberdade para a escolha da melhor tecnologia para resolver cada problema é realmente algo que atrai bastante os times de tecnologia. Mas como diria o Tio Ben, com grandes poderes vêm grandes responsabilidades. Se cada time escolher uma tecnologia e tomar uma decisão pensado apenas em seu problema local é provável que isso gere várias dores de cabeça no futuro. Serviços com diferentes requisitos, diferentes níveis de qualidade e maturidade podem gerar dificuldade de manutenção, evolução e disponibilidade.</p><p>Para mitigar estes e outros problemas nos voltamos para algumas literaturas que podem ser consideradas clássicos em relação a arquitetura de microsserviços.</p><h4>Templates e Chassis</h4><p>A primeira fonte importante foi o livro <a href="https://a.co/d/0xu5PBJ">Microservices Patterns: With Examples in Java</a>, do Chris Richardson, que também mantém o <a href="https://microservices.io/">https://microservices.io/</a>. No livro ele define vários padrões importantes a serem usados, mas os que vou dar destaque são o <a href="https://microservices.io/patterns/service-template.html">Service Template</a> e o <a href="https://microservices.io/patterns/microservice-chassis.html">Microservice Chassis</a>.</p><p>Quando iniciamos o desenvolvimento de um aplicativo, geralmente passamos uma quantidade significativa de tempo implementando os mecanismos para lidar com questões transversais, como:</p><ul><li>Configuração externa - inclui credenciais e endereços de rede de serviços externos, como bancos de dados e message brokers;</li><li>Logs - configuração de uma estrutura de registro de logs centralizado;</li><li>Health checks - uma url que algum serviço de monitoramento pode “pingar” para determinar a saúde do aplicativo;</li><li>Métricas - medidas que fornecem uma visão sobre o que o aplicativo está fazendo e como está funcionando;</li><li>Rastreamento distribuído - serviços de instrumentação que atribuem a cada solicitação externa um identificador único que é passado entre serviços, etc.</li></ul><p>É comum passar várias horas configurando esses mecanismos. Se você vai gastar meses ou anos desenvolvendo um aplicativo monolítico, o investimento inicial para lidar com questões transversais é insignificante. A situação é muito diferente, no entanto, se você estiver desenvolvendo um aplicativo que segue a arquitetura de microsserviço. Podem existir dezenas ou centenas de serviços e frequentemente você criará novos, cada um dos quais levará apenas dias ou semanas para ser desenvolvido. Você não pode se dar ao luxo de passar alguns dias configurando os mecanismos para lidar com questões transversais.</p><p>Para resolver este problema podemos fazer uso do Service Template, criando um template de projeto que pode ser replicado facilmente pelos times. Existem diversas formas de se criar estes templates, desde algo simples como um projeto que pode ser copiado e colado pelos times, um <a href="https://docs.github.com/pt/repositories/creating-and-managing-repositories/creating-a-template-repository">repositório modelo</a> no Github ou algo mais complexo. Aqui no PicPay usamos a funcionalidade de templates do Backstage, que foi a base para a construção do <a href="https://medium.com/inside-picpay/porque-o-picpay-criou-sua-idp-o-moonlight-f86f1e4e099">nosso IDP</a>.</p><p>Mas usar apenas o Service Template acaba causando outro problema: duplicação de código entre os projetos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*xySVw0TUYlNTr3cUdAQofA.png" /><figcaption>Código duplicado</figcaption></figure><p>Ao duplicar o template códigos começam a ser replicados entre os projetos, o que torna difícil a manutenção.</p><p>Para resolver este problema é recomendado usarmos o pattern Service Template em conjunto com o Microservice Chassis. Segundo o autor:</p><blockquote>&quot;Crie serviços em um framework ou coleção de frameworks que tratem de questões transversais como exception tracking, logging, health checks, configuração externalizada e rastreamento distribuído&quot;</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBwCWL1NaKFLzLzwNbKc3A.png" /><figcaption>Template e Chassi em conjunto</figcaption></figure><p>Agora o template passa a depender de uma série de bibliotecas e frameworks que formam o chassi de microsserviços. Com isso removemos a duplicação, pois os templates passam a usar as libs que fazem parte do chassi. Desta forma, ao atualizar uma lib atualizamos todos os projetos que foram criados a partir do template.</p><p>Mas além de código, o Chassi define os componentes que um microsserviço deve ter. Para isso criamos um RFC, um documento de padronização interna, que descreve todos os requisitos obrigatórios e recomendados de um microsserviço. Neste documento temos tópicos como: Autenticação, Autorização, Circuit Break, Rate Limit, Graceful Shutdown, etc. Não vou passar por todos os itens aqui pois tornaria o texto muito grande e além disso, quais itens são importantes depende do contexto da empresa.</p><p>De posse dessa documentação, bibliotecas e dos templates que implementam o Chassi, temos uma forma saudável e escalável de padronizar e difundir as boas práticas na construção de microsserviços.</p><h4>Pronto para a produção</h4><p>A segunda fonte que estamos usando é o ótimo livro <a href="https://a.co/d/a3U9sYO">Microsserviços Prontos Para a Produção: Construindo Sistemas Padronizados em uma Organização de Engenharia de Software</a>, da Susan J. Fowler.</p><p>A autora passa por diversos tópicos importantes que devem ser levados em consideração para que um microsserviço possa ser colocado em produção e considerado pronto para receber tráfego. Dentre os tópicos, posso citar:</p><ul><li>Estabilidade e confiabilidade;</li><li>Escalabilidade e desempenho;</li><li>Tolerância a falhas e preparação para catástrofes;</li><li>Monitoramento;</li><li>Documentação e compreensão.</li></ul><p>Para cada um destes grandes tópicos ela detalha conceitos importantes e recomendações de como os times deveriam dar a devida atenção a eles.</p><p>E no final do livro, nos apêndices, é possível encontrar um checklist com perguntas para cada um dos tópicos acima. Estamos usando este checklist para que os times discutam e revisem cada um dos itens e assim preparem seus serviços para atender esses importantes requisitos.</p><p>Existem outras literaturas importantes como o <a href="https://a.co/d/d5emuNm">Building Microservices</a> do Sam Newman que também é fortemente recomendado. <br>Concluindo, o recado mais importante aqui é que existem fontes que podem nos ajudar a tornar a arquitetura de microsserviços um ambiente saudável ao invés de caótico, que é a tendência natural se não for algo bem pensado.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05ecb11f56a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-picpay/do-que-s%C3%A3o-feitos-os-microsservi%C3%A7os-05ecb11f56a6">Do que são feitos os microsserviços?</a> was originally published in <a href="https://medium.com/inside-picpay">Inside PicPay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer productivity for fun and profit — Part 2]]></title>
            <link>https://eminetto.medium.com/developer-productivity-for-fun-and-profit-part-2-0add04d2e8a1?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/0add04d2e8a1</guid>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 11:31:42 GMT</pubDate>
            <atom:updated>2023-10-14T14:14:30.559Z</atom:updated>
            <content:encoded><![CDATA[<h3>Developer productivity for fun and profit — Part 2</h3><p>This text is the second part of a series of posts about productivity. In the <a href="https://eltonminetto.dev/en/post/2023-01-25-developer-productivity-fun-profit-p1/">first part</a>, I discussed how developers can improve their productivity. In this text, I will mention some ways in which the company or team can improve the daily lives of developers.</p><h3>Do Onboarding</h3><p>Starting a new company, team, or project is stressful in itself. The idea is for the person to start being productive as soon as possible, generating much pressure. One way to improve this scenario is to have a well-structured onboarding process.</p><p>One practice I tested several times was:</p><ul><li>In the first days, the person works in pair programming with the team, each day with someone different. This way, she learns the project details and gets along with the team.</li><li>In the second week (or before, depending on the team size), the person receives a carefully chosen task to perform the entire development cycle (coding, testing, deployment in a homologation and production environment) autonomously.</li></ul><p>There are several ways to carry out this onboarding process, but the most important thing is for the team to carefully define it so that new people become productive as soon as possible.</p><h3>Create a culture of documentation</h3><p>It’s very frustrating when we’re developing a feature, and we’re stuck waiting for an answer to a question or clarification that’s just in someone’s head. To resolve this problem, creating a culture of documentation in the team is essential. Design docs, RFCs, ADRs, and videos; there are many ways to accomplish this. Another critical point is that all these documents are structured and easy to search and consult. Tools like Confluence, Github/Gitlab Wikis, and Notion are good choices for this purpose.</p><h3>Set standards</h3><p>Another vital point to accelerate development is to have well-defined standards. A good set of definitions will help with code writing, code review, and future maintenance, saving time from arguing about “tabs or spaces?” and similar topics.</p><p>Most languages have coding style standards that teams can adopt. It is possible to document and adopt a standard among the group if it does not exist. And it continues beyond there because we can define standards concerning the creation of APIs (Rest x RPC? URls in the singular or plural?), documentation (as mentioned above), and <a href="https://microservices.io/patterns/index.html">microservices</a>.</p><h3>Decrease the cognitive load</h3><p>Software development itself is complex. In addition, the person must understand the business details for which he is writing solutions. Any complexity beyond these can decrease productivity and are good opportunities for improvement. For example:</p><ul><li>Make infrastructure and build/deploy processes transparent to devs.</li><li>Adoption of libraries that implement features such as logging, authentication, authorization, caching, and observability, which are common to a large number of scenarios</li><li>Automated quality control with tools like Sonar or Codeclimate</li><li>Creating new projects using templates</li><li>Collection of productivity metrics</li><li>Optimization of application build and deployment time</li><li>Ease in creating environments such as local and QA.</li></ul><h3>Create/Use an Internal Development Portal</h3><p>The idea is to have a central point where people can find standards, documentation, and designs. The team can do this with a specialized tool like <a href="https://backstage.io/">Backstage</a>, Confluence, Github, Google Docs, or some internal implementation. The software is not the most important thing here, but having an easy way to find what is needed for the person to be more productive.</p><h3>Create useful templates</h3><p>Nothing is more frustrating than handing a blank page and asking the person to create a complex document or a new feature. It’s easy to look at the page and think, “Where do I start?”. A way to solve this is to create templates for:</p><h3>Create processes for incidents.</h3><p>One thing is sure: there will be some incidents in production. Some not mapped scenarios will occur, a database will be overloaded, and the cloud provider will have a problem. At these times, it is important to have well-defined processes to guide the actions to mitigate the problem, correct and document what happened so that it does not happen again, the famous post mortem.</p><p>Despite the idea that incidents are rare events, it is essential to consider them as something that can affect teams’ productivity. If the team wastes much time solving a problem in production and does not learn from the occurrence, they tend to be repeated and consume even more time.</p><h3>Create a culture of quality</h3><p>This tip is related to the previous one. To avoid incidents and prevent the code from becoming complex and hard to maintain, teams must have a culture of writing quality code. Changing low-quality and complex code is very frustrating and time-consuming, increasing the likelihood of errors and incidents.</p><p>A paper published by Google points out how quality directly influences the productivity of teams: <a href="https://research.google/pubs/pub51783/">What Improves Developer Productivity at Google? Code Quality</a>.</p><p>These are just a few tips I’ve tried to list here, but the list could be more comprehensive, and I’d love to read your suggestions in the text comments.</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/en/post/2023-08-01-developer-productivity-fun-profit-p2/"><em>https://eltonminetto.dev</em></a><em> on August 1, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0add04d2e8a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer productivity for fun and profit — Parte 2]]></title>
            <link>https://eminetto.medium.com/developer-productivity-for-fun-and-profit-parte-2-b10cd8611f05?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/b10cd8611f05</guid>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 11:31:04 GMT</pubDate>
            <atom:updated>2023-10-14T14:15:13.560Z</atom:updated>
            <content:encoded><![CDATA[<h3>Developer productivity for fun and profit — Parte 2</h3><p>Esta é a segunda parte de uma série de posts que escrevi sobre produtividade. Na <a href="https://eltonminetto.dev/post/2023-01-25-developer-productivity-fun-profit-p1/">primeira parte</a> falei sobre como eu acredito que a pessoa desenvolvedora pode melhorar sua produtividade. Neste texto vou citar algumas formas com que a empresa/time pode melhorar o dia a dia das pessoas desenvolvedoras.</p><h3>Faça Onboarding</h3><p>Iniciar em uma nova empresa, time ou projeto é algo que pode ser estressante por si só. A ideia é que a pessoa comece a ser produtiva o quanto antes, o que acaba gerando uma boa dose de pressão. Para melhorar isso é importante ter um processo de <em>onboarding</em> bem estruturado. Uma forma que eu testei diversas vezes foi:</p><ul><li>nos primeiros dias a pessoa trabalha em <em>pair programming</em> com o time, a cada dia com uma pessoa diferente. Desta forma ela vai aprendendo os detalhes do projeto e começa a ter entrosamento com o time.</li><li>na segunda semana (ou antes, dependendo do tamanho do time) a pessoa recebe uma tarefa escolhida com atenção, para que ela possa fazer todo o ciclo de desenvolvimento (codificação, testes, deploy em ambiente de homologação e de produção) com autonomia.</li></ul><p>Existem várias formas de se fazer esse processo de onboarding mas o mais importante é que o time se preocupe em defini-lo com atenção, para que as novas pessoas se tornem produtivas o quanto antes.</p><h3>Crie uma cultura de documentação</h3><p>É muito frustrante quando estamos desenvolvendo alguma feature e ficamos bloqueados esperando a resposta para alguma dúvida ou esclarecimento que está apenas na cabeça de alguma pessoa. Para resolver isso é importante que seja criada uma cultura de documentação no time. Design docs, RFCs, ADRs, videos, existem diversas formas de se realizar isso. Outro ponto importante é que todas essas documentações estejam estruturadas e sejam de fácil pesquisa e consulta. Ferramentas como Confluence, Wikis do Github/Gitlab, Notion, são importantes desde que bem usadas.</p><h3>Defina padrões</h3><p>Outro ponto importante para acelerar o desenvolvimento é ter padrões bem definidos. Isso vai ajudar na escrita do código, no code review, na manutenção futura e evitar que seja perdido tempo em discussões sobre “tabs ou espaços?” e tópicos similares.</p><p>A maioria das linguagens possui padrões de <em>coding style</em> que os times podem adotar. Caso não exista é possível documentar um padrão e adotar entre o time. E não para nisso, pois podemos definir padrões em relação a criação de APIs (Rest x RPC? URls no singular ou plural? etc), documentação (como citado acima), <a href="https://microservices.io/patterns/index.html">microsserviços</a>, etc.</p><h3>Diminua a carga cognitiva</h3><p>O desenvolvimento de software por si só é algo complexo. Além disso é necessário que a pessoa entenda os detalhes do negócio para o qual está escrevendo soluções. Qualquer complexidade além destas podem diminuir a produtividade e deveriam ser alvo de melhorias. Por exemplo:</p><ul><li>Tornar infra e processos de build/deploy transparentes para os devs</li><li>Adoção de bibliotecas que implementem funcionalidades como log, autenticação, autorização, cache, observabilidade, etc, que são comuns a um grande número de cenários</li><li>Controle de qualidade automatizado com ferramentas como Sonar ou Codeclimate</li><li>Criação de novos projetos usando templates</li><li>Coleta de métricas de produtividade</li><li>Otimização do tempo de build e deploy das aplicações</li><li>Facilidade na criação de ambientes como local, QA, etc</li><li>etc</li></ul><h3>Crie/use um Internal Development Portal</h3><p>A ideia é ter um ponto central onde as pessoas podem encontrar os padrões, documentações, projetos, etc. Pode ser feito com uma ferramenta especializada como o <a href="https://backstage.io/">Backstage</a>, Confluence, Github, Google Docs ou alguma implementação interna. A ferramenta não é o mais importante aqui e sim ter uma forma fácil de se encontrar o que está sendo necessário para que a pessoa seja mais produtiva.</p><h3>Crie templates úteis</h3><p>Nada mais frustrante do que entregar uma página em branco e pedir para a pessoa criar um documento complexo ou uma nova feature. É fácil ficar muito tempo olhando para a página e pensando “por onde começo?”. Para evitar isso é importante criarmos templates para:</p><h3>Crie processos para incidentes</h3><p>Uma coisa é certa: vai acontecer algum incidente em produção. Algum cenário que não tinha sido mapeado vai ocorrer, um banco de dados vai ficar sobrecarregado, o fornecedor de nuvem vai ter algum problema, etc. Nestes momentos é importante ter processos bem definidos para guiar as ações de mitigação do problema, correção e documentação do que aconteceu para que não se repita, os famosos <a href="https://www.itsmnapratica.com.br/como-fazer-um-post-mortem/">post mortem</a>.</p><p>Apesar da ideia é que incidentes sejam eventos raros é importante considerá-los como algo que pode afetar a produtividade das equipes. Se o time perde muito tempo para resolver algum problema em produção e não aprende com as ocorrências a tendência é que elas se repitam e consumam ainda mais tempo.</p><h3>Crie uma cultura de qualidade</h3><p>Essa dica se liga diretamente a anterior. Para evitar incidentes, para evitar que o código se torne complexo e difícil de manter é importante que as equipes tenham uma cultura de escrever código com qualidade. É muito frustrante e consome muito tempo alterar código complexo e de baixa qualidade, além de aumentar a probabilidade de erros e incidentes.</p><p>Existe um paper bem interessante publicado pelo Google que aponta como a qualidade influencia diretamente na produtividade dos times: <a href="https://research.google/pubs/pub51783/">What Improves Developer Productivity at Google? Code Quality</a> e recomendo a leitura.</p><p>Estas são apenas algumas dicas que tentei elencar aqui, mas a lista não é exaustiva e gostaria muito de ler suas sugestões nos comentários do texto.</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/post/2023-08-01-developer-productivity-fun-profit-p2/"><em>https://eltonminetto.dev</em></a><em> on August 1, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b10cd8611f05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Por que escrever?]]></title>
            <link>https://eminetto.medium.com/por-que-escrever-1fec6674f021?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fec6674f021</guid>
            <category><![CDATA[escrever]]></category>
            <category><![CDATA[blog]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 01:01:40 GMT</pubDate>
            <atom:updated>2023-06-13T13:10:47.959Z</atom:updated>
            <content:encoded><![CDATA[<p>Em Setembro de 2023 este site completa 20 anos! É realmente algo que eu não esperava quando escrevi meu primeiro <a href="https://eltonminetto.dev/2003/09/04/19/">“hello world”</a>, em uma página HTML no diretório do meu usuário no servidor Linux da universidade:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Nrvq9NqZKk5mxIOIgiDDA.png" /></figure><p>Para comemorar esse feito nos próximos meses vou publicar alguns posts sobre assuntos relacionados. E neste primeiro eu gostaria de falar sobre os motivos que me fazem continuar a escrever todos os meses aqui (e em outros lugares).</p><p><strong>É uma ótima forma de aprendizado</strong></p><p>Dizem que uma forma de se aprender algo é ensinando o assunto para outra pessoa. Richard Feynman, pioneiro da eletrodinâmica quântica e ganhador do Nobel de 1965, criou uma <a href="https://ead.pucpr.br/blog/tecnica-feynman">técnica</a> que permitia que ele aprendesse virtualmente qualquer coisa. E um dos passos mais importantes é “Ensine esse conceito para um leigo”. Ensinar na forma de um texto é algo ainda mais desafiador, pois você precisa pensar em uma série de fatores importantes como tom de voz, público alvo, profundidade, tamanho do texto, etc. Eu tenho usado os posts neste site como forma de aprendizado e fortalecimento de conceitos durante toda minha carreira (eu comecei a trabalhar com programação em 1997 e a escrever este site em 2003) e posso testemunhar a favor desta ótima ferramenta.</p><p><strong>Você pratica uma habilidade muito importante</strong></p><p>Talvez uma das <em>skills</em> mais importantes para uma pessoa desenvolvedora é escrever bem. Isso sempre está entre as <em>soft skills</em> mais valorizadas nas empresas. Você vai precisar escrever descrições de <em>commits</em> e <em>pull requests</em>, documentação de projetos, relatórios para lideranças, sua própria análise de performance (algo bem comum em empresas de médio a grande porte e em startups). Sem falar no fato de que o ambiente remoto tornou-se quase que padrão nos últimos anos e passamos mais tempo no Slack/Teams do que nas nossas IDEs/terminais. Escrever bem mensagens de texto e documentos é crucial para um bom relacionamento com colegas e lideranças.</p><p><strong>Você cria autoridade ao redor do seu nome</strong></p><p>Conforme você aumenta a quantia de conteúdo gerado, bons efeitos começam a acontecer, como:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*k8QhYTcVIdunjeay.png" /></figure><p>E:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GdiJhx7E-E7e1GIY.png" /></figure><p>Isso pode parecer um pouco de “ego trip”, mas é importante para nossa carreira sermos conhecidos como referências em alguns assuntos. Isso nos ajuda a ter melhores ofertas de trabalho, ser chamado para eventos e palestras, tornam nosso currículo mais atrativo. E abrem oportunidades para conhecermos pessoas, contribuirmos com projetos e comunidades. É um retorno que vale muito o investimento.</p><p>Claro que isso vale para qualquer tipo de conteúdo, não é exclusivo para textos. O que nos leva ao próximo ponto.</p><p><strong>Seu conteúdo tem um alcance mais longo</strong></p><p>Eu sempre tive uma teoria, de que o conteúdo escrito tem uma “vida” mais longa do que videos. Algo como:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bYf33bZlpVJ9P6CR.png" /></figure><p>Dei uma olhada nos acessos dos meus posts para ver se isso se mostra perto do real:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1T2YPMhD4uBSrOIS.png" /></figure><p>Outro post:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NLx1YRtQkLTF1GCb.png" /></figure><p>Como eu não tenho dados para comprovar se o comportamento dos acessos a conteúdos em vídeo bate com minha teoria eu usei a sabedoria da Internet. Perguntei em um <a href="https://twitter.com/eminetto/status/1668244591987019776?s=61&amp;t=sPotmpGH6d6KNNLETtizgA">tweet</a> e as respostas são bem interessantes, recomendo a leitura, inclusive para ver opiniões contrárias a minha.</p><p>Outra vantagem do texto versus o video é a facilidade para correções e atualizações de conteúdo. Por exemplo, em 2018 eu escrevi um post sobre <a href="https://eminetto.medium.com/clean-architecture-using-golang-b63587aa5e3f">Clean Architecture em Go</a>. Em 2020 eu fiz um <a href="https://eltonminetto.dev/en/post/2020-07-06-clean-architecture-2years-later/">novo post</a> revisando o que eu tinha aprendido em dois anos usando a arquitetura. E em 2023 eu escrevi um <a href="https://medium.com/inside-picpay/organizing-projects-and-defining-names-in-go-7f0eab45375d">terceiro</a>, descrevendo o que eu havia aprendido nos últimos três anos e como eu estou usando a tecnologia agora. Em cada novo post foi muito fácil eu atualizar o anterior, guiando o leitor para a versão mais atual, sem deixar um assunto defasado que poderia causar problemas para quem está aprendendo:</p><p>Fazer isso em nos vídeos daria muito mais trabalho (pelo menos para mim, que não sou muito bom em ferramentas de edição).</p><p>Neste post eu foquei nas vantagens para quem está produzindo o texto, mas também vejo algumas vantagens quando estou no papel de consumidor, como:</p><ul><li>posso ler no meu tempo, salvar para ler mais tarde, começar a ler no computador e terminar no celular;</li><li>posso copiar e colar código para uma IDE ou terminal;</li><li>posso guardar trechos para citação futura;</li><li>posso pesquisar o conteúdo por palavras;</li><li>etc.</li></ul><p>Antes que me categorizem como velho retrógrado (pelo menos não por esse motivo) eu quero deixar claro que gosto de conteúdos em vídeo e até tenho alguns no meu <a href="https://www.youtube.com/eltonminetto">YouTube</a>. Gosto principalmente para aprender alguns conceitos mais complexos ou mesmo para visualizar a demonstração de algum produto ou ferramenta. Produzir conteúdo, seja qual formato, é uma ótima forma de aprendizado, compartilhamento de conhecimento, etc. Se você prefere produzir e consumir videos, ótimo, isso vai ser bom pra você. Meu objetivo com este post era tentar incentivar a prática da escrita e mostrar suas vantagens.</p><p>Se concorda ou tem uma opinião diferente, ou se tem dados mais detalhados sobre os acessos aos seus videos ou podcasts, use a área de comentários para enriquecer o assunto.</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/post/2023-06-13-por-que-escrever/"><em>https://eltonminetto.dev</em></a><em> on June 13, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fec6674f021" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Como organizo minha semana]]></title>
            <link>https://eminetto.medium.com/como-organizo-minha-semana-bea23ca47043?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/bea23ca47043</guid>
            <category><![CDATA[noteplan]]></category>
            <category><![CDATA[setapp]]></category>
            <category><![CDATA[setapp-series]]></category>
            <category><![CDATA[organization]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Sat, 27 May 2023 06:00:50 GMT</pubDate>
            <atom:updated>2023-08-04T13:07:20.829Z</atom:updated>
            <content:encoded><![CDATA[<p>Em Maio/2023 completei meu primeiro ano trabalhando como Principal Software Engineer no PicPay. <a href="https://maisquesenior.substack.com/p/elton-minetto">Neste post</a> eu comentei sobre o que eu faço, inclusive como eu organizo minha agenda mas gostaria de detalhar um pouco mais este assunto.</p><p>Posições “staff+”, como Principal, tem algumas características interessantes:</p><ul><li>eu estou alocado em uma área, que é formada por alguns times. Desta forma, eu “navego” entre os contextos dos times e vejo como eles se integram nos objetivos da área e da empresa;</li><li>tenho bastante autonomia para organizar as minhas prioridades e tarefas. Mas como dizia o sábio Tio Ben: “com grandes poderes vem grandes responsabilidades”;</li><li>sou envolvido em várias discussões técnicas durante a semana, bem como dou apoio em alguns incidentes que podem acontecer;</li><li>tenho um papel importante de mentoria dentro dos times.</li></ul><p>Diferentes papéis e contextos, somado com autonomia pode ser a receita para algumas coisas não muito saudáveis como sobrecarga, burnout e perda de foco no que é importante. Para evitar isso eu tenho feito algumas coisas:</p><ul><li>toda segunda-feira eu faço uma lista das prioridades da semana. Aponto quais são as tarefas, áreas e times que eu pretendo dar foco nos próximos dias. Compartilho essa lista com meu par, o outro Principal da área, e minha liderança. Eles dão feedbacks e apontam prioridades que eu possa ter deixado de fora, complementam com sugestões e ideias e se oferecem para ajudar em algo. O meu colega também compartilha a lista dele e eu faço a mesma revisão;</li><li>ainda na segunda eu tenho uma reunião com as lideranças da área para alinharmos as prioridades de todos. Posso fazer algum ajuste na minha lista de prioridades caso necessário;</li><li>a última tarefa da segunda é criar bloqueios na minha agenda da semana para dar foco em alguns itens da minha lista de prioridades. Assim eu consigo dar atenção ao que é importante e também comunico para meus colegas dos times os momentos que eu não posso participar de alguma reunião ou mentoria. Claro que urgências aparecem e preciso reorganizar a agenda algumas vezes, mas no geral funciona muito bem. Eu tomo cuidado de não bloquear minha agenda toda, nem mesmo bloquear um dia inteiro para uma tarefa. Prefiro dividir algo grande em blocos de uma ou duas horas, deixando espaços na agenda para que eu esteja disponível para os times me envolverem em discussões técnicas, revisão de código, pair programming e mentorias;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RxLqJyTY29oUUq2L.jpg" /></figure><p>Eu uso um software chamado <a href="https://noteplan.co/">NotePlan</a>, que faz parte do pacote do <a href="https://setapp.sjv.io/c/4198620/385366/5114?subId1=SMWC">Setapp</a>, para organizar minhas tarefas. O que eu gosto dele é que eu posso colocar minhas metas semanais e acompanhar as tarefas diárias, em conjunto com o calendário.</p><p>Prioridades da semana:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HfGNfuMlTX2Ruofl.jpg" /></figure><p>Tarefas de um dia:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WOMIJLo4iRLNEDjq.jpg" /></figure><p>As imagens são da versão para iPad, mas também existe versões para iPhone e macOS. Eu acabo usando as três versões e todas são muito boas, mas acredito que o mais importante para mim é o processo e não a ferramenta.</p><p>Compartilhei estas dicas na expectativa de serem úteis para outros profissionais, mesmo os que não atuam como Staff ou Principal.</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/post/2023-05-27-como-organizo-minha-semana/"><em>https://eltonminetto.dev</em></a><em> on May 27, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bea23ca47043" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Organizing projects and defining names in Go]]></title>
            <link>https://medium.com/inside-picpay/organizing-projects-and-defining-names-in-go-7f0eab45375d?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f0eab45375d</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[hexagonal-architecture]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[go]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Fri, 26 May 2023 11:53:20 GMT</pubDate>
            <atom:updated>2023-05-26T11:53:20.278Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDmvyQ0riJizLTsCkpNHng.png" /><figcaption>Picture by <a href="https://unsplash.com/@killerfvith?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alex wong</a> at <a href="https://unsplash.com/pt-br/fotografias/l5Tzv1alcps?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This is a translation of a <a href="https://medium.com/inside-picpay/organizando-um-projeto-e-convencionando-nomes-em-go-c18b3fa88ba0">post</a> by my teammate, <a href="https://medium.com/@carloslimajr">Carlos de Souza</a>.</p><p>Here at PicPay, the Go language community has been growing and becoming increasingly relevant as one of the main stacks used in the company. And, the more developers working with a language, the more projects written in that same technology emerge. The more projects, the greater the complexity of having a pattern or convention in the organization and structure of code repositories. Therefore, the Go skill (a group of developers who use Go and meet periodically) proposed a set of rules that define a good organization of a project and naming conventions for functions and variables to be adopted.</p><p>Notably, despite having a project organization model in Go, exceptions may exist depending on the context in which the code is applied. Therefore, consider the proposal presented in this article with some flexibility and follow it relaxedly. Consider your common sense and the team’s experience when making decisions involving the structure presented in this article. :)</p><h4>Go is a package-structured language…</h4><p>Any project born in Go is defined through one or more packages, a namespace that defines a scope, context, or domain where the code will be developed. Therefore, a project can contain one or more packages, depending on the contexts involving the project. For example, for a project where you want to create an application that organizes a collection of books, a book package can exist, where you have the context of a book, gathering functions, structs, and interfaces that are part of that context.</p><p>Let’s start by discussing how we can organize a package in Go. First, we can divide packages into two distinct categories: <strong>libraries</strong> and <strong>applications</strong>.</p><p><strong>Organizing a library</strong></p><p>When talking about a library, the package serves as a dependency for another context or project from where it will be imported, aiming to fulfill a specific functionality.</p><p>For example, Go’s <em>stdlib</em> (the native language library) has a set of packages that can be imported into another package that needs some functionality. For instance, to handle errors, we use the <em>errors</em> package. It has a single purpose: handling errors in the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d10d610f9ff748574a480c0153d3b29e/href">https://medium.com/media/d10d610f9ff748574a480c0153d3b29e/href</a></iframe><p>The above code exemplifies the use of the errors package. In line 13, an error-type structure is returned. Therefore, the <em>errors</em> package serves as a library, an external dependency imported into the application.</p><p>Each package should contain code with a single purpose when discussing a library. This follows the <em>Single Responsibility principle</em> of SOLID. In the case of the <em>stdlib</em>, for example, this principle is well applied through the existence of packages like <em>archive</em>, <em>cmd</em>, <em>crypto</em>, <em>math</em>, and others (to learn more, visit the Go standard library guide — <a href="https://pkg.go.dev/std).">https://pkg.go.dev/std).</a></p><p>There may be cases where a package contains functionality with multiple distinct implementations. In this case, the structure should have a “parent” package as an umbrella for sub-packages managing the different implementations. For example, this is the case with the <em>encoding</em> package in the <em>stdlib</em>, which has sub-packages with their respective implementations: <em>base32</em>, <em>base64</em>, <em>json</em>, c<em>sv</em>, etc. They all use a specific way to encode data but in different formats.</p><p>A package that functions solely as a library should have a name that clearly describes its purpose. However, since it represents a single responsibility, it should be simple to use a short name to define a package’s duty. Otherwise, reconsider… the code may encompass more than one responsibility.</p><p><strong>TL;DR for libraries</strong></p><p>When you want to write code that serves as a library for other projects, consider the following:</p><ul><li>A package must contain code with a single purpose;</li><li>When there are different ways of implementing code with the same purpose, define a parent package with several sub-packages inside;</li><li>The name must describe precisely the purpose of that package. Preferably short and objective words. Go straight to the point. If it is difficult to assign a concise and accurate name, rethink;</li></ul><p><strong>Organizing application packages</strong></p><p>When we transform code into a product or service, it becomes an application used directly or indirectly by the end user. The application can be a microservice or a monolith on the backend, an app, or a webpage on the front end. Here at PicPay, Go is a language primarily used in the backend. Therefore, we will focus on the structure of such an application.</p><p>In the case of an application, the organization of packages becomes subtly different from that of a library. Here we must pay attention to four main aspects:</p><ul><li>The ability to <strong>quickly test</strong> the main functionalities of the application;</li><li><strong>Code readability</strong>, which translates into “easy-to-understand code”;</li><li>The ease of <strong>refactoring a piece of code</strong>, making it as uncoupled as possible from other parts;</li><li>Maintainability, in which adjustments are simple to make and debugs without much pain (after all, debugging an application always generates some pain 😆);</li></ul><p>It is in this sense that a package must be organized. For this, we reference the <a href="https://www.youtube.com/watch?v=MzTcsI6tn-0"><strong><em>Go best practices</em></strong></a> lecture by the duo <a href="https://www.linkedin.com/in/ashleymcnamara1/">Ashley McNamara</a> and <a href="https://www.brian.dev/about/">Brian Ketelsen</a>, where some concepts necessary to structure and organize the packages of an application are defined.</p><p>Among these concepts, two categories are defined in the organization of an application package: domain types and services.</p><p><strong>What would be the domain types?</strong></p><p>They are types that model the functionalities of the business where the application will operate. For example, within the context of <strong>Google</strong>, one domain type would be <strong>search</strong>, a core business functionality. In an application developed for <strong>an HR system</strong>, domain types can be <strong>employees</strong>, <strong>departments</strong>, and <strong>business units</strong>.</p><p>Therefore, a Go package containing a domain type must have a structure defining that type and its main attributes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b265e11905cff14da55d30ab88f7fd0/href">https://medium.com/media/5b265e11905cff14da55d30ab88f7fd0/href</a></iframe><p>The book package contains a domain type represented by the struct Book. In addition, it includes the fields that make up this type of domain and can be manipulated.</p><p>The domain type package must also include the interfaces defining how it will be handled and what operations it supports.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d09c97b5620d593e2e6ad9b606d687e4/href">https://medium.com/media/d09c97b5620d593e2e6ad9b606d687e4/href</a></iframe><p>The <em>UseCase</em> interface defines the operations that can be performed on the Book domain type.</p><p><strong>Then we enter the category of services</strong>.</p><p>The services category implements the operations defined in the domain type. In our example, the UseCase interface would be implemented in the same package as the <em>book</em> domain in a separate file containing the implementation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fa5295ac3d19c35a80176e26777ce8b/href">https://medium.com/media/5fa5295ac3d19c35a80176e26777ce8b/href</a></iframe><p>The above implementation handles data from the book domain, defining a create and read operation. In addition, there is a new element in this layer called <em>Repository</em>. We have yet to explain this abstraction, but as the name suggests, it is responsible for the data persistence layer. Therefore, it should also be considered an operation within the <em>book</em> domain. So, going back to the file that defines the domain type and its operations, we will define a new interface that defines the operations in the persistence layer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5e82724e6ece5d89ae8db24b7d8f6f5/href">https://medium.com/media/f5e82724e6ece5d89ae8db24b7d8f6f5/href</a></iframe><p>Ready! Now we have the minimal structure for the <em>book</em> domain, where the domain type, the service, and the persistence layer were defined. The abstraction of the <em>Repository</em> interface allows the implementation of persistence by any technology (Postgres, MySQL, Mongo), whichever makes sense for the context involved.</p><p>Just below, we can see an example of the organization of the <em>book</em> package, containing the type of domain, service, <em>Repository</em>, and a mock directory used in the tests (this is not part of the scope of this article, so we will not go into details here).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d55a1a76172e3c132f2886f1f87037ec/href">https://medium.com/media/d55a1a76172e3c132f2886f1f87037ec/href</a></iframe><p>In the <em>postgres</em> subpackage, we have the implementation of the Repository interface.</p><p>In an application, involving more than one domain type is very common. In addition to domains, we have layers that allow data to be manipulated by external clients. In the main patterns adopted, such as Hexagonal Architecture (or Ports And Adapters) and Clean Architecture, external actors are called driver actors, those who somehow access a domain and its operations. For this, we need to expose this domain somehow and make the entire structure defined in the book domain be used by these clients.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f5f32fec286b780dabf7cc1c8a1da45/href">https://medium.com/media/8f5f32fec286b780dabf7cc1c8a1da45/href</a></iframe><p>In the project’s organization, the cmd directory has the packages responsible for external accesses, the driver actors. In the example above, we have the <em>api</em> package that implements the REST layer to manipulate the book domain through a REST API.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68486e9ed40fae5a702477f964ec14ba/href">https://medium.com/media/68486e9ed40fae5a702477f964ec14ba/href</a></iframe><p>In this example, the <em>cmd/api/main.go</em> file initializes an HTTP server with the <a href="https://github.com/gin-gonic/gin">gin-gonic</a> framework. The <em>ginHandle.Handlers</em> function abstracts the association of the “book” service instantiated with the handler served on an endpoint. Any framework can be used here, and good practice is to isolate this abstraction layer. Here at PicPay, we abstract the use of web frameworks through a library developed in-house, which is detailed in this <a href="https://medium.com/inside-picpay/abstracting-web-libraries-in-go-applications-166feeaf6aff">article</a>.</p><p>The <em>main. go</em> file is nothing more than a service initializer and dependency injection of other modules that the service depends on, in addition to the initialization of the web server that goes up on a specific port. The code is clean, readable, and maintainable, with isolation between layers making it easy to test each independently.</p><p><strong>TL;DR for applications</strong></p><p>Based on the domain types and services concepts, below is a proposed directory structure for project organization.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81bf37d50a2620135c4ef16c50f34c5e/href">https://medium.com/media/81bf37d50a2620135c4ef16c50f34c5e/href</a></iframe><p>In the <em>book</em> directory resides the package that defines the type of domain and the interfaces used to perform operations and interactions. The implementations of these operations also live in this directory, with the implementation of the use cases in <em>service. go</em>. Finally, the persistence layer is also in the folder, explicitly declaring the technology used (in this example, Postgres).</p><p><em>config</em> contains environment variables and parameters externally mapped to the project.</p><p>The application’s <em>main</em> resides in the <em>cmd</em> package, which will be used in compiling and generating the application’s executable. This could be initializing a REST API in <em>cmd/api</em> or calls via CLI (Command Line Interface) in <em>cmd/appctl</em>. The <em>main</em> of each application should also contain the service startup and required dependency injections.</p><p>The <em>internal</em> directory combines all the implementations related to protocols used to interact with the application’s clients. In the example above, an HTTP communication layer was developed using the framework <em>gin-gonic</em> in <em>internal/http/gin</em>, where <em>handler. go</em> receives the service and creates the routes that expose the operations, associating them with the handler functions implemented in <em>book. go</em>. This package is responsible for translating HTTP requests to what the Book service understands, being an adapter in the Hexagonal Architecture. It returns the result of the service operation in an HTTP response with the data structure established by the Book contract (for example, a JSON with fields corresponding to Book properties — name, author, genre, etc.).</p><p>The <em>event</em> layer also reflects an external interaction, in this case, events that arrive or are published in a message, being an adapter for this actor driver. In the example, Kafka publishes and consumes events on one or more topics.</p><p>Ready! A structure that follows this pattern follows the principles defined in Clean Architecture and Hexagonal Architecture, which allows <strong>readability, maintainability, testability, and refactorability</strong>, free of couplings between the different layers of the application.</p><p>An important detail in cases where there is more than one domain in the project:</p><p><strong>There must be no dependencies between domain packages.</strong> The reason for its existence is to describe domain types and their behaviors. In addition, a service calling another service increases the coupling between domains, which can generate cyclic dependency and difficulty in code reuse and testability.</p><h4><strong>How to define names in my project?</strong></h4><p>One of the biggest difficulties a developer has is naming things. Let’s be honest: our creativity in creating code is inversely proportional to naming variables and functions. 😅</p><p>Let’s make life for gophers easier here, presenting some good practices for naming conventions in types, functions, packages, and variables.</p><p><strong>Naming packages</strong></p><p>We’ve mentioned this type of rule before, but it’s worth reinforcing here:</p><ul><li>Use short names! Prefer <em>transport</em> over <em>transport_mechanisms</em></li><li>The name should be clear and reflect the responsibility of that package. For example, use terms like <em>postgres</em> or <em>http</em> to describe the external implementation. For data manipulation, use manipulated data type as <em>bytes</em>, <em>json</em>, and <em>csv</em>. Simple as that!</li></ul><p>Remember this! A package should exist with one purpose only, one responsibility only. So avoid packages like <em>util</em> and <em>helper</em>. If these names cross your mind at some point, rethink the responsibility of this package.</p><p><strong>Naming variables</strong></p><p>In Go, try to use some conventions already adopted by the community to name variables, such as:</p><ul><li>Use <em>camelCase</em> instead of <em>snake_case</em> or any other case;</li><li>In indexes, try to be short. Use only one letter:</li></ul><pre>for i:= 0; i &lt; 10; i++ {}</pre><ul><li>In other cases, the names can also be short but descriptive:</li></ul><pre>var count int<br>var duration Time.Duration</pre><p>Another rule of thumb to adopt for defining the name of a variable is: the farther you use the variable from where it was declared, the longer its name should be. This reduces the cognitive complexity of reading the code and allows the developer to pay more attention to the logic than the variable itself. If you need to scroll on the screen to find the variable being used, it should have a name longer than just one letter (this could also indicate that your code needs to be refactored 👀).</p><ul><li>To represent a list/slice/array, use repeated letters:</li></ul><pre>var bb []*Book<br>for i, b := range bb {<br> <br>  // dentro do loop, é utilizado uma letra apenas<br>  fmt.Println(b.Author)<br>}</pre><p><strong>Naming functions</strong></p><p>Some good practices are also used that were adopted in the lint tools most embraced by the community.</p><ul><li>Avoid repeating the package name in a function:</li></ul><pre>log.Info() // good<br>log.LogInfo() // bad</pre><p>The package name already defines its purpose. In addition to unnecessarily extending the function name, it aggravates code readability.</p><ul><li>The Go community doesn’t embrace the use of <em>Getters</em> and <em>Setters</em> like other languages (although I’m a fan 😃):</li></ul><pre>customer.Name // good<br>customer.GetName() // bad</pre><ul><li>For interfaces that have only one function, add the <em>er</em> name suffix:</li></ul><pre>type Requester interface {<br> Request(method string, body []byte, headers string, endpoint string)<br>}</pre><ul><li>For more than one function, name it something that represents its main functionality:</li></ul><pre>type Storage interface {<br>  Read(id int) (*Customer, error)<br>  List() ([]*Customer, error)<br>  Save(c *Customer) error<br>  Delete(id int) error<br>}</pre><p><strong>Conclusions</strong></p><p>Adopting good development practices is directly related to a project’s organization and directory structure. Principles defined in SOLID, KISS, and clean architecture can be adopted in practice in different ways, depending on the language and context in which the project is inserted.</p><p>Here we were able to show how to organize a project in Go, taking into account particularities of the language and the available resources that allow better readability, maintainability, decoupling, and ease in writing tests.</p><p>From a set of conventions adopted by the Go community, it was also possible to gather a set of rules that should facilitate the definition of package names, variables, functions, and types.</p><p>All this content can continuously evolve as the language grows and brings new concepts (here, we do not utilize anything related to Generics, for example, which will be more widespread by the Go community in the future and demand new best practices ). Therefore, consider the context and your team experience, and absorb what most applies to your project. The essence is in the principles: <strong>easy to read, easy to maintain, easy to test, and easy to refactor</strong>.</p><p>We do not develop anything alone, and we are responsible for adopting practices that allow a better flow of work and development with the team you are part of and/or with the developer community if you are working on an open-source project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f0eab45375d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-picpay/organizing-projects-and-defining-names-in-go-7f0eab45375d">Organizing projects and defining names in Go</a> was originally published in <a href="https://medium.com/inside-picpay">Inside PicPay</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Melhorando o terminal]]></title>
            <link>https://eminetto.medium.com/melhorando-o-terminal-8d454075dcd6?source=rss-4485cf75ad68------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d454075dcd6</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[fish]]></category>
            <category><![CDATA[starship]]></category>
            <dc:creator><![CDATA[Elton Minetto]]></dc:creator>
            <pubDate>Tue, 16 May 2023 11:31:07 GMT</pubDate>
            <atom:updated>2023-05-16T19:28:14.706Z</atom:updated>
            <content:encoded><![CDATA[<p>O terminal é provavelmente a ferramenta que eu mais uso no meu dia a dia. Com o passar dos anos eu criei uma série de atalhos, scripts e hábitos que me fazem ser mais produtivo na execução de várias das minhas tarefas. Neste post vou contar algumas das coisas que eu configurei e venho usando, com o objetivo de talvez inspirar alguém a dedicar um tempo para fazer o mesmo.</p><h4>O shell</h4><p>O shell é a interface com a qual interagimos quando abrimos uma sessão de terminal. Por décadas o shell padrão para a grande maioria das distribuições Linux e o macOS foi o bom e velho bash mas nos últimos anos alguns competidores ganharam destaque. Talvez o mais relevante seja o <a href="https://www.zsh.org/">zsh</a>, que hoje é o padrão para o macOS e várias distros Linux. Eu usei o zsh por algum tempo, mas descobri o <a href="https://fishshell.com/">fish</a> em um tweet do <a href="https://twitter.com/caarlos0">Carlos Becker</a>, testei e não voltei atrás. O fish é mais leve e rápido do que o zsh(fato impírico, é minha impressão pois não fiz ou li benchmarks) e vem com várias <a href="https://fishshell.com/docs/current/tutorial.html#why-fish">funcionalidades</a> úteis embutidas como um auto-complete mais rápido, wildcards para navegar nos diretórios, etc.</p><p>Dica: como o padrão do macOS é o zsh eu executei o comando a seguir para instalar o fish:</p><pre>brew install fish</pre><p>E o comando para definí-lo como meu shell padrão:</p><pre>chsh -s /opt/homebrew/bin/fish</pre><h4>Salvando as configurações</h4><p>Nos derivados do Unix (Linux e macOS por exemplo) uma forma de manter a configuração de aplicações é usando-se os dotfiles, que são arquivos que começam com um . no nome. O mais interessante disso é que é fácil fazer alterações e backups das suas configurações. O que eu faço é manter estes arquivos em um serviço de núvem, como o Dropbox, e configurar minha máquina para usar estes arquivos, usando o recurso de <a href="https://pt.wikipedia.org/wiki/Liga%C3%A7%C3%A3o_simb%C3%B3lica">links simbólicos</a>.</p><p>Estes são alguns dos arquivos de configuração da minha máquina:</p><pre>❯ ls -lha ~/ | grep Dropbox<br>lrwxr-xr-x    1 eminetto  staff    36B 10 Mai  2022 .aws -&gt; /Users/eminetto/Dropbox/dotfiles/aws<br>lrwxr-xr-x    1 eminetto  staff    43B 10 Mai  2022 .gitconfig -&gt; /Users/eminetto/Dropbox/dotfiles/.gitconfig<br>lrwxr-xr-x    1 eminetto  staff    30B 10 Mai  2022 .gnupg -&gt; /Users/eminetto/Dropbox/gnupg/<br>lrwxr-xr-x    1 eminetto  staff    28B 10 Mai  2022 .ssh -&gt; /Users/eminetto/Dropbox/ssh/</pre><p>Como eu uso o fish também fiz o mesmo com os arquivos de configuração dele:</p><pre>❯ ls -lha ~/.config | grep Dropbox<br>lrwxr-xr-x   1 eminetto  staff    37B 10 Mai  2022 fish -&gt; /Users/eminetto/Dropbox/dotfiles/fish</pre><p>Para facilitar a criação destes arquivos eu criei um script que uso sempre que preciso trocar de computador:</p><pre>cd ~<br>ln -s /Users/eminetto/Dropbox/dotfiles/aws .aws<br>ln -s /Users/eminetto/Dropbox/dotfiles/.gitconfig .gitconfig<br>ln -s /Users/eminetto/Dropbox/gnupg/ .gnupg<br>ln -s /Users/eminetto/Dropbox/ssh/ .ssh<br>ln -s /Users/eminetto/Dropbox/dotfiles/sshw .sshw<br>ln -s /Users/eminetto/Dropbox/dotfiles/fish .config/fish</pre><p>Desta forma rapidamente eu tenho as configurações aplicadas aos meus aplicativos principais.</p><h4>Atalhos</h4><p>Outro recurso poderoso para se usar no terminal é criar atalhos, ou alias. Como o nome sugere, são atalhos para comandos e que aceleram a sua produtividade. Estes são alguns dos atalhos que tenho no momento em meu fish:</p><pre>❯ alias<br>alias cot &#39;open /Applications/CotEditor.app/&#39;<br>alias d docker<br>alias dc &#39;docker compose&#39;<br>alias dcdown &#39;docker compose stop&#39;<br>alias dcup &#39;docker-compose up -d&#39;<br>alias g git<br>alias icloud cd\\\ /Users/eminetto/Library/Mobile\\\\\\\ Documents/com\\\~apple\\\~CloudDocs/<br>alias k kubectl<br>alias kb kubectl<br>alias ls &#39;ls -G&#39;<br>alias open-ports netstat\\\ -anvp\\\ tcp\\\ \\\|\\\ awk\\\ \\\&#39;NR\\\&lt;3\\\ \\\|\\\|\\\ /LISTEN/\\\&#39;<br>alias py3 python3<br>alias subl /Applications/Sublime\\\\\\\ Text.app/Contents/SharedSupport/bin/subl</pre><p>Para salvar um alias no fish basta executar:</p><pre>alias -s icloud=&quot;cd xxx&quot;</pre><p>E a configuração vai ser salva no diretório ~/.config/fish. Cada shell tem um comando para isso, recomendo pesquisar como fazer isso no seu.</p><p>Outro lugar onde é possível adicionar atalhos é no arquivo ~/.gitconfig. Estes são alguns que eu criei:</p><pre>[alias]<br>  cleanup = &quot;!git fetch --all --prune; git branch --merged origin/master | grep -v \&quot;\\*\&quot; | grep -v \&quot;\\  master\&quot; | xargs -n 1 git branch -d&quot;<br>  s = status<br>  d = diff<br>  co = checkout<br>  br = branch<br>  c = commit</pre><p>Desta forma eu posso aliar o alias do fish com o do git e ao invés de digitar:</p><pre>git commit -m &quot;message&quot;</pre><p>Basta executar:</p><pre>g c -m &quot;message&quot;</pre><p>E eu ganho alguns segundos a cada comando :)</p><p>Uma dica relacionada ao git e que eu estou usando é configurar o 1Password para assinar os meus commits. Nesta <a href="https://developer.1password.com/docs/ssh/">documentação</a> é possível ver como fazer isso.</p><h4>Customizando o prompt</h4><p>Como eu comentei no começo deste post, o shell é a interface com a qual interagimos com o sistema operacional. E interfaces deveriam ser amigáveis e bonitas. Uma forma de se atingir isso é usando uma ferramenta que permita customizações e a dica que quero deixar aqui é o <a href="https://starship.rs/">Starship</a>. Trata-se de uma aplicação feita em Rust e que pode ser usada em qualquer shell para permitir customizações do prompt, que é o input onde digitamos os comandos. A instalação e configuração é muito simples, conforme consta na página inicial do projeto. Após instalado basta configurar o arquivo ~/.config/starship.toml. Por exemplo, a configuração:</p><pre>[aws]<br>disabled = true<br><br>[cmake]<br>disabled = true<br><br>[cmd_duration]<br>min_time = 500<br>format = &quot;[$duration]($style) &quot;<br><br>[conda]<br>disabled = true<br><br>[crystal]<br>disabled = true<br><br>[dart]<br>disabled = true<br><br>[docker_context]<br>disabled = true<br><br>[dotnet]<br>disabled = true<br><br>[elixir]<br>disabled = true<br><br>[elm]<br>disabled = true<br><br>[env_var]<br>disabled = true<br><br>[erlang]<br>disabled = true<br><br>[gcloud]<br>disabled = true<br><br>[golang]<br>disabled = true<br><br>[helm]<br>disabled = true<br><br>[java]<br>disabled = true<br><br>[jobs]<br>disabled = true<br><br>[julia]<br>disabled = true<br><br>[kotlin]<br>disabled = true<br><br>[kubernetes]<br>format = &#39;[☸ $context \($namespace\)](dimmed green) &#39;<br>disabled = false<br><br>[lua]<br>disabled = true<br><br>[memory_usage]<br>disabled = true<br>threshold = -1<br>symbol = &#39; &#39;<br>style = &#39;bold dimmed green&#39;<br><br>[nim]<br>disabled = true<br><br>[nix_shell]<br>disabled = true<br><br>[nodejs]<br>disabled = true<br><br>[ocaml]<br>disabled = true<br><br>[openstack]<br>disabled = true<br><br>[package]<br>disabled = true<br><br>[perl]<br>disabled = true<br><br>[php]<br>disabled = true<br><br>[purescript]<br>disabled = true<br><br>[python]<br>disabled = true<br><br>[ruby]<br>disabled = true<br><br>[rust]<br>disabled = true<br><br>[scala]<br>disabled = true<br><br>[shlvl]<br>disabled = true<br><br>[singularity]<br>disabled = true<br><br>[swift]<br>disabled = true<br><br>[status]<br>style = &#39;bg:blue&#39;<br>symbol = &#39;🔴 &#39;<br>success_symbol = &#39;🟢 SUCCESS&#39;<br>format = &#39;[\[$symbol$common_meaning$signal_name$maybe_int\]]($style) &#39;<br>map_symbol = true<br>disabled = false<br><br>[terraform]<br>disabled = true<br><br>[vagrant]<br>disabled = true<br><br>[zig]<br>disabled = true<br><br>[username]<br>format = &quot;[$user]($style)@&quot;</pre><p>Gera o seguinte visual no meu terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mP2RDzU9E0C58tQD.jpg" /></figure><p>Sendo que, na imagem:</p><ul><li>rancher-desktop é o nome do cluster Kubernetes onde estou conectado</li><li>votes é o nome do namespace do Kubernetes</li><li>api-o11y é o nome do diretório onde estou</li><li>add-metrics é o nome da branch do git</li><li>[!] indica que houveram alterações na branch atual, o equivalente a um git status</li><li>5s é o tempo que demorou a execução do último comando</li><li>🟢 SUCCESS indica que o último comando que executei finalizou com sucesso.</li></ul><p>Na <a href="https://starship.rs/config/">documentação</a> do Starship é possível ver todas as configurações possíveis.</p><p>Espero que estas dicas ajudem e inspirem você a dedicar um tempo para customizar e otimizar o seu terminal. Garanto que vai ser divertido e melhorar sua performance no dia a dia. Aproveite e compartilhe as suas dicas também, eu adoraria adicionar novos truques ao meu workflow :)</p><p><em>Originally published at </em><a href="https://eltonminetto.dev/post/2023-05-16-improving-terminal/"><em>https://eltonminetto.dev</em></a><em> on May 16, 2023.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d454075dcd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>