# até o Uncle Bob virou Vibe Coder

https://www.youtube.com/watch?v=MvFO-W9zZRk
Translation: en

[00:00] Tu revisa código escrito por agente.
  You review code written by an agent.

[00:03] Que absurdo.
  How absurd.

[00:06] Olha só que o Anco Bob nos falou no Twitter essa semana.
  Look what Anco Bob told us on Twitter this week.

[00:08] Eu não reviso o código escrito por agentes.
  I do not review code written by agents.

[00:11] Euuro as coisas como cobertura de teste, dependência, dependency structure, análise complexa de ciclomática, tamanho de módulos, mutation tests e por aí vai.
  I look at things like test coverage, dependency, dependency structure, complex cyclomatic analysis, module size, mutation tests, and so on.

[00:25] A gente pode, no caso, aqui inferir muita coisa sobre a qualidade de um código através dessas métricas.
  We can, in this case, infer a lot about the quality of a code through these metrics.

[00:31] Eu já trabalhei num num time onde era tipo assim, era sonar cube antes de mergear por request, tá ligado?
  I've worked on a team where it was like, it was SonarQube before merging a pull request, you know?

[00:37] Então eu entendo do que ele tá falando e ele diz o seguinte: "Cara, o código eu deixo para Iá".
  So I understand what he's talking about and he says the following: 'Man, I leave the code for later.'

[00:41] Humanos são lentos no código.
  Humans are slow with code.

[00:45] Para ganhar produtividade, nós humanos devemos nos desengajar do código, né?
  To gain productivity, we humans should disengage from the code, right?

[00:52] Do nos não ficar atrelado a ele, mas sim gerenciar algo a mais alto nível.
  Not be tied to it, but rather manage something at a higher level.

[00:59] O que que tu acha dessa afirmação dele?
  What do you think of his statement?

[00:59] O que
  What

[01:03] o cara que ensinou basicamente duas gerações de engenheiros como fazer code review e ele acabou de dizer que o code review de IA é trabalho desperdiçado.
  The guy who basically taught two generations of engineers how to do code review and he just said that AI code review is wasted work.

[01:13] Eu tenho visto e tendo a concordar com Ancon Bob aqui e não tem nada demais, tá?
  I have seen and tend to agree with Ancon Bob here and there's nothing wrong with it, okay?

[01:19] Isso aqui não é o apocalipse, galera, não é, tá?
  This is not the apocalypse, guys, it's not, okay?

[01:21] Eu eu quero sair desse vídeo aqui te mostrando coisas que eu que eu tô usando para me deixar mais produtivo e como que eu ando revisando o código da IA.
  I want to leave this video showing you things that I am using to make myself more productive and how I've been reviewing AI code.

[01:29] Então eu quero passar para vocês quatro aqui comandos no mínimo que transformaram a essa essa essa lista aí no num gate real de C, tá?
  So I want to pass on to you at least four commands here that transformed this this this list into a real gate of C, okay?

[01:37] Rodando até hoje à noite aí no meu projeto.
  Running even tonight on my project.

[01:39] Então tem um outro detalhe que é é importante a gente dizer.
  So there's another detail that is important for us to mention.

[01:44] Se tu, assim como o An Bob, tá elevando o teu nível para um auditor de código de IA, tu tá em posição também para vender essas horas tuas de trabalho pra gringa.
  If you, just like An Bob, are raising your level to an AI code auditor, you are also in a position to sell those hours of your work to foreigners.

[01:54] E para receber tudo isso em dólar, tu precisa conhecer a High Globe.
  And to receive all of this in dollars, you need to know High Globe.

[01:57] Cara, é o
  Man, it's the

[02:02] menor custo garantia do mercado, tá?
  lowest cost guarantee on the market, okay?

[02:04] A gente tá falando aqui de apenas 0,3% de spread.
  We are talking here about only 0.3% spread.

[02:08] Tem saques via Pixor mínimo a qualquer hora.
  There are withdrawals via Pix or minimum at any time.

[02:12] Clica no link, tá aqui na descrição, abre a tua conta e usa o meu cupom montando 20 para garantir ainda 20% de desconto nos primeiros três meses fazendo transferências pela High Globe.
  Click on the link, it's here in the description, open your account and use my coupon 'montando20' to guarantee another 20% discount in the first three months by making transfers through High Globe.

[02:24] Então o tweet do Anco Bob e não caiu do céu, tá?
  So Anco Bob's tweet didn't fall out of the sky, okay?

[02:27] Ele ele caiu em cima de uma reportagem que saiu alguns dias antes.
  It fell on top of a report that came out a few days earlier.

[02:29] É basicamente essa aqui, tech experts shift from coding to auditing AI generated software.
  It's basically this one, tech experts shift from coding to auditing AI generated software.

[02:37] Então a gente tá basicamente virando auditores de código.
  So we are basically becoming code auditors.

[02:41] Tem esse outro aqui do Stanford.
  There's this other one from Stanford.

[02:44] Eu nunca fechei tanto popup na minha vida, mas esse aqui do na verdade onde eles falam aqui sobre os modelos, né, que foram de 4,4% no SU BCH em 2023 para mais de 70% em 2026.
  I've never closed so many pop-ups in my life, but this one here where they actually talk about the models, right, which went from 4.4% in SU BCH in 2023 to over 70% in 2026.

[02:55] Então o survei até mesmo do
  So the survey even of

[03:02] Pragmatic Engineer que ele tinha lançado, ele mostrou ali uma taxa de aceitação de código gerado no início do ano, não sei se vocês se lembram, de 30 a 55%, tá?
  Pragmatic Engineer that he had launched, he showed there a code acceptance rate generated at the beginning of the year, I don't know if you remember, of 30 to 55%, okay?

[03:11] E esse número tá crescendo cada vez mais a taxa de aceitação tua e e metade do do DIF não é mais a tua linha de código digitada.
  And this number is growing more and more the acceptance rate of yours and half of the DIF is no longer your typed line of code.

[03:21] O ponto do Anob aqui e ele é basicamente o seguinte: se metade do código é da máquina, a pergunta parou de ser se esse for loop tá bonito ou não.
  The point of Anob here and it is basically the following: if half of the code is from the machine, the question stopped being whether this for loop is beautiful or not.

[03:31] Eh, virou basicamente se esse código passa em cinco provas objetivas e essas provas não exigem que tu leia nada, elas rodam no teu CI em 30 segundos.
  Uh, it basically became whether this code passes five objective tests and these tests do not require you to read anything, they run on your CI in 30 seconds.

[03:41] Então, sim, eu continuo revisando o código, mas uma das coisas que eu quero adicionar no meu pipeline de deploy, cara, ou melhor, antes de fazer o deploy, é uma análise do código estático.
  So, yes, I continue reviewing the code, but one of the things I want to add to my deploy pipeline, man, or rather, before deploying, is a static code analysis.

[03:53] Então, por exemplo, tem algumas técnicas, deixa eu falar, uma delas seria a complexidade ciclomática.
  So, for example, there are some techniques, let me talk, one of them would be cyclomatic complexity.

[04:00] E para quem já estudou até lit code, vocês sabem o quanto uma
  And for those who have already studied up to lit code, you know how much a

[04:04] complexidade ciclomática é importante versus um big old notation, né?
  Cyclomatic complexity is important versus big O notation, right?

[04:09] Então, muitas vezes tu pode ter um algoritmo lá que ele é mega eficiente, mas a complexidade ciclomática dele vai ser horrível.
  So, many times you can have an algorithm there that is mega efficient, but its cyclomatic complexity will be horrible.

[04:15] Então, deixa eu te dar um exemplo de complexidade ciclomática aqui, de como que essa análise funciona, tá?
  So, let me give you an example of cyclomatic complexity here, of how this analysis works, okay?

[04:19] Ela basicamente vai contar quantos caminhos tem dentro de uma função.
  It basically counts how many paths there are inside a function.

[04:25] Então, digamos, tem uma função teste lá dentro, tem um if, esse aqui seria o caminho um, pode ter um else, que esse aqui vai ser o caminho dois.
  So, let's say there's a test function inside, there's an if, this here would be path one, there can be an else, which here will be path two.

[04:33] E aqui dentro tu pode estar chamando uma uma outra função.
  And inside here you might be calling another function.

[04:36] Então esse caminho pode abrir outros caminhos.
  So this path can open other paths.

[04:38] Cada caminho que tu vai abrindo vai somando nessa complexidade ciclomática.
  Each path you open adds to this cyclomatic complexity.

[04:43] E por que que isso aqui importa?
  And why does this matter?

[04:46] Porque LLM, cara, ela adora escrever função lá de 120 linhas com 15 iffs aninhados porque, sei lá, resolve todos os casos.
  Because LLMs, man, they love to write functions of 120 lines with 15 nested ifs because, I don't know, it solves all cases.

[04:57] Então, lá no teu CD, tu consegue colocar alguns limites e esses limites vão basicamente, por exemplo, bloquear um PR de ser mergeado.
  So, in your CI, you can set some limits and these limits will basically, for example, block a PR from being merged.

[05:06] Se tu usa alguma ferramenta já para isso, comenta aqui embaixo.
  If you use any tool for this, comment below.

[05:08] Eu adoraria saber mais.
  I would love to know more.

[05:10] Uma, uma que eu já utilizei foi a Sonar Cube.
  One, one that I have already used was Sonar Cube.

[05:12] Ela é famosa aí pelos pelos times de quality assurance, mas com certeza deve ter surgido várias outras aí nesses últimos anos.
  It is famous for quality assurance teams, but surely several others must have emerged in recent years.

[05:17] Eu adoraria saber o que que a galera tá usando integrado aí com a IA.
  I would love to know what people are using integrated with AI.

[05:20] Então, digamos, tu pode definir lá que o teu CCN que vai, sei lá, de 1 a 20 e acima de 20, tu pode considerar isso aqui como sendo algo que vai reprovar o teu o teu request.
  So, let's say, you can define there that your CCN will be, I don't know, from 1 to 20 and above 20, you can consider this as something that will reject your request.

[05:35] E CCN é basicamente complexidade ciclomática number.
  And CCN is basically cyclomatic complexity number.

[05:38] É o número da tua complexidade ciclomática.
  It is the number of your cyclomatic complexity.

[05:41] Então, aplica isso hoje, coloca esse comando aí no teu pipeline e vê o que que o que que dá.
  So, apply this today, put this command in your pipeline and see what happens.

[05:46] Técnica número dois, tá?
  Technique number two, okay?

[05:49] Cobertura que até o Ancle Bob comentou ali, cobertura de testes mais mutation testing, que é basicamente o par que prova que o teste é real.
  Coverage that Uncle Bob even commented on, test coverage plus mutation testing, which is basically the pair that proves the test is real.

[05:56] O Anco Bob, ele citou essas duas métricas meio que juntas ali de propósito, né?
  Uncle Bob cited these two metrics somewhat together on purpose, right?

[06:01] Porque tu tem o testage que cobre, que
  Because you have the testage that covers, which

[06:06] basicamente vai te dizer quanto do teu código tá coberto por teste.
  Basically, it will tell you how much of your code is covered by tests.

[06:11] E tu tem um mutation test, que é basicamente saber o que aconteceria se tu mutar o teu código, né?
  And you have a mutation test, which is basically knowing what would happen if you mutate your code, right?

[06:17] trocar, por exemplo, maior por menor, trocar mais por menos, true por false e por aí vai.
  For example, changing greater than to less than, changing plus to minus, true to false, and so on.

[06:23] Então, essas mutações, o mutation que vem de mutação, faz o teu teste ser mais completo, tá?
  So, these mutations, the 'mutation' that comes from mutation, makes your test more complete, okay?

[06:29] Então, uma ferramenta que a galera usa para isso é o mut.
  So, a tool that people use for this is mut.

[06:33] Tu pode dar um pip install aí se tu usa Python e basicamente ele vai dizer: "Olha, eu fiz aqui 400 mutações e 50 sobreviver sobreviveram".
  You can do a pip install if you use Python, and basically, it will say: 'Look, I made 400 mutations here, and 50 survived survived'.

[06:41] Então, basicamente, 50.
  So, basically, 50.

[06:43] Essas 50 aqui que sobreviveram são os bugs que nenhum teste teu tá detectando.
  These 50 that survived are the bugs that none of your tests are detecting.

[06:49] Então, esse aqui é o teu próximo sprint de teste que tu tem que fazer.
  So, this is your next testing sprint that you have to do.

[06:53] Aí tu pode pensar em alguma, alguns números, sei lá, cara, eu quero ter 85% ã de cobertura e mutation pode ser, sei lá, 60%, então tu tem lá 60% de Q rate.
  Then you can think about some numbers, I don't know, man, I want to have 85% coverage and mutation can be, I don't know, 60%, so you have 60% Q rate there.

[07:07] Uma outra técnica ali que o Anob citou é tamanho de módulos.
  Another technique that Anob mentioned is module size.

[07:13] Isso aqui serve para te quebrar aqueles god files.
  This here serves to break those god files.

[07:16] Tem uns arquivos deus lá que com 3 4 5.000 linhas de código.
  There are some god files there with 3, 4, 5,000 lines of code.

[07:21] Então esse teu tamanho de módulo também pode ser definido, sei lá, por 300 linhas por arquivo.
  So this module size of yours can also be defined, I don't know, by 300 lines per file.

[07:26] E se for maior que isso também o teu CI barraria.
  And if it's bigger than that, your CI would also block it.

[07:29] Uma outra técnica ali que ele comentou é a estrutura de dependências, tá?
  Another technique he mentioned is dependency structure, okay?

[07:34] Detecta basicamente aqui o quanto que tu tem de acoplamento, qual que é o maior problema.
  It basically detects here how much coupling you have, what the biggest problem is.

[07:39] E aqui tá tá em linha porque a gente tem tudo a ver com módulos, tá?
  And here it's in line because we have everything to do with modules, okay?

[07:42] Porque um dos maiores problemas dessa estrutura de dependência errada que tu pode ter é uma injeção circular que a gente fala, né?
  Because one of the biggest problems with this wrong dependency structure that you can have is a circular injection that we talk about, right?

[07:47] Quando tem um importe que faz importe de um arquivo que importa o o mesmo arquivo.
  When there's an import that imports from a file that imports the same file.

[07:53] Pode também ter algumas camadas invertidas.
  You can also have some inverted layers.

[07:55] Tu pode ter controller chamando model algum serviço diretamente.
  You can have a controller calling a model or a service directly.

[08:00] Tu pode ter um módulo de implementação chamando o módulo de implementação, quando na verdade tu deveria ter um módulo de API
  You can have an implementation module calling an implementation module, when in reality you should have an API module.

[08:07] que é utilizado para um módulo de implementação.
  which is used for an implementation module.

[08:09] E esse tem o módulo de implementação, se ele quer expor alguma coisa, ele expõe através de um módulo de API para outro módulo de implementação acessar essa tua implementação do outro módulo.
  And this has the implementation module, if it wants to expose something, it exposes it through an API module for another implementation module to access this implementation of the other module.

[08:18] Então tudo isso aqui também tem que est no teu CI.
  So all of this also has to be in your CI.

[08:20] E eu acho que é isso, né?
  And I think that's it, right?

[08:22] Tem mais, cara.
  There's more, man.

[08:24] Eu acho que tem muito mais pra gente fazer.
  I think there's a lot more for us to do.

[08:25] Eu prometi falar de quatro.
  I promised to talk about four.

[08:27] Espero que tu tenha aprendido alguma coisa.
  I hope you've learned something.

[08:29] O Anco Bob aqui não te disse basicamente nada de novo.
  Anco Bob here didn't tell you basically anything new.

[08:32] São coisas que a gente já vem fazendo aí na indústria de software muito antes de IA existir, mas que a gente na grande maioria sempre achou que fosse bobagem, tá?
  These are things that we've been doing in the software industry long before AI existed, but that we, in the vast majority, always thought was nonsense, okay?

[08:41] E agora eu venho ter que concordar com Bobob.
  And now I have to agree with Bobob.

[08:44] Cara, eu não tô mais tendo tempo de revisar código.
  Man, I'm no longer having time to review code.

[08:46] Uma das minhas maiores preocupações ultimamente tem sido como eu, como que eu posso continuar gerando 10.000 linhas de código por dia, revisando essas 10.000 1000 linhas de código por dia.
  One of my biggest concerns lately has been how I, how can I continue generating 10,000 lines of code per day, reviewing these 10,000 1000 lines of code per day.

[08:58] A conclusão é que eu não consigo, não tem como.
  The conclusion is that I can't, there's no way.

[09:00] Mas isso não quer dizer que a gente não possa melhorar o nosso processo de qualidade de código, aplicando isso aqui no teu CD e
  But that doesn't mean that we can't improve our code quality process, by applying this here in your CD and

[09:08] aplicando também uma análise de vulnerabilidade nos teus pacotes.
  also applying a vulnerability analysis to your packages.

[09:11] cobertura de teste, o unitário.
  test coverage, the unit one.

[09:14] instrumentation test, pain test e por aí vai.
  instrumentation test, pain test, and so on.

[09:17] Comenta aqui embaixo o que que tu tá usando, cara.
  Comment down below what you are using, man.

[09:18] Se tu também tá passando por isso de querer fazer algumas análises táticas também antes de mergear um pro request.
  If you are also going through this of wanting to do some tactical analyses before merging a pull request.

[09:23] Ao invés de só tá revisando o código, comenta as ferramentas que tu tá utilizando.
  Instead of just reviewing the code, comment on the tools you are using.

[09:28] Eu adoraria saber.
  I would love to know.

[09:29] Se tu curtiu, deixa o like, se inscreve, me manda nos comentários aqui, então.
  If you liked it, leave a like, subscribe, send me in the comments here, then.
