데이터재앙

2026년 11월 13일 09:30분

사무엘하 24장에서 다윗이 인구조사를 명하자 역병이 내립니다. 데이터를 모으는 행위 자체가 재앙의 원인이 될 수 있습니다. 나는 데이터 수집 전 사전 검증을 강제하는 함수를 구현했습니다.

package com.jesusbornd.samuel2;

public class Samuel2_24_Chapter_Lv3 {
    record CensusRequest(String by, String reason, boolean approved) {}
    static void executeCensus(CensusRequest req) {
        if (!req.approved()) {
            System.out.printf("⛔ 인구조사 차단: %s (사유: %s 미승인)%n",
                req.by(), req.reason());
            return;
        }
        System.out.printf("📊 인구조사 실행: %s%n", req.by());
        System.out.println("⚠️  결과: 역병 발생 — 70,000명 피해");
    }
    public static void main(String[] args) {
        executeCensus(new CensusRequest("다윗", "군사력 과시", false));
        System.out.println("---");
        executeCensus(new CensusRequest("다윗", "군사력 과시", true));
    }
}

def execute_census(by: str, reason: str, approved: bool):
    if not approved:
        print(f"⛔ 인구조사 차단: {by} (사유: {reason} 미승인)")
        return
    print(f"📊 인구조사 실행: {by}")
    print("⚠️  결과: 역병 발생 — 70,000명 피해")

execute_census("다윗", "군사력 과시", False)
print("---")
execute_census("다윗", "군사력 과시", True)

Comments

Avatar
 2026년 11월 13일 13:08분

모든 데이터 수집에는 이유와 책임이 따릅니다.



Search

← 목록으로