Lección 2

Side-by-Side and Unified Diff en español

Guía en español para text diff side by side and unified diff: Choose the right view when reviewing changes: aligned columns vs patch-style output.

Este contenido todavía no está disponible en español. Se muestra la versión en English mientras completamos la localización.

Most diff tools offer two presentation styles.

Side-by-side view

Original text appears on the left. Modified text appears on the right. Matching lines stay aligned, while added, removed, or changed lines are highlighted in their column.

Use side-by-side when:

  • You want to read both versions at the same time
  • You are comparing configs or env files line by line
  • You need to confirm whether a line moved, changed, or was replaced

Unified diff view

Unified diff shows one stream of output with prefixes:

--- original
+++ modified
 DEBUG=false
-DEBUG=false
+DEBUG=true
 DB_HOST=db.internal
-DB_HOST=db.internal
+DB_HOST=db.prod.internal
+CACHE_TTL=3600

Lines starting with - were removed. Lines starting with + were added. Context lines have no prefix.

Use unified diff when:

  • You want patch-style output for notes or tickets
  • You need a compact summary to paste into chat or email
  • You are used to Git or code review diff format

Which view should you pick?

ScenarioBetter view
Reviewing env/config filesSide-by-side
Explaining a change to a teammateUnified
Checking a few edited valuesSide-by-side
Pasting diff into an issue commentUnified

Key takeaway

Side-by-side is for reading. Unified is for sharing. Both describe the same changes; they just optimize for different review tasks.

Switch views in the Text Diff Checker while comparing the same sample to see which one fits your workflow.

Volver al resumen del curso