Try to think aloud while you code so I can follow.
Tente pensar em voz alta enquanto você codifica para eu acompanhar.Aula
Pair programming em inglês
Nível: B1
Objetivo
Participar de sessões de pair programming em inglês pensando em voz alta, sugerindo próximos passos, pedindo o teclado, explicando o raciocínio e navegando pelo código junto, usando frases curtas e naturais que mantêm o ritmo da dupla sem interromper quem está dirigindo.
Explicação
Pair programming em inglês gira em torno de quatro micro-habilidades: pensar em voz alta (*think aloud*), sugerir próximos passos, pedir o controle e explicar o raciocínio. Em B1, espera-se que você combine todas elas em frases curtas, sem traduzir mentalmente cada palavra. O fluxo típico de uma sessão é: o *driver* escreve o código enquanto o *navigator* observa, comenta, sugere e pergunta.
Think aloud mantém a dupla sincronizada. Quem está digitando verbaliza a hipótese antes de cada mudança: *"I'm thinking the bug is in the retry block, not in the timeout."*, *"What I see here is that the function returns null when the user is missing."* O ouvinte acompanha o raciocínio em tempo real e consegue corrigir antes de a linha virar commit.
Sugerir próximos passos usa aberturas leves: *"What if we try a small refactor first?"*, *"How about we add a log before this line?"*, *"Let's step back and read the function from the top."*, *"Maybe we should write a failing test before changing the code."* Essas frases oferecem uma direção sem impor, e o *driver* decide se aceita, rejeita ou combina.
Pedir o controle troca os papéis sem atrito: *"Can I take the keyboard for a minute?"*, *"Do you want to drive, or should I?"*, *"Can I jump in here?"*, *"Let me try that part."* A troca é frequente em B1 e deve ser combinada com a micro-habilidade anterior: pedir o teclado depois de sugerir a direção.
Explicar o raciocínio sustenta a decisão e ajuda o colega a aprender: *"The reason I'm doing this is that the old version didn't handle null."*, *"I'm extracting this into a helper because the loop is doing two things."*, *"This trade-off is acceptable because the cache will rarely miss."*
Navegar pelo código junto usa referências compartilhadas: *"Look at line 42, the if block."*, *"This function here."*, *"The place where we read the file."*, *"Above the try block."*, *"Inside the loop."* Combine com marcadores de posição (*here, there, above, below, inside*) para indicar sem ambiguidade de que trecho você está falando.
Em sessões remotas com compartilhamento de tela, essas frases funcionam com pequenas variações: *"Can you see my cursor?"*, *"I'm scrolling to the test file."*, *"What you're looking at is the migration script."* Mantenha o tom direto e o ritmo constante; pausas longas quebram a sincronia da dupla.
Exemplos
| Inglês | Tradução | Observação |
|---|---|---|
| I'm thinking the bug is in the retry block, not in the timeout. | Estou achando que o bug está no bloco de retry, e não no timeout. | Think aloud: hipótese antes de mudar o código. |
| What I see here is that the function returns null when the user is missing. | O que eu vejo aqui é que a função retorna null quando o usuário está ausente. | Descreve o que aparece na tela em voz alta. |
| What if we try a small refactor first? | E se a gente tentar um refactor pequeno primeiro? | Sugestão leve: What if we... + tentativa. |
| How about we add a log right before this line? | Que tal a gente adicionar um log logo antes desta linha? | How about we... oferece uma alternativa sem impor. |
| Let's step back and read the function from the top. | Vamos voltar um passo e ler a função do começo. | Let's... + verbo no imperativo para redefinir o ritmo. |
| Can I take the keyboard for a minute? | Posso pegar o teclado por um minuto? | Pedido de controle educado; 'for a minute' suaviza a troca. |
| The reason I'm doing this is that the old version didn't handle null. | A razão de eu estar fazendo isso é que a versão antiga não tratava null. | Explica raciocínio: The reason I'm doing X is that Y. |
| I'm extracting this into a helper because the loop is doing two things. | Estou extraindo isso para um helper porque o loop está fazendo duas coisas. | because + causa simples; útil em code review e em pair. |
| Look at line 42, inside the if block. | Olha a linha 42, dentro do if. | Navegação: linha + marcador de posição (inside, above, below). |
| The place where we read the file is the one that needs the log. | O lugar onde a gente lê o arquivo é o que precisa do log. | The place where... para indicar um trecho sem número de linha. |
Erros comuns
- Ficar em silêncio enquanto o colega digita: sem think aloud, o navigator perde o contexto e a sessão vira digitação solitária em dupla.
- Sugerir com tom de ordem: *"You should rename this function."* soa impositivo; prefira *"What if we rename this function?"* ou *"How about renaming it?"*
- Pedir o teclado sem avisar: *"Give me the keyboard."* quebra o ritmo; use *"Can I take the keyboard for a minute?"* ou *"Do you want to drive, or should I?"*
- Explicar o raciocínio depois que a linha já virou commit: em pair, a justificativa vem antes ou junto da mudança, não no review.
- Misturar a navegação no código com explicações longas: mantenha as referências curtas (*line 42, inside the if, above the loop*) e abra a explicação só quando perguntarem.
- Traduzir mentalmente cada frase da dupla: frases prontas (*What if we...*, *The reason is...*) saem mais rápido do que reformular em português e traduzir palavra por palavra.
- Ignorar o navigator: pair programming é conversa contínua; se o colega está em silêncio há muito tempo, pergunte *"What do you think?"* ou *"Does that make sense?"*
Prática guiada
Reescreva cada frase para soar natural em uma sessão de pair programming:
- Comando direto: *"Give me the keyboard."*
Versão natural: *"Can I take the keyboard for a minute? I want to try the refactor."*
- Sugestão impositiva: *"You should add a log here."*
Versão natural: *"What if we add a log right here? It would help us see the value."*
- Explicação vaga: *"I'm doing this because it's better."*
Versão natural: *"The reason I'm doing this is that the old code re-reads the file on every request, which is expensive."*
- Navegação confusa: *"That thing there."*
Versão natural: *"Look at the function `load_config`, the part where we open the file."*
Observe o que mudou: a primeira versão é curta e gera atrito; a segunda descreve a intenção, suaviza a sugestão e usa marcadores de posição compartilhados (`here`, `the function load_config`, `the part where...`).
Resumo
Em pair programming, pense em voz alta (*I'm thinking...*, *What I see is...*), sugira próximos passos com aberturas leves (*What if we...*, *How about we...*, *Let's...*), peça o controle com frases educadas (*Can I take the keyboard?*, *Do you want to drive?*), explique o raciocínio com *The reason is... / because...* e navegue pelo código com marcadores de posição (*here, there, above, below, inside*). Frases curtas, diretas e em voz alta mantêm a dupla sincronizada.
Vocabulário
Palavras principais
I'm thinking the bug is in the retry block.
Estou achando que o bug está no bloco de retry.What I see here is that the function returns null.
O que eu vejo aqui é que a função retorna null.What if we try a small refactor first?
E se a gente tentar um refactor pequeno primeiro?How about we add a log right before this line?
Que tal a gente adicionar um log logo antes desta linha?Let's step back and read the function from the top.
Vamos voltar e ler a função do começo.Maybe we should write a failing test first.
Talvez a gente deva escrever um teste que falha primeiro.Can I take the keyboard for a minute?
Posso pegar o teclado por um minuto?Do you want to drive, or should I take it from here?
Você quer dirigir, ou eu pego daqui em diante?Let me try that part — I have an idea.
Deixa eu tentar essa parte — tenho uma ideia.Can I jump in here? I think I see the issue.
Posso entrar aqui? Acho que vejo o problema.The reason I'm doing this is that the old version didn't handle null.
A razão de eu estar fazendo isso é que a versão antiga não tratava null.I'm extracting this into a helper because the loop is doing two things.
Estou extraindo isso para um helper porque o loop está fazendo duas coisas.The trade-off is a small latency increase in exchange for simpler code.
O trade-off é um pequeno aumento de latência em troca de um código mais simples.Look at line 42, inside the if block.
Olha a linha 42, dentro do if.This function here is the one we need to refactor.
Esta função aqui é a que precisamos refatorar.The place where we read the file is the one that needs the log.
O lugar onde a gente lê o arquivo é o que precisa do log.The variable is declared above the loop.
A variável é declarada acima do loop.História
História: Pair programming em inglês
Nível: B1
História em inglês
Joining a pair session
On Wednesday morning, Priya joined a pair session with her teammate Lucas to debug a flaky integration test. Lucas was already sharing the screen, with the test file open on the left and the production code on the right. "Can you see my cursor?" Lucas asked. "Yes, I can. Go ahead and drive," Priya answered. Lucas said, "I'm thinking the failure is in the cache layer, not in the database." "What I see here is that the test sometimes passes and sometimes fails, with no clear pattern in the logs." Priya nodded and said, "OK, let's start by reading the test from the top. Maybe we should add a log right before the assertion."
Switching roles and finding the cause
Lucas added the log and ran the test, but it passed on the first try. "Can I take the keyboard for a minute?" Priya asked. "I want to try the refactor I had in mind." "Sure, go ahead," Lucas said, and they switched roles. Priya drove the keyboard and said, "I'm extracting this assertion into a helper because the same pattern shows up in three other tests." Lucas watched and said, "What do you think about adding a small comment above the helper, so future readers know why it exists?" "That's a good point," Priya replied. "The reason I'm extracting this is that the original assertion is doing two things: it checks the response and it also counts retries." She wrote the helper, added the comment, and the test passed five times in a row.
Wrapping up the session
After twenty minutes, the test was no longer flaky, and the two engineers felt good about the change. Lucas said, "What if we add this helper to the shared utils package? Other tests will probably need it too." "I agree, but let's check the package's import rules first. We might need to add a new entry to the index file." Priya opened the package directory and pointed at the file: "Look at this file here, the place where the other helpers are exported." Lucas nodded and said, "Yes, that's the right place. Let's add the new helper there and open a small pull request with a clear description." They wrapped up the session after forty minutes, with a stable test, a shared helper, and a clear next step for the pull request.
Tradução linha por linha
| Inglês | Tradução |
|---|---|
| On Wednesday morning, Priya joined a pair session with her teammate Lucas to debug a flaky integration test. | Na quarta-feira de manhã, Priya entrou em uma sessão de pair com o colega de time Lucas para debugar um teste de integração flaky. |
| Lucas was already sharing the screen, with the test file open on the left and the production code on the right. | Lucas já estava compartilhando a tela, com o arquivo de teste aberto à esquerda e o código de produção à direita. |
| "Can you see my cursor?" Lucas asked. | "Você consegue ver meu cursor?", perguntou Lucas. |
| "Yes, I can. Go ahead and drive," Priya answered. | "Sim, consigo. Pode dirigir", respondeu Priya. |
| Lucas said, "I'm thinking the failure is in the cache layer, not in the database." | Lucas disse: "Estou achando que a falha está na camada de cache, e não no banco." |
| "What I see here is that the test sometimes passes and sometimes fails, with no clear pattern in the logs." | "O que eu vejo aqui é que o teste às vezes passa e às vezes falha, sem um padrão claro nos logs." |
| Priya nodded and said, "OK, let's start by reading the test from the top. Maybe we should add a log right before the assertion." | Priya assentiu e disse: "OK, vamos começar lendo o teste do começo. Talvez a gente deva adicionar um log logo antes da asserção." |
| Lucas added the log and ran the test, but it passed on the first try. | Lucas adicionou o log e rodou o teste, mas passou na primeira tentativa. |
| "Can I take the keyboard for a minute?" Priya asked. "I want to try the refactor I had in mind." | "Posso pegar o teclado por um minuto?", pediu Priya. "Quero tentar o refactor que eu tinha em mente." |
| "Sure, go ahead," Lucas said, and they switched roles. | "Claro, pode ir", disse Lucas, e eles trocaram de papel. |
| Priya drove the keyboard and said, "I'm extracting this assertion into a helper because the same pattern shows up in three other tests." | Priya dirigiu o teclado e disse: "Estou extraindo essa asserção para um helper porque o mesmo padrão aparece em outros três testes." |
| Lucas watched and said, "What do you think about adding a small comment above the helper, so future readers know why it exists?" | Lucas observou e disse: "O que você acha de adicionar um comentário pequeno acima do helper, para que futuros leitores saibam por que ele existe?" |
| "That's a good point," Priya replied. "The reason I'm extracting this is that the original assertion is doing two things: it checks the response and it also counts retries." | "Boa ideia", respondeu Priya. "A razão de eu estar extraindo isso é que a asserção original está fazendo duas coisas: ela checa a resposta e também conta as retentativas." |
| She wrote the helper, added the comment, and the test passed five times in a row. | Ela escreveu o helper, adicionou o comentário, e o teste passou cinco vezes seguidas. |
| After twenty minutes, the test was no longer flaky, and the two engineers felt good about the change. | Depois de vinte minutos, o teste não era mais flaky, e os dois engenheiros se sentiram bem com a mudança. |
| Lucas said, "What if we add this helper to the shared utils package? Other tests will probably need it too." | Lucas disse: "E se a gente adicionar esse helper ao pacote de utils compartilhado? Outros testes provavelmente vão precisar também." |
| "I agree, but let's check the package's import rules first. We might need to add a new entry to the index file." | "Concordo, mas vamos checar as regras de import do pacote primeiro. Talvez a gente precise adicionar uma nova entrada no arquivo de índice." |
| Priya opened the package directory and pointed at the file: "Look at this file here, the place where the other helpers are exported." | Priya abriu o diretório do pacote e apontou para o arquivo: "Olha este arquivo aqui, o lugar onde os outros helpers são exportados." |
| Lucas nodded and said, "Yes, that's the right place. Let's add the new helper there and open a small pull request with a clear description." | Lucas assentiu e disse: "Sim, é o lugar certo. Vamos adicionar o novo helper ali e abrir um pull request pequeno com uma descrição clara." |
| They wrapped up the session after forty minutes, with a stable test, a shared helper, and a clear next step for the pull request. | Eles encerraram a sessão depois de quarenta minutos, com um teste estável, um helper compartilhado e um próximo passo claro para o pull request. |
Notas de vocabulário
- flaky = teste que às vezes passa e às vezes falha sem mudança de código
- share the screen = compartilhar a tela; em pair remoto é o equivalente do 'estar no mesmo teclado'
- Can you see my cursor? = frase típica de abertura em pair remoto para confirmar que o colega acompanha o ponteiro
- Go ahead and drive = aceita o papel de driver; 'go ahead' suaviza a autorização
- switch roles = trocar driver/navigator; pedido educado de teclado em pair
- extract ... into a helper = mover um trecho de código para uma função menor e reutilizável
- the place where ... = marcador de navegação que aponta um trecho sem usar número de linha
- package = pacote; unidade de organização de código com regras próprias de import/export
Perguntas de compreensão
- What problem did Priya and Lucas pair on?
- Why did Lucas think the failure was in the cache layer, not in the database?
- What did Priya suggest they do first?
- Why did Priya ask to take the keyboard?
- Why did Priya extract the assertion into a helper?
- What small change did Lucas suggest to make the helper easier to understand?
- Where did they decide to add the new helper?
- How long did the pair session last in total?
Prática com a história
- Reescreva como frase de pair: 'Add a log before the assertion.'
- Traduza: 'A razão de eu extrair isso é que o loop está fazendo duas coisas.'
- Complete: 'Can I ___ the keyboard for a minute?'
- Escreva uma frase de think aloud para a hipótese: o problema está no timeout, não no retry.
- Reescreva como navegação: 'Look over there in the code.'
Prática
Exercícios e teste
A próxima melhoria é transformar esses arquivos em perguntas com resposta no navegador. Por enquanto, esta página já organiza o estudo e permite seguir a aula inteira sem abrir os arquivos manualmente.