Files
2nd/10_Wiki/Topic_Programming/Topic_CSharp/CSharp_Booleans.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +09:00

4.4 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
csharp-booleans C# Booleans Programming_Language draft conceptual
bool data type C#
boolean expressions C#
C# 불리언
B 0.83 2026-07-04 2026-07-04
csharp
programming-language
w3schools
booleans
https://www.w3schools.com/cs/cs_booleans.php

CSharp Booleans

🎯 한 줄 통찰 (One-line insight)

This chapter previews the if...else statement (voting-age example) BEFORE the Conditions section formally covers it, which is a deliberate pedagogical sequencing choice — showing WHY boolean expressions matter (they're the direct input to if) before teaching the if syntax itself — and the example itself reuses Console.WriteLine(myAge >= votingAge); printing a raw True/False before wrapping the identical comparison inside an if {} else {} block, making the connection between "a boolean expression" and "a branching decision" explicit and concrete rather than assumed. [S1]

🧠 핵심 개념 (Core concepts)

  • bool — a type that can only hold true or false, used for binary-state situations (yes/no, on/off). [S1]
  • Boolean expression — an expression (typically built with comparison operators) that itself evaluates to True/False, e.g. x > y, x == 10. [S1]
  • Direct literal comparison — comparisons work on literals too, not just variables: Console.WriteLine(10 > 9); is valid on its own. [S1]
  • Boolean expressions are the foundation of if/else — the tutorial explicitly states "the boolean value of an expression is the basis for all C# comparisons and conditions." [S1]

📖 세부 내용 (Details)

  • Direct declaration: bool isCSharpFun = true; bool isFishTasty = false; — printed as True/False. [S1]
  • Comparison-derived booleans: int x = 10; int y = 9; Console.WriteLine(x > y); // True; Console.WriteLine(x == 10); // True; Console.WriteLine(10 == 15); // False. [S1]
  • Real-life voting-age example, first as a bare boolean print: int myAge = 25; int votingAge = 18; Console.WriteLine(myAge >= votingAge);True. [S1]
  • The SAME comparison then wrapped in a full if/else:
    if (myAge >= votingAge) { Console.WriteLine("Old enough to vote!"); }
    else { Console.WriteLine("Not old enough to vote."); }
    
    [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • if/else 문법이 정식 챕터 전에 미리 사용됨: Conditions 섹션에서 if...else를 formal하게 다루기 전에, 이 챕터가 투표 연령 예제를 통해 if/else 구문을 먼저 보여준다는 점이 확인됨 — "왜 boolean 표현식이 중요한가(if의 입력이기 때문)"를 문법을 가르치기 전에 개념적으로 먼저 연결하려는 의도적 구성. [S1]

🛠️ 적용 사례 (Applied in summary)

투표 가능 연령(18세)과 실제 나이(25세)를 비교해 먼저 bool 값을 출력하고, 그다음 동일 비교를 if...else로 감싸 "Old enough to vote!" 또는 "Not old enough to vote."를 출력하는 예제가 원문에서 직접 실전 활용 사례로 제시됨. [S1]

💻 코드 패턴 (Code patterns)

Boolean expression as a bare print, then wrapped in if/else (C#):

int myAge = 25;
int votingAge = 18;

Console.WriteLine(myAge >= votingAge);  // bare boolean -> True

if (myAge >= votingAge) {
    Console.WriteLine("Old enough to vote!");
} else {
    Console.WriteLine("Not old enough to vote.");
}

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.83
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "C# Booleans" page (Astra wiki-curation, P-Reinforce v3.1 format).