Los condicionales son el «si... entonces...» del inglés: reglas, consecuencias de una configuración, y qué haría uno en una situación hipotética. Son fundamentales para leer documentación técnica («if the request fails, the server returns an error») y para hablar de decisiones. Este módulo cubre el condicional cero, el primero y el segundo. Sigue al módulo 11.
12.1 La estructura general
Un condicional tiene dos partes: la cláusula con if (la condición) y la cláusula principal (el resultado). Pueden ir en cualquier orden; si if va primero, se separa con coma:
- If the server is down, users can't log in.
- Users can't log in if the server is down. (mismo significado, sin coma)
12.2 Condicional cero: hechos y reglas generales
if + presente simple, + presente simple. Describe algo que siempre es verdad, como una ley física o una regla fija:
- If you heat water to 100°C, it boils.
- If the disk is full, the backup fails.
- If a packet is lost, TCP retransmits it.
Aquí if se puede reemplazar por when sin cambiar el significado: When the disk is full, the backup fails.
Objetivos de aprendizaje Al completar este módulo serás capaz de:
- Distinguir el condicional cero, primero y segundo por su estructura y su uso
- Construir oraciones condicionales para describir reglas de red, políticas y comportamientos de sistemas
- Interpretar condicionales en documentación técnica y preguntas de examen de certificación
- Utilizar el segundo condicional para expresar situaciones hipotéticas en reuniones y discusiones técnicas
12.3 Condicional uno: situaciones futuras reales o probables
if + presente simple, + will + verbo base. Habla de algo que puede pasar en el futuro, con una consecuencia esperable:
- If the server crashes, I'll restart it.
- If you don't update the software, it'll be vulnerable.
- If I finish early, I'll send you the report.
Error clave: nunca se usa will después de if. If it will rain es incorrecto; es If it rains.
En vez de will, también se puede usar un modal o un imperativo en el resultado: If you see this error, check the logs. · If it fails again, call support.
12.4 Condicional dos: hipotético, poco probable o irreal
if + pasado simple, + would + verbo base. Habla de algo que no es real ahora o es poco probable: un escenario imaginado.
- If I had more time, I would learn Python. (no tengo tiempo ahora)
- If the company had a bigger budget, they would buy new servers.
- What would you do if the system failed?
Con el verbo to be, lo normal en este condicional es usar were para todas las personas, incluso con I: If I were you, I would back up everything first. Esta frase, If I were you (si yo fuera tú), es una de las más usadas para dar un consejo fuerte.
would se contrae a I'd, you'd, it'd.
12.5 Comparando los tres
| Estructura | Significa | |
|---|---|---|
| Cero | if + presente, + presente | Siempre verdadero |
| Uno | if + presente, + will | Futuro posible |
| Dos | if + pasado, + would | Hipotético, poco probable o imposible ahora |
- If you restart it, it works. (cero: siempre funciona así)
- If you restart it, it'll work. (uno: predicción para esta vez)
- If you restarted it, it would work. (dos: pero no lo vas a reiniciar, o es poco probable)
12.6 Unless: a menos que
unless = if... not, y es muy común en instrucciones y advertencias:
- Unless you save the file, you'll lose your changes. = If you don't save the file, you'll lose your changes.
- The warranty is void unless you register the product.
12.7 In case: por si acaso
in case avisa de una precaución para un evento posible, no una condición directa:
- Take a backup in case something goes wrong.
- I'll bring my laptop in case I need to work.
12.8 Condicionales en la documentación técnica
El condicional cero y uno son constantes en manuales y mensajes de error:
- If the connection times out, the function returns null.
- If authentication fails, the server responds with a 401 error.
- If you don't have permission, contact your administrator.
- If this happens again, please open a ticket.
12.9 Errores típicos
| Incorrecto | Correcto |
|---|---|
| If it rains, I'll stay. | |
| If I had time... | |
| If I were you... | |
| Unless you save it... | |
| If the server is down, users can't log in. |
12.10 Resumen del módulo
- Cero: if + presente + presente = regla siempre verdadera: If you heat water to 100°C, it boils.
- Uno: if + presente + will = futuro probable: If the server crashes, I'll restart it. Nunca will después de if.
- Dos: if + pasado + would = hipotético o irreal ahora: If I had more time, I would learn Python.
- If I were you para dar consejo fuerte.
- unless = if... not; in case = por si acaso.
- La documentación técnica usa el condicional cero y uno constantemente: If authentication fails, the server responds with a 401 error.