Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

CodePronunciationMeaningWhat it does
함수ham-sufunction (math term)defines a function
만약man-yakif/supposestarts a conditional
이면i-myeonthen/if-thenmarks the Korean-default conditional ending
반환ban-hwanreturn/give backreturns a value
변수byeon-suvariable (math term)declares a mutable variable
상수sang-suconstantdeclares an immutable constant
반복ban-bokrepetitionfor loop
동안dong-anduring/whilewhile loop
출력chul-ryeokoutputprints to console
입력ip-ryeokinputreads from console
chamtrue/truthboolean true
거짓geo-jitfalse/lieboolean false
없음eop-seumnothing/nonenull value
구조gu-jostructuredefines a struct
열거yeol-geoenumerationdefines an enum
아니면a-ni-myeonotherwiseelse branch
멈춰meom-chwostopbreak
계속gye-sokcontinuecontinue
시도si-doattempttry block
처리cheo-rihandling/processcatch block
맞춤mat-chwomatch/fitpattern matching
포함po-haminclude/containimport module
그리고geu-ri-goand (conjunction)logical AND
또는tto-neunor (alternative)logical OR
안에서an-e-seoinside/withinfor-in iteration

Method Names

Array and string methods are also real Korean verbs:

MethodPronunciationMeaning
추가chu-gaadd/append
삭제sak-jedelete/remove
포함po-hamcontain/include
정렬jeong-ryeolsort/arrange
역순yeok-sunreverse order
분리bun-riseparate/split
바꾸기ba-kku-gichange/replace
합치기hap-chi-gicombine/join
길이gi-rilength

Type Names

TypePronunciationMeaning
정수jeong-suinteger (whole number)
실수sil-sureal number (float)
문자열mun-ja-yeolcharacter string
bulboolean (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.