Learn Korean Through Coding
Every keyword in Han is a real Korean word. If you're learning Korean, writing Han code is a way to practice reading Hangul in context.
Keyword Pronunciation Guide
| Code | Pronunciation | Meaning | What it does |
|---|---|---|---|
함수 | ham-su | function (math term) | defines a function |
만약 | man-yak | if/suppose | starts a conditional |
이면 | i-myeon | then/if-then | marks the Korean-default conditional ending |
반환 | ban-hwan | return/give back | returns a value |
변수 | byeon-su | variable (math term) | declares a mutable variable |
상수 | sang-su | constant | declares an immutable constant |
반복 | ban-bok | repetition | for loop |
동안 | dong-an | during/while | while loop |
출력 | chul-ryeok | output | prints to console |
입력 | ip-ryeok | input | reads from console |
참 | cham | true/truth | boolean true |
거짓 | geo-jit | false/lie | boolean false |
없음 | eop-seum | nothing/none | null value |
구조 | gu-jo | structure | defines a struct |
열거 | yeol-geo | enumeration | defines an enum |
아니면 | a-ni-myeon | otherwise | else branch |
멈춰 | meom-chwo | stop | break |
계속 | gye-sok | continue | continue |
시도 | si-do | attempt | try block |
처리 | cheo-ri | handling/process | catch block |
맞춤 | mat-chwo | match/fit | pattern matching |
포함 | po-ham | include/contain | import module |
그리고 | geu-ri-go | and (conjunction) | logical AND |
또는 | tto-neun | or (alternative) | logical OR |
안에서 | an-e-seo | inside/within | for-in iteration |
Method Names
Array and string methods are also real Korean verbs:
| Method | Pronunciation | Meaning |
|---|---|---|
추가 | chu-ga | add/append |
삭제 | sak-je | delete/remove |
포함 | po-ham | contain/include |
정렬 | jeong-ryeol | sort/arrange |
역순 | yeok-sun | reverse order |
분리 | bun-ri | separate/split |
바꾸기 | ba-kku-gi | change/replace |
합치기 | hap-chi-gi | combine/join |
길이 | gi-ri | length |
Type Names
| Type | Pronunciation | Meaning |
|---|---|---|
정수 | jeong-su | integer (whole number) |
실수 | sil-su | real number (float) |
문자열 | mun-ja-yeol | character string |
불 | bul | boolean (fire/light) |
Example: Reading Han Code as Korean
함수 인사(이름: 문자열) {
출력("${이름}님 안녕하세요")
}
Reading this as Korean:
함수(function)인사(greeting) — "define a greeting function"이름(name):문자열(string) — "parameter: name of type string"출력(output) — "print"${이름}— insert the이름variable into the string안녕하세요(annyeonghaseyo) — "hello" (formal)
Every line is readable Korean.