프로그래밍
KISS
은율실험실
2024. 4. 10. 00:00
반응형
KISS 은(는) Keep It Short and Simple 의 축약어로,
불필요한 복잡성을 추가하지 않을 것을 권장하는 개발의 기본 원칙이에요.
Bad
final class Program
{
public static void main(String[] args)
{
var A = true;
var B = false;
if (!!A)
{
System.out.println("A is true");
}
if ((!A && B)) // De Morgan's laws
{
System.out.println("either A or B is true");
}
}
}
Good
final class Program
{
public static void main(String[] args)
{
var A = true;
var B = false;
if (A)
{
System.out.println("A is true");
}
if (A || B)
{
System.out.println("either A or B is true");
}
}
}
반응형