Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions html-generators/locales.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ zh-CN=中文 (简体)
ar=العربية
fr=Français
ja=日本語
ko=한국어
17 changes: 17 additions & 0 deletions translations/content/ko/collections/collectors-teeing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "Collectors.teeing()"
oldApproach: "두 번 순회"
modernApproach: "teeing()"
summary: "스트림을 한 번만 순회하여 두 가지 집계를 동시에 계산합니다."
explanation: "Collectors.teeing()은 각 요소를 두 개의 다운스트림 컬렉터에 전달하고 결과를 병합합니다. 데이터를 두 번 스트리밍하거나 가변 누산기를 사용하지 않아도 됩니다."
whyModernWins:
- icon: "⚡"
title: "단일 순회"
desc: "스트림을 두 번 대신 한 번만 처리합니다."
- icon: "🧩"
title: "조합 가능"
desc: "병합 함수로 임의의 두 컬렉터를 결합합니다."
- icon: "🔒"
title: "불변 결과"
desc: "레코드나 값 객체로 직접 병합합니다."
support:
description: "JDK 12 (2019년 3월) 이후 널리 사용 가능"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "컬렉션 불변 복사"
oldApproach: "수동 복사 + 래핑"
modernApproach: "List.copyOf()"
summary: "한 번의 호출로 모든 컬렉션의 불변 복사본을 만듭니다."
explanation: "List.copyOf(), Set.copyOf(), Map.copyOf()는 기존 컬렉션의 불변 스냅샷을 만듭니다. 원본이 이미 불변 컬렉션이라면 복사가 생략됩니다."
whyModernWins:
- icon: "⚡"
title: "스마트 복사"
desc: "원본이 이미 불변이면 복사를 건너뜁니다."
- icon: "📏"
title: "한 번의 호출"
desc: "ArrayList 수동 생성과 래핑이 필요 없습니다."
- icon: "🛡️"
title: "방어적 복사"
desc: "원본을 변경해도 복사본에 영향을 주지 않습니다."
support:
description: "JDK 10 (2018년 3월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/immutable-list-creation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "불변 리스트 생성"
oldApproach: "장황한 래핑"
modernApproach: "List.of()"
summary: "하나의 깔끔한 표현식으로 불변 리스트를 만듭니다."
explanation: "List.of()는 래핑이나 방어적 복사 없이 진정한 불변 리스트를 만듭니다. null에 비허용적(null 요소 거부)이며 구조적으로 불변입니다. 이전 방식은 세 개의 중첩 호출이 필요했습니다."
whyModernWins:
- icon: "📏"
title: "한 번의 호출"
desc: "세 개의 중첩 호출을 단일 팩토리 메서드로 대체합니다."
- icon: "🔒"
title: "진정한 불변"
desc: "단순 래퍼가 아니라 리스트 자체가 불변입니다."
- icon: "🛡️"
title: "null 안전"
desc: "생성 시점에 null 요소를 거부하여 빠른 실패를 보장합니다."
support:
description: "JDK 9 (2017년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/immutable-map-creation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "불변 맵 생성"
oldApproach: "맵 빌더 패턴"
modernApproach: "Map.of()"
summary: "빌더 없이 인라인으로 불변 맵을 만듭니다."
explanation: "Map.of()는 키-값 쌍을 인라인으로 받아 불변 맵을 반환합니다. 10개 초과 항목의 경우 Map.ofEntries()와 Map.entry() 쌍을 사용하세요."
whyModernWins:
- icon: "📏"
title: "인라인 생성"
desc: "임시 가변 맵이 필요 없습니다."
- icon: "🔒"
title: "불변 결과"
desc: "생성 후 맵을 수정할 수 없습니다."
- icon: "🚫"
title: "null 키/값 불허"
desc: "null 항목은 즉시 거부됩니다."
support:
description: "JDK 9 (2017년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/immutable-set-creation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "불변 셋 생성"
oldApproach: "장황한 래핑"
modernApproach: "Set.of()"
summary: "단일 팩토리 호출로 불변 셋을 만듭니다."
explanation: "Set.of()는 null과 중복 요소를 생성 시점에 거부하는 진정한 불변 셋을 만듭니다. 더 이상 가변 셋을 래핑할 필요가 없습니다."
whyModernWins:
- icon: "📏"
title: "간결함"
desc: "세 개의 중첩 호출 대신 한 줄로 작성합니다."
- icon: "🚫"
title: "중복 감지"
desc: "중복 요소를 실수로 전달하면 예외를 던집니다."
- icon: "🔒"
title: "불변"
desc: "생성 후 추가/제거가 불가능합니다."
support:
description: "JDK 9 (2017년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/map-entry-factory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "Map.entry() 팩토리"
oldApproach: "SimpleEntry"
modernApproach: "Map.entry()"
summary: "깔끔한 팩토리 메서드로 맵 항목을 만듭니다."
explanation: "Map.entry()는 장황한 AbstractMap.SimpleEntry 생성자를 대체합니다. 불변 항목을 반환하므로 Map.ofEntries()와 스트림 연산에 이상적입니다."
whyModernWins:
- icon: "📏"
title: "간결함"
desc: "세 줄 대신 더 명확한 의도로 한 줄에 작성합니다."
- icon: "🔒"
title: "불변"
desc: "반환된 항목을 수정할 수 없습니다."
- icon: "🧩"
title: "조합 가능"
desc: "대형 맵에서 Map.ofEntries()와 완벽하게 작동합니다."
support:
description: "JDK 9 (2017년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/reverse-list-iteration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "리스트 역순 반복"
oldApproach: "수동 ListIterator"
modernApproach: "reversed()"
summary: "깔끔한 향상된 for 루프로 리스트를 역순으로 반복합니다."
explanation: "SequencedCollection의 reversed() 메서드는 리스트의 역순 뷰를 반환합니다. 이 뷰는 원본 리스트와 연결되어 있어 복사가 발생하지 않습니다. 향상된 for 루프 구문으로 역순 반복이 순방향만큼 읽기 쉬워집니다."
whyModernWins:
- icon: "📖"
title: "자연스러운 문법"
desc: "장황한 ListIterator 대신 향상된 for 루프를 사용합니다."
- icon: "⚡"
title: "복사 없음"
desc: "reversed()는 뷰를 반환합니다 — 성능 오버헤드가 없습니다."
- icon: "🧩"
title: "일관된 API"
desc: "List, Deque, SortedSet에서 동일하게 작동합니다."
support:
description: "JDK 21 LTS (2023년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/sequenced-collections.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "시퀀스 컬렉션"
oldApproach: "인덱스 산술"
modernApproach: "getFirst/getLast"
summary: "깔끔한 API 메서드로 첫/마지막 요소와 역순 뷰에 접근합니다."
explanation: "SequencedCollection은 List, Deque, SortedSet, LinkedHashSet에 getFirst(), getLast(), reversed(), addFirst(), addLast()를 추가합니다. 더 이상 size-1 산술이나 수동 역순 반복이 필요 없습니다."
whyModernWins:
- icon: "📖"
title: "자기 문서화"
desc: "getLast()는 get(size()-1)보다 훨씬 명확합니다."
- icon: "🔄"
title: "역순 뷰"
desc: "reversed()는 뷰를 제공합니다 — 복사가 필요 없습니다."
- icon: "🧩"
title: "통일된 API"
desc: "List, Deque, SortedSet에서 동일하게 작동합니다."
support:
description: "JDK 21 LTS (2023년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/stream-toarray-typed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "타입이 지정된 스트림 toArray"
oldApproach: "수동 배열 복사"
modernApproach: "toArray(생성자)"
summary: "메서드 참조로 스트림을 타입이 지정된 배열로 변환합니다."
explanation: "toArray(IntFunction) 메서드는 스트림에서 올바르게 타입이 지정된 배열을 만듭니다. 생성자(String[]::new)는 스트림에 생성할 배열 타입을 알려줍니다."
whyModernWins:
- icon: "🎯"
title: "타입 안전"
desc: "Object[] 캐스트 없이 정확한 배열 타입을 얻습니다."
- icon: "🔗"
title: "체이닝 가능"
desc: "스트림 파이프라인의 끝에서 작동합니다."
- icon: "📏"
title: "간결함"
desc: "수동 루프를 하나의 표현식으로 대체합니다."
support:
description: "JDK 8 (2014년 3월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/collections/unmodifiable-collectors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "수정 불가능한 컬렉터"
oldApproach: "collectingAndThen"
modernApproach: "stream.toList()"
summary: "stream.toList()로 수정 불가능한 리스트에 직접 수집합니다."
explanation: "Java 10에서 toUnmodifiableList(), toUnmodifiableSet(), toUnmodifiableMap()이 추가되어 장황한 collectingAndThen 래퍼를 대체했습니다. 리스트의 경우 Java 16의 stream.toList()가 더 간단한 대안을 제공합니다 — collect() 호출 자체가 필요 없습니다. 다른 컬렉션 타입에는 toUnmodifiableSet()과 toUnmodifiableMap()을 사용하세요."
whyModernWins:
- icon: "📏"
title: "가장 짧은 형태"
desc: "stream.toList()는 collect()나 Collectors 임포트가 전혀 필요 없습니다."
- icon: "🔒"
title: "불변"
desc: "결과를 수정할 수 없어 우발적인 변경을 방지합니다."
- icon: "📖"
title: "가독성"
desc: "스트림 파이프라인의 터미널 단계로 자연스럽게 읽힙니다."
support:
description: "JDK 16 (2021년 3월) 이후 널리 사용 가능"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "CompletableFuture 체이닝"
oldApproach: "블로킹 Future.get()"
modernApproach: "CompletableFuture"
summary: "CompletableFuture를 사용하여 블로킹 없이 비동기 작업을 체이닝합니다."
explanation: "CompletableFuture는 논블로킹 비동기 파이프라인을 가능하게 합니다. thenApply, thenCompose, thenAccept로 작업을 체이닝하고, exceptionally()로 오류를 처리합니다. 여러 Future를 allOf/anyOf로 조합할 수 있습니다."
whyModernWins:
- icon: "🔗"
title: "체이닝 가능"
desc: "비동기 단계를 읽기 쉬운 파이프라인으로 구성합니다."
- icon: "🚫"
title: "논블로킹"
desc: "어떤 스레드도 결과를 기다리며 유휴 상태로 있지 않습니다."
- icon: "🛡️"
title: "오류 처리"
desc: "exceptionally()와 handle()로 깔끔한 오류 복구를 수행합니다."
support:
description: "JDK 8 (2014년 3월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/concurrent-http-virtual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "가상 스레드를 이용한 동시 HTTP 요청"
oldApproach: "스레드 풀 + URLConnection"
modernApproach: "가상 스레드 + HttpClient"
summary: "가상 스레드와 HttpClient로 여러 URL을 동시에 가져옵니다."
explanation: "가상 스레드를 통해 HTTP 요청당 스레드를 하나씩 만드는 것이 현실적으로 가능해졌습니다. HttpClient와 결합하면 확장 가능한 간단한 블로킹 코드로 복잡한 비동기 콜백 패턴을 대체할 수 있습니다."
whyModernWins:
- icon: "♾️"
title: "요청당 스레드"
desc: "풀 크기 조정 없이 URL당 가상 스레드 하나를 사용합니다."
- icon: "📖"
title: "단순한 코드"
desc: "직관적인 블로킹 코드를 작성합니다."
- icon: "⚡"
title: "높은 처리량"
desc: "최소한의 리소스로 수천 개의 동시 요청을 처리합니다."
support:
description: "JDK 21 LTS (2023년 9월) 이후 널리 사용 가능"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "ExecutorService 자동 닫기"
oldApproach: "수동 종료"
modernApproach: "try-with-resources"
summary: "try-with-resources로 실행기를 자동으로 종료합니다."
explanation: "Java 19부터 ExecutorService가 AutoCloseable을 구현합니다. close() 메서드가 shutdown()을 호출하고 작업 완료를 기다립니다. 더 이상 수동 try/finally 종료 패턴이 필요 없습니다."
whyModernWins:
- icon: "🧹"
title: "자동 정리"
desc: "블록이 종료될 때 자동으로 종료됩니다."
- icon: "🛡️"
title: "누수 없음"
desc: "예외가 발생해도 실행기가 항상 종료됩니다."
- icon: "📖"
title: "익숙한 패턴"
desc: "파일, 연결 등에 사용하는 동일한 try-with-resources 패턴입니다."
support:
description: "JDK 19 (2022년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/lock-free-lazy-init.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "락 없는 지연 초기화"
oldApproach: "synchronized + volatile"
modernApproach: "StableValue"
summary: "지연 초기화 싱글톤을 위해 이중 검사 잠금을 StableValue로 대체합니다."
explanation: "StableValue는 올바른 스레드 안전성으로 지연 초기화 패턴을 캡슐화합니다. JVM은 초기화 후 읽기 경로를 최적화하여 volatile 읽기보다 빠르게 만들 수 있습니다."
whyModernWins:
- icon: "🧹"
title: "보일러플레이트 없음"
desc: "volatile, synchronized, 이중 null 확인이 필요 없습니다."
- icon: "⚡"
title: "더 빠른 읽기"
desc: "JVM이 초기화 후 상수로 최적화할 수 있습니다."
- icon: "✅"
title: "증명 가능한 정확성"
desc: "미묘한 순서 버그 없음 — JVM이 처리합니다."
support:
description: "JDK 25에서 프리뷰 (JEP 502, StableValue). --enable-preview가 필요합니다."
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/process-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "모던 프로세스 API"
oldApproach: "Runtime.exec()"
modernApproach: "ProcessHandle"
summary: "ProcessHandle로 OS 프로세스를 검사하고 관리합니다."
explanation: "ProcessHandle은 PID, 프로세스 정보(명령어, 인수, 시작 시간, CPU 사용률), 부모/자식 관계, 프로세스 종료 기능을 제공합니다. 더 이상 문서화되지 않은 Process 내부를 사용할 필요가 없습니다."
whyModernWins:
- icon: "🔍"
title: "전체 정보"
desc: "PID, 명령어, 인수, 시작 시간, CPU 사용률에 접근합니다."
- icon: "🌳"
title: "프로세스 트리"
desc: "부모, 자식, 후손 프로세스를 탐색합니다."
- icon: "📊"
title: "모니터링"
desc: "onExit()가 비동기 모니터링을 위한 CompletableFuture를 반환합니다."
support:
description: "JDK 9 (2017년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/scoped-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "스코프 값"
oldApproach: "ThreadLocal"
modernApproach: "ScopedValue"
summary: "ThreadLocal의 함정 없이 호출 스택 전반에 걸쳐 데이터를 안전하게 공유합니다."
explanation: "ScopedValue는 불변이고 상속 가능하며 스코프가 제한된 컨텍스트를 제공합니다. ThreadLocal과 달리 스코프 값은 자동으로 정리되고, 가상 스레드와 함께 작동하며, 호출자가 변경할 수 없습니다."
whyModernWins:
- icon: "🔒"
title: "불변"
desc: "호출자는 읽을 수 있지만 스코프 값을 수정할 수 없습니다."
- icon: "🧹"
title: "자동 정리"
desc: "수동 remove() 불필요 — 값은 블록 범위로 제한됩니다."
- icon: "⚡"
title: "가상 스레드 안전"
desc: "수백만 개의 가상 스레드에서 효율적으로 작동합니다."
support:
description: "JDK 25 LTS에서 확정 (JEP 506, 2025년 9월)."
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/stable-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "안정적인 값"
oldApproach: "이중 검사 잠금"
modernApproach: "StableValue"
summary: "volatile 또는 synchronized 없는 스레드 안전한 지연 초기화."
explanation: "StableValue는 내장 스레드 안전성을 갖춘 지연 초기화된 불변 값을 제공합니다. 이중 검사 잠금, volatile 필드, synchronized 블록이 필요 없습니다. JVM은 초기화 후 읽기 경로를 최적화할 수도 있습니다."
whyModernWins:
- icon: "🧹"
title: "보일러플레이트 제로"
desc: "volatile, synchronized, null 확인이 없습니다."
- icon: "⚡"
title: "JVM 최적화"
desc: "JVM이 초기화 후 값을 최적화할 수 있습니다."
- icon: "🛡️"
title: "단 한 번 보장"
desc: "공급자는 경합 상태에서도 정확히 한 번만 실행됩니다."
support:
description: "JDK 25에서 프리뷰 (JEP 502). --enable-preview가 필요합니다."
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/structured-concurrency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "구조적 동시성"
oldApproach: "수동 스레드 생명주기"
modernApproach: "StructuredTaskScope"
summary: "동시 작업의 생명주기를 하나의 작업 단위로 관리합니다."
explanation: "구조적 동시성은 동시 작업 그룹을 하나의 작업으로 처리합니다. 하위 작업이 실패하면 나머지가 취소됩니다. 스코프는 스레드 누수가 없고 명확한 부모-자식 관계를 제공합니다."
whyModernWins:
- icon: "🛡️"
title: "스레드 누수 없음"
desc: "포크된 모든 작업이 스코프가 닫히기 전에 완료됩니다."
- icon: "⚡"
title: "빠른 실패"
desc: "ShutdownOnFailure는 하나가 실패하면 형제 작업을 취소합니다."
- icon: "📐"
title: "명확한 구조"
desc: "작업 생명주기가 코드의 어휘적 스코프와 일치합니다."
support:
description: "JDK 25에서 프리뷰 (다섯 번째 프리뷰, JEP 505). --enable-preview가 필요합니다."
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/thread-sleep-duration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "Duration을 사용한 Thread.sleep"
oldApproach: "밀리초"
modernApproach: "Duration"
summary: "자기 문서화 시간 값을 위해 Duration을 사용합니다."
explanation: "Thread.sleep(Duration)은 시간 단위를 명시적으로 만듭니다. 5000이 밀리초인지 마이크로초인지 더 이상 추측할 필요가 없습니다. Duration.ofSeconds, ofMillis, ofMinutes 등과 함께 작동합니다."
whyModernWins:
- icon: "📖"
title: "자기 문서화"
desc: "Duration.ofSeconds(5)는 명확합니다."
- icon: "🛡️"
title: "단위 안전"
desc: "마이크로초를 밀리초로 실수로 전달하는 일이 없습니다."
- icon: "🧩"
title: "조합 가능"
desc: "Duration 연산: plus(), multipliedBy() 등."
support:
description: "JDK 19 (2022년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/concurrency/virtual-threads.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "가상 스레드"
oldApproach: "플랫폼 스레드"
modernApproach: "가상 스레드"
summary: "무거운 OS 스레드 대신 수백만 개의 경량 가상 스레드를 생성합니다."
explanation: "가상 스레드는 OS가 아닌 JVM이 관리하는 경량 스레드입니다. 스레드 풀을 조정하지 않고 수백만 개를 만들 수 있습니다. HTTP 호출, 데이터베이스 쿼리 같은 I/O 바운드 작업에 이상적입니다."
whyModernWins:
- icon: "⚡"
title: "경량"
desc: "가상 스레드는 KB의 메모리를 사용하고, 플랫폼 스레드는 MB를 사용합니다."
- icon: "♾️"
title: "확장 가능"
desc: "수백만 개의 스레드를 생성할 수 있습니다 — 풀 크기 조정 불필요."
- icon: "🧹"
title: "단순한 모델"
desc: "비동기 코드처럼 확장되는 블로킹 코드를 작성합니다."
support:
description: "JDK 21 LTS (2023년 9월) 이후 널리 사용 가능"
17 changes: 17 additions & 0 deletions translations/content/ko/datetime/date-formatting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: "날짜 형식 지정"
oldApproach: "SimpleDateFormat"
modernApproach: "DateTimeFormatter"
summary: "스레드 안전하고 불변인 DateTimeFormatter로 날짜를 형식화합니다."
explanation: "DateTimeFormatter는 SimpleDateFormat과 달리 불변이고 스레드 안전합니다. 상수로 저장하고 공유할 수 있습니다. 일반적인 형식을 위한 ISO_LOCAL_DATE 같은 미리 정의된 포맷터도 사용할 수 있습니다."
whyModernWins:
- icon: "🛡️"
title: "스레드 안전"
desc: "동기화 없이 스레드 간에 포맷터를 공유합니다."
- icon: "📋"
title: "내장 형식"
desc: "표준 형식을 위한 ISO_LOCAL_DATE, ISO_INSTANT 등."
- icon: "🔒"
title: "불변"
desc: "정적 final 상수로 안전하게 저장합니다."
support:
description: "JDK 8 (2014년 3월) 이후 널리 사용 가능"
Loading