Programming Practice (CS109)

This webpage is designed not only for the CS109 course that I teach but also to allow you to study programming on your own. See the self-study section below.

Programming Practice (CS109)

Spring Semester 2017

Students must bring their own laptop computer to this course. Students cannot enroll in this course if they do not have a computer that they can bring to the classroom.

This course introduces basic concepts of programming and computer science, such as dynamic and static typing, dynamic memory allocation, objects and methods, binary representation of numbers, using an editor and compiler from the command line, running programs with arguments from the commmand line, using libraries, and the use of basic data structures such as arrays, lists, sets, and maps.

This course is particularly meant for students who did not learn programming in high school, but who enjoyed programming in CS101 and who want to develop their programming skills.

Every week there will be one hour of lecture with some quizzes, followed by a three-hour lab. I will provide materials (lecture notes and on-line tutorials) that students sometimes need to study before coming to the class. You will spend all three hours on a fun programming project. The difficulty of the projects will slowly increase over the semester. There will be no separate homeworks or projects, however, you will be asked to finish projects at home if you could not complete it during the lab.

CS109A, CS109B, and CS109C: The only difference between these two sections is that the TAs in CS109B and CS109C will only speak Korean. In CS109A, you can ask the TAs questions in English or Korean.

Note that all sections start together, and all explanations by the instructor will be in English in all sections.


I'm trying to make this webpage and the materials suitable for self-study, for students who cannot take CS109 or who quickly want to improve their programming skills (for instance during the semester break).

I have made a complete written tutorial that walks you through all the material in the course. Read the tutorials on The command line, Introduction to Kotlin, and Incremental testing, then start working on the programming projects. The difficulty of the projects increases slowly during the course. You'll need to read more of the tutorials as you progress through the projects.

Programming language

In this course we will use the Kotlin programming language.

In my experience, students develop a style of programming in their first programming language. They find it difficult to learn a different style later, even if they switch to a different language. This means that students should start early to use a modern language that encourages writing clean and elegant code, and supports a good object-oriented and functional style.

We will therefore use Kotlin in this course. Kotlin is fully compatible with Java, so you can use it for anything that can be done in Java, but it is a much more modern, much more readable, and much more sensible language. We will also experiment with compiling Kotlin source to Javascript, so you can run your programs inside a web browser, and will even write small apps that can run on Android phones.

Most students will still have to learn C++ and/or Java later during their studies—but I believe that after getting programming practice in Kotlin, they will be able to write better code in those languages as well.

Course information

Otfried Cheong Office: E3-1 3434, Phone: 3542.
Teaching assistants

강다현, 김재윤, 박지희, 안가빈, 임주원, 정재원, 하대근.

Office hour

Daegeun offers an office hour every Tuesday from 18:30 to 20:00 in room 403 of building N1. Here you can ask questions about the self-study material or the projects (or anything else related to the course). You can also come with your computer and program during the office hour, using it in the same way as the lab.


The entire class (all three sections) meets Friday from 13:00 to 14:00 in classroom 201 in building N1 for our question/quiz/lecture time.

Afterwards, the sections of the course are distributed on different classrooms to work on their projects:

  • CS109A remains in room 201;
  • CS109B moves to room 317;
  • CS109C moves to room 114.

In CS109B and CS109C, TAs will only speak Korean. If you do not speak Korean, you must register for CS109A!

Grading policy

Programs will not be graded, because programming is part of the learning experience (it is not an exam).

However, students must submit all programming projects they have done. Grades will be deducted for missing labs without excuse, or for not submitting lab projects.

The final grade will be composed as follows (small changes reserved):

  • Project (20%), Exam (40%), Quizzes and participation (40%).
Again: Students must upload their lab projects to the course submission server. The programs will not be graded, but uploads will count for lab participation, and I can see if students are making progress.

There will one exam, on June 16, from 13:00 to 15:00, in room 1501 (the joint lecture hall) in building E3-1 (not our usual building!).


Here is a rough list of what we will cover in each week of the semester.

Week 1 Introduction, command line tools
Week 2 Basic scala, command line arguments
Week 3 Types of objects, dynamic and static typing
Week 3 Number types
Week 4 Dynamically allocated objects, stack frames, garbage collection
Week 5 Arrays and lists
Week 6 Sets and maps
Week 7 Strings and text processing
Week 8 Midterm exam
Week 9 Function objects
Week 10 Higher-order functions
Week 11 Compiled programs
Week 12 Objects
Week 13 Object-oriented programming I
Week 14 Object-oriented programming II
Week 15 Project presentations
Week 16 Reserve

Lecture slides

03-03 Introduction to Kotlin intro slides, basic kotlin slides
03-10 Long lab
03-17 Incremental testing, number representation slides
03-24 Data classes, objects, references, and the heap slides, quiz 1
03-31 Arrays, two-dimensional arrays, sets, compiling programs array slides, compilation slides, quiz 5
04-07 Long lab
04-14 Maps, nullable variables slides, quiz 9
04-21 Midterm week (no lecture, no lab)
04-28 Long lab
05-05 Children's day
05-12 Higher-order functions slides, quiz 14
05-19 Classes with methods slides 1, slides 2, quiz 19
05-26 Android mini-apps slides, quiz 26
06-02 Long lab
06-09 Exceptions, review slides, quiz 30
06-16 Final exam: June 16, 13:00–15:00, room 1501 in E3-1


This term we will be using Piazza for class announcements, discussion, and asking questions.

Here is our Piazza class page.

You are responsible for checking the announcements on our Piazza class page regularly (if you make a Piazza account and enroll for the course, announcements will be mailed to you automatically.)

If you do not understand something, it is important that you ask questions. Piazza allows you to ask questions and get answers from the instructor, the teaching assistants, and your classmates. You can ask questions anonymously, so don't be shy and ask!

Both Korean and English are acceptable on Piazza :-). You make it easier for me if you write in English, but if the TAs can answer your question, then Korean is just fine.

To ask questions, you need to register on Piazza and enroll as a student for CS109. To do so, go to the CS109 enrollment page. Select "Join as student". You will then need to use your KAIST email address (ending with @kaist.ac.kr) to create an account.


Every week you will be assigned to read about certain topics in the course tutorials. You will find each week's assignment posted on Piazza.

It is important that you do not just read through the tutorials briefly. Turn on your computer, and follow the steps of the tutorial on your own computer. That way the material will become active knowledge that you can apply yourself when you program.

Programming projects

You will find the project for each week posted on Piazza. The full list of projects for self-study can be found here.