Multiple Languages in One File
Múltiples Lenguajes en un Archivo
Build systems should compile and run with a single command. When a single source file mixes HTML, CSS, JavaScript, and SQL it signals a design failure — each language belongs in its own module. G1: Follow the Principle of Least Surprise — if a function is named getTodaysDate(), it must return today's date, nothing else.
Los sistemas de build deben compilar y ejecutar con un solo comando. Cuando un archivo mezcla HTML, CSS, JavaScript y SQL, es una señal de falla de diseño — cada lenguaje pertenece en su propio módulo. G1: Sigue el Principio de Mínima Sorpresa — si una función se llama getTodaysDate(), debe retornar la fecha de hoy, nada más.
Boundary Conditions & Suppressed Warnings
Condiciones Límite y Advertencias Suprimidas
G3: Boundary conditions are where most bugs live. Don't trust your intuition — write down every edge case and test it explicitly. The off-by-one error, the empty collection, start equals end — these are the corners that bite. G8: Suppressing a compiler or linter warning is the same as lying. Fix the root cause instead.
G3: Las condiciones límite son donde viven la mayoría de los bugs. No confíes en la intuición — escribe cada caso límite y pruébalo explícitamente. El error de uno en uno, la colección vacía, inicio igual a fin — estas son las esquinas que muerden. G8: Suprimir una advertencia del compilador es equivalente a mentir. Corrige la causa raíz.
✏️
Code Challenge
Desafío de Código
Fix the range-check function to handle all boundary conditions.
Corrige la función de verificación de rango para manejar todas las condiciones límite.
💡 Key takeaway
A system that compiles cleanly, tests completely, and never suppresses warnings is a system you can trust.
Un sistema que compila limpiamente, prueba completamente y nunca suprime advertencias es un sistema en el que puedes confiar.