<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: J0sueTM</title>
    <description>The latest articles on Forem by J0sueTM (@j0suetm).</description>
    <link>https://forem.com/j0suetm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1082534%2F082420f5-07a3-498d-b815-679bb3fe9b56.png</url>
      <title>Forem: J0sueTM</title>
      <link>https://forem.com/j0suetm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/j0suetm"/>
    <language>en</language>
    <item>
      <title>O que realmente significa ser um Engenheiro de Software?</title>
      <dc:creator>J0sueTM</dc:creator>
      <pubDate>Tue, 04 Jun 2024 13:10:55 +0000</pubDate>
      <link>https://forem.com/j0suetm/o-que-realmente-significa-ser-um-engenheiro-de-software-o16</link>
      <guid>https://forem.com/j0suetm/o-que-realmente-significa-ser-um-engenheiro-de-software-o16</guid>
      <description>&lt;h2&gt;
  
  
  Introdução
&lt;/h2&gt;

&lt;p&gt;Iniciei minha carreira na área de TI por volta de 2018, enquanto ainda era estudante. Após alguns anos, já no meu primeiro emprego, comecei a me autodenominar "Engenheiro de Software" nas redes sociais. Não, esse não era meu título profissional, nem eu compreendia completamente seu significado; simplesmente gostava da seriedade e experiência que essa designação conferia aos meus perfis online.&lt;/p&gt;

&lt;p&gt;Caso o leitor se identifique com minha experiência (ou não, também 😅), esta redação será de seu agrado. Nela, busco contextualizar a filosofia e a história por trás dos títulos e cargos utilizados por todos nós, "povo da computação", e, ao final, tento trazer luz a esse tema tão raramente discutido.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nota ao leitor&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Antes de prosseguir com a leitura, é importante esclarecer alguns pontos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Este texto pode ser categorizado como uma crítica, porém não é direcionado a ninguém ou a nenhum grupo específico (exceto aos profissionais da área computacional). Portanto, peço que o leitor o encare apenas como um artefato informativo;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A pesquisa foi realizada deliberadamente por mim, movido pela curiosidade. Portanto, não considere tudo que é apresentado aqui como dogma. Faça sua própria pesquisa e verifique as referências antes de aceitar qualquer informação;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tentei ser o mais didático possível, incluindo referências e sendo crítico em minhas opiniões. No entanto, sou humano e posso estar equivocado. As críticas não apenas são bem-vindas, como também são necessárias;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conferências de Garmisch
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3mrho5e5ue8gk08j92y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3mrho5e5ue8gk08j92y.png" alt="conferencia de Garmisch" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Em 1968, o Comitê de Ciência da NATO (Organização do Tratado do Atlântico Norte) organizou algumas conferências em Garmisch, na Alemanha, onde mais de 50 participantes internacionais discutiram sobre os problemas emergentes dos softwares da época. Devido à evolução não apenas das tecnologias disponíveis, mas também dos problemas reais que essas tecnologias enfrentavam, tornou-se urgentemente necessário o desenvolvimento e a regulamentação de uma nova metodologia capaz de produzir Software para suprir as necessidades da sociedade moderna (NAUR; RANDELL, 1969).&lt;/p&gt;

&lt;p&gt;Embora o conceito de "Engenharia de Software" por si só não tenha sido o único tema discutido nessas conferências, muito menos o produto final, elas foram determinantes para a valorização e popularização dessa nova disciplina com o passar do tempo. Nas palavras de Margaret Hamilton (HANCOCK, 2014):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqef1hbr9fqc3f460ax6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqef1hbr9fqc3f460ax6.png" alt="margaret hamilton dando uma palestra" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quando comecei a usar essa expressão [Engenharia de Software], ela era considerada um tanto engraçada. Foi motivo de piada por um bom tempo. Eles [provavelmente outros desenvolvedores do Apollo Guide Computer] gostavam de brincar comigo sobre minhas ideias radicais. O Software eventualmente e necessariamente ganhou o mesmo respeito que as outras disciplinas.&lt;/p&gt;

&lt;p&gt;-- Margaret Hamilton, entrevista para El País, 2014&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claramente, as conferências foram uma resposta a um contexto da época. Portanto, é importante, antes de prosseguirmos, esclarecer por que o conceito de "Engenharia de Software" encontrou resistência durante sua concepção e implementação.&lt;/p&gt;

&lt;h2&gt;
  
  
  As três tradições da computação
&lt;/h2&gt;

&lt;p&gt;Apesar de ser uma disciplina relativamente nova, a computação, em seu primeiro século de existência, passou e ainda passa por transformações e ramificações únicas, fazendo da Engenharia de Software um conglomerado de outras disciplinas que, simultaneamente, se complementam e disputam entre si (TEDRE; SUTINEN, 2008). São elas:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tradição Matemática&lt;/strong&gt;: programas são tratados como objetos abstratos, estruturas teóricas e sistemas axiomáticos que avaliam de maneira booleana. (MCCARTHY, 1960) é um ótimo exemplo de uma definição de um software com uma grande influência da tradição matemática;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tradição Científica&lt;/strong&gt;: programas são tratados como modelos de informação que buscam, seguindo algum sistema científico idealizado, satisfazer dados que comprovam uma hipótese ou seguem o processo científico;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tradição da Engenharia&lt;/strong&gt;: programas são processos que afetam e são afetados pelo mundo real. Trata-se da agregação de sistemas computacionais existentes de forma a produzir um novo sistema;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;É interessante ressaltar que muitas autoridades têm formulado diversos argumentos e contra-argumentos para cada uma das tradições detalhadas. Um dos exemplos mais difundidos é o do Prof. Dr. Edsger Dijkstra, renomado matemático por trás de muitos fundamentos da computação, que definiu a Engenharia de Software, em seu ensaio "Sobre a crueldade de realmente ensinar Ciência da Computação" (E.W. DIJKSTRA ARCHIVE, 2023), como "A Disciplina Condenada":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwhlghq1nwzo7et5wf2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwhlghq1nwzo7et5wf2e.png" alt="edsger dijkstra" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Assim como a economia é conhecida como "A Ciência Miserável", a Engenharia de Software deveria ser conhecida como "A Disciplina Condenada"; condenada porque nem chega perto de atingir seu objetivo, já que seu objetivo é contraditório por si próprio. Claramente, a Engenharia de Software se apresenta como uma causa válida, mas isso é enganação: se você ler sua literatura e analisar o que seus devotos realmente fazem, descobrirá que a Engenharia de Software aceitou como sua missão "Como programar se você não o sabe.".&lt;/p&gt;

&lt;p&gt;-- Edsger W. Dijkstra, EWD 1036&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Em contraste, detalharei alguns argumentos que não buscam provar a superioridade da tradição da engenharia, mas sim demonstrar a necessidade de sua existência quando comparada às outras disciplinas:&lt;/p&gt;

&lt;h3&gt;
  
  
  Modelos Teóricos vs. Mundo Real
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf2vclfiiwr2s8bkgoqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flf2vclfiiwr2s8bkgoqs.png" alt="pintura do grande fogo de roma" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Se o leitor estiver familiarizado com teorias dualistas, idealistas, fenomenológicas, platônicas (por ex. PLATO, 1986) ou neoplatônicas, terá mais facilidade em reconhecer a validade deste primeiro argumento.&lt;/p&gt;

&lt;p&gt;A matemática trata principalmente de abstrações teóricas que, em sua maioria, mas não necessariamente, correspondem aos fenômenos naturais (THOMAS; MAURER, 1986). Com essa definição em mente, surge naturalmente um problema quando a matemática é aplicada à computação: Modelos teóricos de programas podem ser validados puramente de forma axiomática; o mesmo programa em execução em uma máquina entra em contato com variáveis naturais que impossibilitam sua validação (TEDRE; SUTINEN, 2008, p. 156). Não existe sequer um modelo matemático que consiga provar (exceto em teoria) com 100% de certeza como os elétrons de um computador se comportarão durante a execução do mesmo programa (TEDRE; SUTINEN, 2008, p. 157).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Imagine que o leitor está executando o programa mais bem testado do mundo no computador mais confiável do mundo. De repente, um terremoto de nível 9 na escala Richter ocorre, seguido por uma chuva contínua; alguns segundos depois, o sol explode e incendeia tudo o que existe... Deseje boa sorte aos modelos teóricos.&lt;/p&gt;

&lt;p&gt;Sim, este exemplo está longe de acontecer. No entanto, a ideia continua sendo verdadeira: não controlamos, nem conseguimos prever todas as variáveis do universo. Nenhum programa em execução é 100% eficaz.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ao reconhecer essa diferença, a Engenharia de Software procura lidar da melhor maneira possível com esses problemas do mundo real. Não é à toa que desenvolvemos e aprimoramos algoritmos como os de tolerância a falhas, replicação, consenso, balanceamento de carga, etc., que compõem os sistemas que fazem a sociedade atual funcionar. O leitor talvez se recorde das primeiras máquinas computacionais do início do século passado: sistemas elétricos enormes que falhavam constantemente. Sem a influência dos engenheiros elétricos, é discutível a hipótese de que a computação estaria, ainda hoje, nos gabinetes teóricos da matemática (TEDRE; SUTINEN, 2008, pp. 161-162).&lt;/p&gt;

&lt;h3&gt;
  
  
  Processo Científico vs. Construção de Software
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx0q33g6yl62j8ngtfpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcx0q33g6yl62j8ngtfpn.png" alt="diagrama do processo científico" width="368" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aqui entramos em um território altamente contraditório, completamente fora da minha atual autoridade para argumentar de forma a adicionar qualquer progresso: "O território das Definições Inacabadas".&lt;/p&gt;

&lt;p&gt;A ciência em si é um conceito amplo que, consequentemente, possui diversas lacunas de definição autoritárias como "O que é ciência?" ou "Qual o modelo ideal de processo científico?". Esta falta de definição (que por sua vez não é algo necessariamente ruim ou proveniente de inexperiência, mas sim da natureza da filosofia e dos limites humanos em geral) torna possível que uma questão em específico emerja: A computação pode ser considerada, por definição, uma ciência? Ou até mais, uma ciência natural? Em outras palavras, levando em conta a definição de que as ciências naturais tratam da observação e estudo de fenômenos naturais (THOMAS; MAURER, 1986), é possível categorizar a ciência da computação como uma?&lt;/p&gt;

&lt;p&gt;Diversos autores têm adentrado em detalhes acerca desse questionamento e o debatido. Entretanto, irei focar em apenas um contestamento, para que possamos avançar no fortalecimento da nossa visão atual sobre a Engenharia de Software.&lt;/p&gt;

&lt;p&gt;O contra-argumento mais difundido é de que a computação não procura estudar um fenômeno natural de forma a produzir um mais amplo entendimento do mundo. Em realidade, os únicos dados e fenômenos observados são, em suma, o computador e seus processos, os quais já são muito bem entendidos na disciplina. Isso torna a pesquisa não um entendimento acerca dos fenômenos naturais, mas sim de fenômenos artificiais que não apenas são entendidos, como também foram criados. Segundo esse contra-argumento, a única resolução dessas pesquisas é validar o quão bem os últimos pesquisadores construíram seus Softwares (HARTMANIS, 1993).&lt;/p&gt;

&lt;p&gt;Considerando também este ponto, a Engenharia de Software entende sua artificialidade e suas limitações de pesquisa, procurando voltar seus métodos de aprimoramento especialmente para o entendimento dos sistemas computacionais já existentes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusão
&lt;/h2&gt;

&lt;p&gt;Meu objetivo inicial ao começar a escrever este ensaio era apenas sanar minha curiosidade. Porém, conforme o texto foi se preenchendo, julguei inconveniente não compartilhar o conhecimento adquirido.&lt;/p&gt;

&lt;p&gt;Como foi requisitado na introdução, eu espero que a leitura tenha sanado lacunas de conhecimento que o leitor possuísse, e que finalmente entenda o porquê de nos chamarmos Engenheiros de Software.&lt;/p&gt;

&lt;p&gt;Obrigado pelo seu tempo. Não hesite em comentar qualquer dúvida ou opinião!&lt;/p&gt;

&lt;p&gt;Josué Teodoro Moreira&lt;br&gt;
&lt;a href="https://j0suetm.com"&gt;https://j0suetm.com&lt;/a&gt;, &lt;a href="mailto:teodoro.josue@pm.me"&gt;teodoro.josue@pm.me&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/josue-teodoro-moreira/"&gt;https://www.linkedin.com/in/josue-teodoro-moreira/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Referências Bibliográficas
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;MCCARTHY, J. Recursive functions symbolic expressions and their computation by machine, Part I. Communications of the ACM, v. 3, n. 4, p. 184–195, 1 abr. 1960.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HANCOCK, Jaime Rubio. Margaret Hamilton, la pionera de la programación que llevó el Apolo a la Luna. 2014. Disponível em: &lt;a href="https://verne.elpais.com/verne/2014/12/11/articulo/1418314336_993353.html"&gt;https://verne.elpais.com/verne/2014/12/11/articulo/1418314336_993353.html&lt;/a&gt;. Arquivado em: &lt;a href="https://web.archive.org/web/20141225145142/https://verne.elpais.com/verne/2014/12/11/articulo/1418314336_993353.html"&gt;https://web.archive.org/web/20141225145142/https://verne.elpais.com/verne/2014/12/11/articulo/1418314336_993353.html&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NAUR, P.; RANDELL, B. (EDS.). Software Engineering: Report on a conference sponsored by the NATO SCIENCE COMMITTEE. [s.l.] Brussels: Scientific Affairs Division, NATO, 1969.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PLATO. Republic. Translated by G.M.A. Grube, revised by C.D.C. Reeve. Indianapolis: Hackett Publishing Company, 1992.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TEDRE, M.; SUTINEN, E. Three traditions of computing: what educators should know. Computer Science Education, v. 18, n. 3, p. 153–170, set. 2008.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;THOMAS, A. S.; MAURER, A. A.; PONTIFICAL INSTITUTE OF MEDIAEVAL STUDIES. The division and methods of the sciences : questions V and VI of his Commentary on the De Trinitate of Boethius. Toronto: Pontifical Institute Of Mediaeval Studies, 1986.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;E.W. Dijkstra Archive: On the cruelty of really teaching computing science (EWD 1036). Disponível em: &lt;a href="https://www.cs.utexas.edu/%7EEWD/transcriptions/EWD10xx/EWD1036.html"&gt;https://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1036.html&lt;/a&gt;. Arquivado em: &lt;a href="https://web.archive.org/web/20240330000400/https://www.cs.utexas.edu/%7EEWD/transcriptions/EWD10xx/EWD1036.html"&gt;https://web.archive.org/web/20240330000400/https://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD1036.html&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HARTMANIS, J. Some observations about the nature of computer science. In: SHYAMASUNDAR, R.K. (Ed.). Lecture notes in computer science, Vol. 761. Berlin: Springer, 1993. p. 1–12.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>softwareengineering</category>
      <category>history</category>
    </item>
    <item>
      <title>How to handle concurrency in Clojure with core.async</title>
      <dc:creator>J0sueTM</dc:creator>
      <pubDate>Mon, 15 Jan 2024 23:50:07 +0000</pubDate>
      <link>https://forem.com/j0suetm/how-to-handle-concurrency-in-clojure-with-coreasync-5n5</link>
      <guid>https://forem.com/j0suetm/how-to-handle-concurrency-in-clojure-with-coreasync-5n5</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
The building blocks

&lt;ul&gt;
&lt;li&gt;Channels&lt;/li&gt;
&lt;li&gt;Messages&lt;/li&gt;
&lt;li&gt;Producers and Consumers&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Implementation

&lt;ul&gt;
&lt;li&gt;Include it&lt;/li&gt;
&lt;li&gt;Behold! the channel&lt;/li&gt;
&lt;li&gt;Put and Take&lt;/li&gt;
&lt;li&gt;Ordinary Threads&lt;/li&gt;
&lt;li&gt;Go Blocks&lt;/li&gt;
&lt;li&gt;Alts&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;References&lt;/li&gt;

&lt;/ul&gt;

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

&lt;p&gt;Hey, how you doing? This article was written right after I had to painstakingly read the &lt;a href="https://github.com/clojure/core.async" rel="noopener noreferrer"&gt;&lt;code&gt;clojure.core.async&lt;/code&gt; source code&lt;/a&gt; in order to finish a task. So, I hope I save you from the same fate as I had 😄.&lt;/p&gt;

&lt;p&gt;Also, since I tried to create content that can be used on both Clojure and ClojureScript systems, I opted for a more generic option &lt;code&gt;core.async&lt;/code&gt;. There are other libraries out there, like the java virtual Threads, which can, in certain use cases, be a better suit than the one presented here.&lt;/p&gt;

&lt;p&gt;If you're a visual learner and prefer video, I recommend &lt;a href="https://www.youtube.com/watch?v=hMEX6lfBeRM" rel="noopener noreferrer"&gt;this talk&lt;/a&gt; by Rich Hikey, the creator of Clojure, that goes a bit deeper into the inner concepts that went into the design of this tool.&lt;/p&gt;

&lt;p&gt;Anyhow, I hope this may help you. Feel free to contact me in any case.&lt;/p&gt;

&lt;h2&gt;
  
  
  The building blocks
&lt;/h2&gt;

&lt;p&gt;Before working our way into Concurrency de-facto in Clojure, I want to make sure that everyone is one the same basis. If you already know what is concurrency, then you can skip this section.&lt;/p&gt;

&lt;h3&gt;
  
  
  Channels
&lt;/h3&gt;

&lt;p&gt;Channels are one of the main pillars in the &lt;code&gt;clojure.core.async&lt;/code&gt; lib and most other concurrency libraries out there; you can think of them as tunnels where things get into from one side, go through, and then get out from the other side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1r4dezg0obunr44e8gx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1r4dezg0obunr44e8gx.png" alt="A tunner symbolazing a channel"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Messages
&lt;/h3&gt;

&lt;p&gt;The thing that goes through a channel is called a &lt;strong&gt;message&lt;/strong&gt;, or an &lt;strong&gt;event&lt;/strong&gt;. Messages can be anything really, as long as it can be produced and sent through the channel, it's good to go!&lt;/p&gt;

&lt;h3&gt;
  
  
  Producers and consumers
&lt;/h3&gt;

&lt;p&gt;The thing that creates the message and puts it into the channel is called a &lt;strong&gt;producer&lt;/strong&gt;, and the thing that receives the message on the other end, is called a &lt;strong&gt;consumer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyu9sscz8rhdnjl0czrn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyu9sscz8rhdnjl0czrn3.png" alt="A fedex package, symbolizing the process of procuding, delivering and consuming"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;That's really all there is to it, a channel is theoretically a place where &lt;strong&gt;messages&lt;/strong&gt; sent by &lt;strong&gt;producers&lt;/strong&gt; are received by &lt;strong&gt;consumers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you're a student and know a bit about CS, its also valid to know that most Channels implementation are built upon the &lt;a href="https://en.wikipedia.org/wiki/Queue_(abstract_data_type)" rel="noopener noreferrer"&gt;Queue Data Structure&lt;/a&gt;, i.e. FIFO.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clojure Implementation
&lt;/h2&gt;

&lt;p&gt;First of all, I'd like to note that there are multiple ways of working concurrently in Clojure/Script, based on your needs. In this article, I'll tackle the &lt;code&gt;clojure.core.async&lt;/code&gt; lib. Its available on both JVM and Javascript ecosystems, and can be used to build powerfull asynchronous applications.&lt;/p&gt;

&lt;p&gt;I made this article with JVM in mind, so please be aware that since there are small (but important) differences between the JVM and JS implementations, your walkthrought using Cljs might be slightly different from the one shown here.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Javascript applications are single-threaded, so blockeable actions aren't going to work (they'll actually not even transpile). Examples that might not work on JS will be signalized.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Include It!
&lt;/h3&gt;

&lt;p&gt;You can include the library like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:require&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;clojure.core.async&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;async&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:refer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:all&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;or you can be more specific and include only the used items:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:require&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;clojure.core.async&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:refer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;chan&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;&amp;lt;!!&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;or you can use the namespace instead of including unique items:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;:require&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;clojure.core.async&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;async&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="c1"&gt;;; example&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;async/chan&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Behold! the channel
&lt;/h3&gt;

&lt;p&gt;First thing first, a channel needs to be initialized in order for the async functionalities to be able to work:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;A channel will close automatically, but you can close it manually:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;my-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="c1"&gt;;; do powerfull asynchronous computations&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;close!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my-channel&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;Also, a channel doesn't necessarily needs to begin &lt;code&gt;unbuffered&lt;/code&gt;, (without any messages). You can create a channel that already has messages in it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;my-buffered-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Put and Take
&lt;/h3&gt;

&lt;p&gt;As stated before, a channel is usually a Queue, where its operations follow the order FIFO (First In First Out, where the First inserted element will be the first to be taken out as well).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Non CS people can assimilate this to the boring tuesday FastFood queue: The first person to ask for a burger will be the first to receive it, and consequently, the last one (the timid guy) to ask for his sandwich will be the last one to receive this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkifpwpsczou8gyz2mnq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkifpwpsczou8gyz2mnq4.png" alt="A queue symbolazing the queue data structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;core.async&lt;/code&gt;, we use the operations named &lt;code&gt;PUT&lt;/code&gt; AND &lt;code&gt;TAKE&lt;/code&gt; to do the operations of inserting and removing. They assume the forms &lt;code&gt;&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;&lt;/code&gt; to signalize the operation, respectively. Not only that, but the symbols are actually &lt;code&gt;&amp;gt;!&lt;/code&gt; and &lt;code&gt;&amp;gt;!!&lt;/code&gt; for PUT, and &lt;code&gt;&amp;lt;!&lt;/code&gt; and &lt;code&gt;&amp;lt;!!&lt;/code&gt; for TAKE. We'll learn the differences in a second, but I hope you got the visual idea of the these symbols.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you didn't, think of the PUT as a spear poking the channel, hoping it will open in order to PUT something in there. The TAKE, on the other hand, is like a spear already inside the channel, poking it from the inside, hoping it will open in order for something to get out of there, to be TAKEN from the channel.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp85i3pmyrivbkvpotdhv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp85i3pmyrivbkvpotdhv.png" alt="A spear symbolizing the put and take operations"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Ordinary Threads
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This entire section might not work in JS&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When creating a channel, any raw operation will be a &lt;em&gt;fake asynchronous operation&lt;/em&gt;, because the only thread owning it is the main thread, meaning it will still block the main thread (which will consequently block the other tasks of the application).&lt;/p&gt;

&lt;p&gt;To circunvent that, it's necessary to create a thread that doesn't impact the main one. There're two ways of doing that. The first one is to literally open a child thread:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;people-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;thread&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;!!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"josue"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"the first person to enter was "&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c1"&gt;;; =&amp;gt; the first person to enter was josue&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;Did you note the &lt;code&gt;&amp;gt;!!&lt;/code&gt; put operation there? The meaning of the double &lt;code&gt;!&lt;/code&gt; is that that operation is blocking. i.e. The thread it is in will be blocked. The same applies to the &lt;code&gt;&amp;lt;!!&lt;/code&gt; take operation after that. It means that the thread its in (in this case the main one) will be blocked until the operation is finished.&lt;/p&gt;

&lt;h3&gt;
  
  
  Go blocks
&lt;/h3&gt;

&lt;p&gt;Now, usually, any asynchronous operation should take the minimum amount of overhead on top on the main thread. And whats that operation? The final taking one. Its a crucial step for communication with the rest of the modules of your application, so we technically let it take its time. However, any other operation, putting or taking, as long as its not the final retrieval, should be done in a non-blocking manner.&lt;/p&gt;

&lt;p&gt;Theres where our &lt;code&gt;go&lt;/code&gt; blocks enter the scene. They're a less explict version of &lt;code&gt;thread&lt;/code&gt; that handles the IOC (inversion of control).&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;people-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;people-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"josue"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;gt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;people-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"maria"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;people-channel&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c1"&gt;;; =&amp;gt; josue&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;Now, comparing to the ordinary threads, can You see that the operations inside the &lt;code&gt;go&lt;/code&gt; block have only a single &lt;code&gt;!&lt;/code&gt;? That's because they signalize that. Also, pay attention to how, on the last block of code, we take the content from the &lt;code&gt;people-channel&lt;/code&gt;, and then do a blocking take &lt;code&gt;&amp;lt;!!&lt;/code&gt; again. This is necessary in order to retrieve data from an asynchronous channel (this time created by &lt;code&gt;go&lt;/code&gt;) back to the main thread.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alts
&lt;/h3&gt;

&lt;p&gt;Lets suppose we're creating a chat application. First things first, I think about creating a channel for the &lt;code&gt;josue&lt;/code&gt; user:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;josue-channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;josue-channel&lt;/span&gt;&lt;span class="p"&gt;)))]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;when&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"josue sent a message: "&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;

&lt;p&gt;Hey, that looks nice. But wait, I just received an email from my client, and he's asking me to add 2500 more channels, they're marketing geniuses and the userbase grew from a weird nerd that uses the app every night to a quarter thousand people. I can't add all of those channels manually, there must be a better way to do that, right? Please tell me there is.&lt;/p&gt;

&lt;p&gt;Of course there is, my friend, with Alts. They are a powerfull tool in &lt;code&gt;core.async&lt;/code&gt; that lets you work with waiting for messages on multiples channels on the same time.&lt;/p&gt;

&lt;p&gt;Now, with that feature in mind, our code can support as many channels as possible (as long as our memory doesn't explode 😄), and look as simple as it has ever looked:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;defn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;create-channels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;people-count&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;channels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;repeatedly&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;people-count&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;chan&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;go&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;alts!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;channels&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"New message to "&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;": "&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)))))&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;create-channels&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;


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

&lt;/div&gt;




&lt;p&gt;That's all folks! It's always a great day to wake up and learn something new. And look, you just did that! I'm proud of you!&lt;/p&gt;

&lt;p&gt;Thanks for taking the time to read my words, I'm really grateful.&lt;/p&gt;

&lt;p&gt;Sincerely yours, Josué Teodoro Moreira | &lt;a href="mailto:teodoro.josue@pm.me"&gt;teodoro.josue@pm.me&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/clojure/core.async" rel="noopener noreferrer"&gt;&lt;code&gt;clojure.core.async&lt;/code&gt; source code&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>clojure</category>
      <category>async</category>
      <category>functional</category>
    </item>
    <item>
      <title>Separação de Conceitos e Localidade de Comportamento - Um guia imparcial</title>
      <dc:creator>J0sueTM</dc:creator>
      <pubDate>Mon, 21 Aug 2023 16:13:46 +0000</pubDate>
      <link>https://forem.com/j0suetm/separacao-de-conceitos-e-localidade-de-comportamento-um-guia-imparcial-25hh</link>
      <guid>https://forem.com/j0suetm/separacao-de-conceitos-e-localidade-de-comportamento-um-guia-imparcial-25hh</guid>
      <description>&lt;p&gt;Você agora é um pedreiro. Isso mesmo, o melhor da cidade ainda. Um cliente te pediu para construir uma casa; já comprou as ferramentas, o cimento e os tijolos, o engenheiro civil até já fez a planta. Agora basta você pegar todos esses recursos, organizá-los e utilizá-los de alguma forma a ter o produto final: a casa. Como você vai fazer isso?&lt;/p&gt;

&lt;p&gt;Talvez você não consiga resolver esse problema; Quem sabe, se eu trocar um pouquinho a história... Pronto! agora você é um engenheiro de software que precisa construir um produto. A IDE tá aberta, o café tá na mesa, a daily é daqui 5 minutos. Até os juniors estão prontos pra trabalhar como um sênior pelo preço de um estagiário!! Como você vai juntar seus recursos e produzir esse Software?&lt;/p&gt;

&lt;h2&gt;
  
  
  Glossário
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SoC / SdC : Separation of Concerns / Separação de Conceitos&lt;/li&gt;
&lt;li&gt;LoB / LdC: Locality of Behavior / Localidade de Comportamento&lt;/li&gt;
&lt;li&gt;EdS: Engenharia de Software&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Balas de prata e favoritismo
&lt;/h2&gt;

&lt;p&gt;Um dos maiores problemas da EdS é o famoso favoritismo/elitismo. Existe um errôneo ideal de estar sempre do lado certo. Isso não acontece só na EdS, mas é muito prevalecente nessa área, devido a enorme quantidade de escolhas. Não é à toa que não temos um dia de paz na &lt;em&gt;bolha tech&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Venho antes de tudo declarar que este artigo é uma apresentação dos conceitos e aplicações de SoC e LoB. Não estou colocando nenhum acima do outro. Existem momentos certos para um, e para o outro. Ser Engenheiro é também ser crítico e entendedor. Já diziam os sábios:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Depende.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  O que são estes palavrões?
&lt;/h2&gt;

&lt;p&gt;SoC e LoB são princípios que procuram descrever como uma codebase é organizada, em quesitos como árvore de arquivos, nomenclatura, alinhamento, posição de código, etc. Não se preocupe, irei entrar em mais detalhes a seguir. Trazendo como exemplo o problema do pedreiro no começo, a forma como os tijolos serão colocados, o tamanho dos cômodos, etc. são prováveis princípios seguidos durante toda a construção da casa.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separação de Conceitos
&lt;/h3&gt;

&lt;p&gt;A Separação de Conceitos trata da modularização dos aspectos de um Software, de forma a prover coesão ao separar blocos de código baseado em seu aspecto e função primordial. você cuida de X? Então vai pra pasta dos Xs. Você cuida de Y, vai pra pasta do Ys, etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In another mood we may ask ourselves whether, and if so: why, the program is desirable. But nothing is gained—on the contrary!—by tackling these various aspects simultaneously. It is what I sometimes have called "the separation of concerns", which, even if not perfectly possible, is yet the only available technique for effective ordering of one's thoughts, that I know of. This is what I mean by "focusing one's attention upon some aspect": it does not mean ignoring the other aspects, it is just doing justice to the fact that from this aspect's point of view, the other is irrelevant. It is being one- and multiple-track minded simultaneously. - &lt;a href="https://www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD447.html"&gt;Edsger W. Dijkstra&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;O exemplo mais canônico é a forma como as aplicações Web são criadas (vanilla): por meio de 3 tipos de arquivos diferentes: HTML, CSS e Javascript. Dessa maneira, existe uma separação de aspectos: O HTML fica com a declaração dos elementos da DOM, o CSS com a estilização desses elementos, e por fim o Javascript complementa a interação entre esses próprios elementos e o usuário.&lt;/p&gt;

&lt;h3&gt;
  
  
  Localidade de comportamento
&lt;/h3&gt;

&lt;p&gt;A localidade de comportamento trata da organização dos módulos de uma codebase com base na proximidade do comportamento de uma seção de código, ao invés do aspecto em si.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“The primary feature for easy maintenance is locality: Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.” - &lt;a href="https://www.dreamsongs.com/Files/PatternsOfSoftware.pdf"&gt;Richard Gabriel&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;O LoB tem suas origens nessa citação de Richard Gabriel, do qual o princípio em si é formulado da seguinte maneira:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;O comportamento de um pedaço de código deve ser o mais óbvio possível olhando apenas para esse pedaço de código.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Qual a diferença na prática?
&lt;/h2&gt;

&lt;p&gt;Um exemplo prático que posso dar são as recentes Frameworks Javascript e CSS. Nesse caso, vou estar falando de React e Tailwind. Observe o seguinte arquivo jsx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josué&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Teodoro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;px-4 py-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;formatName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Talvez você nunca tenha usado React ou Tailwind, mas se você tem a base de lógica da programação, não seria nenhum pouco complexo entender o que essa porção de código está fazendo.&lt;/p&gt;

&lt;p&gt;Agora imagine se estivéssemos utilizando uma abordagem de SoC, a formação desse mesmo bloco seria separada entre os seguintes arquivos:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;user.html&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Hello, &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;user.css&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;padding-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;padding-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;user.js&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;formatName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josué&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Teodoro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;formatName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Qual devo usar?
&lt;/h2&gt;

&lt;p&gt;Existem alguns pontos que você pode tomar em conta na hora de decidir qual princípio tomar a frente no desenvolvimento da aplicação. Vale lembrar que estes não são os únicos, e que é necessário que você dê uma pesquisada antes de colocar a mão na massa.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ferramentas
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Se seu cliente te pediu uma casa de madeira, pra que comprar cimento?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Muitas das ferramentas disponíveis para nós desenvolvedores foram criadas com um ideal em mente. Java por exemplo, é uma linguagem de programação Orientada a Objeto. Não faria sentido programar Orientado a Procedures na mesma língua.&lt;/p&gt;

&lt;p&gt;Da mesma maneira, se o seu time está acostumado com um conjunto de ferramentas orientados a SoC (como por exemplo uma Framework MVC), continue do jeito que está, a não ser que seja necessário mudanças.&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexidade desnecessária
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Por quê usar 8 tábuas pequenas para fazer uma porta, se você pode usar 1 tábua grande?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Outro princípio importantíssimo na EdS é o &lt;a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself#:~:text=%22Don't%20repeat%20yourself%22,redundancy%20in%20the%20first%20place."&gt;DRY&lt;/a&gt; (Don't Repeat Yourself), onde a repetição de informação deve ser reduzida e reposta por abstrações, removendo redundâncias. Um dos embargos do DRY, entretanto, é a &lt;strong&gt;Over Abstraction&lt;/strong&gt;: existe um medo da repetição; dezenas de interfaces, Singletons, Abstract Factories, etc. se espalham pela codebase, criando complexidade que dificultam mais do que ajudam.&lt;/p&gt;

&lt;p&gt;Uma das minhas talks preferidas é a &lt;a href="https://www.youtube.com/watch?v=SxdOUGdseq4"&gt;"Simple Made Easy - Rich Hickey (2011)"&lt;/a&gt;, do criador do Clojure. Nessa talk Hickey explica a necessidade da simplicidade (não facilidade) nas ferramentas e softwares atuais. Recomendo muito que assista, mas em suma:&lt;/p&gt;

&lt;p&gt;A cada linha de código, arquivo, etc. que é criado, a complexidade da codebase aumenta. Nós, humanos, não somos máquinas capazes de armazenar milhares de informações ao mesmo tempo; no máximo 3 coisas e olha lá. Sendo o ato de programar entender sequencialmente os passos de uma aplicação, as abstrações são uma informação a mais a levar em consideração.&lt;/p&gt;

&lt;p&gt;Um código simples é aquele que tanto um ser humano quanto a máquina conseguem entender. Ter que fazer malabarismo mental toda vez que tiver que ler uma base de código é custoso não somente pro time, mas para a própria empresa.&lt;/p&gt;

&lt;p&gt;Tendo isto em mente, e o seu produto final, responda a si mesmo: Eu e meu time, como seres humanos, temos capacidade para manter esses diversos conceitos dispersos em um bloco de código na mente?&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusão
&lt;/h2&gt;

&lt;p&gt;Como disse anteriormente, não existe uma bala de prata na EdS. É seu trabalho, como Engenheiro e/ou Desenvolvedor, estabelecer o caminho a ser tomado para chegar no produto final. Os princípios apresentados aqui são uma base que podem criar uma fundação; nem toda casa é de cimento, e nem toda é de madeira.&lt;/p&gt;

&lt;p&gt;Obrigado!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://j0suetm.com"&gt;Josué Teodoro Moreira&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>braziliandevs</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
