docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
---
|
||||
id: wiki-2026-0508-cognitive-load
|
||||
title: Cognitive Load
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Mental Load, Working Memory Pressure, Code Complexity Tax]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [engineering, design, code-quality, devex]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: any
|
||||
framework: software-engineering
|
||||
---
|
||||
|
||||
# Cognitive Load
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 working memory 에 동시에 매 잡고 있어야 하는 정보의 양"**. Sweller 의 cognitive load theory (1988) 에 기반 — intrinsic, extraneous, germane 의 3-tier. 매 modern software design 의 first-principle metric — 작은 cognitive load 가 매 maintainable code 를 결정.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 3 종류
|
||||
- **Intrinsic**: 문제 자체의 본질적 복잡도 (e.g., distributed consensus).
|
||||
- **Extraneous**: 표현/도구 가 만드는 인위적 복잡도 (bad naming, deep nesting).
|
||||
- **Germane**: schema 형성 과정 (learning) — useful load.
|
||||
|
||||
### 매 7±2 rule
|
||||
- Working memory 는 약 4-7 chunk 만 동시 처리 (Miller 1956, refined Cowan 2001).
|
||||
- Code 가 이 한계 넘으면 → bug, slow review, onboarding 지연.
|
||||
|
||||
### 매 응용
|
||||
1. Function 의 line / parameter 제한 (small functions).
|
||||
2. Module boundary 설계 — high cohesion, low coupling.
|
||||
3. PR size 제한 (200-400 line max).
|
||||
4. Naming convention — domain language 사용.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Guard clause 로 nesting 줄임
|
||||
```python
|
||||
# BAD: deep nesting (high extraneous load)
|
||||
def process(user):
|
||||
if user is not None:
|
||||
if user.is_active:
|
||||
if user.has_permission('write'):
|
||||
return do_work(user)
|
||||
return None
|
||||
|
||||
# GOOD: early return
|
||||
def process(user):
|
||||
if user is None: return None
|
||||
if not user.is_active: return None
|
||||
if not user.has_permission('write'): return None
|
||||
return do_work(user)
|
||||
```
|
||||
|
||||
### Extract domain primitive
|
||||
```typescript
|
||||
// BAD: primitive obsession — caller must remember semantics
|
||||
function transfer(from: string, to: string, amount: number, currency: string) {}
|
||||
|
||||
// GOOD: types carry semantics
|
||||
type AccountId = string & { __brand: 'AccountId' };
|
||||
type Money = { amount: bigint; currency: Currency };
|
||||
function transfer(from: AccountId, to: AccountId, money: Money) {}
|
||||
```
|
||||
|
||||
### 매 colocation
|
||||
```tsx
|
||||
// BAD: scattered — must context-switch
|
||||
// styles.css, validation.ts, component.tsx, types.ts
|
||||
|
||||
// GOOD: single-file feature unit (Astro/Svelte/RSC era)
|
||||
export function Form() {
|
||||
const validate = (v: string) => v.length > 0;
|
||||
return <input onBlur={e => validate(e.target.value)} />;
|
||||
}
|
||||
```
|
||||
|
||||
### Boundary objects
|
||||
```python
|
||||
# Each layer translates — caller doesn't need to know inner schema
|
||||
class UserDTO: # external API shape
|
||||
...
|
||||
class User: # domain entity
|
||||
...
|
||||
class UserRow: # DB schema
|
||||
...
|
||||
def to_domain(dto: UserDTO) -> User: ...
|
||||
def to_row(user: User) -> UserRow: ...
|
||||
```
|
||||
|
||||
### Team Topologies pattern
|
||||
```yaml
|
||||
# Stream-aligned team owns a single bounded context
|
||||
# Platform team provides self-service infra
|
||||
# Goal: each team's cognitive load fits one team's working memory
|
||||
team: payments
|
||||
owns: [PaymentService, RefundService, payment-db]
|
||||
depends_on:
|
||||
platform: [k8s-cluster, observability]
|
||||
enabling: []
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Function > 50 lines | Extract sub-functions or strategy |
|
||||
| Class > 7 public methods | Split by responsibility |
|
||||
| Team owns > 1 product area | Reorg per Team Topologies |
|
||||
| Domain logic mixed w/ infra | Hexagonal / Clean Architecture |
|
||||
| Onboarding > 2 weeks | Reduce coupling, write decision records |
|
||||
|
||||
**기본값**: Optimize for reader, not writer — 매 reduce extraneous, accept intrinsic.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Cognitive Psychology]]
|
||||
- 응용: [[Team Topologies]] · [[Hexagonal Architecture]] · [[Clean Code]]
|
||||
- Adjacent: [[Working Memory]] · [[Code Smell]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: Code review, refactoring decision, team structure 설계, PR size 판단.
|
||||
**언제 X**: Pure performance optimization (different metric).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Cleverness 자랑**: dense one-liner, clever bitwise — high extraneous.
|
||||
- **God object**: 30+ method class — exceeds chunking capacity.
|
||||
- **Magic constants**: `if x > 86400` 대신 `SECONDS_PER_DAY`.
|
||||
- **Implicit context**: global mutable state — reader 가 매 trace 해야 함.
|
||||
- **Premature abstraction**: framework-itis — abstraction 이 intrinsic 아닌데 추가됨.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Sweller 1988, Skelton & Pais 2019 Team Topologies).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — cognitive load theory + practical refactoring patterns |
|
||||
Reference in New Issue
Block a user