Zen Programming - Private Class


Today, I gave a Zen programming private lesson to Shinichiro Nabeyama, a 15-year-old Japanese high school student who knows a little bit of English and had some prior experience with programming.


While communicating with simple English and Japanese, we used Docker on Windows to spin up CentOS containers, upon which we used vi to write C code that we compiled and ran with gcc.


Shinichiro didn’t have much experience with C, so a lot of our time was spent on explaining the fundamentals of C, but the actual code was not so complicated and we could do some TDD.

#include "assert.h"

#include "stdio.h"

#include "string.h"

char* artist(char* song)


        if (0 == strcmp(song, "levels"))

                return "avicii";

        else if (0 == strcmp(song, "faded"))

                return "alan walker";

        else if (0 == strcmp(song,"lose"))

                return "shinzex";

        return "unknown";


int addBack_old(int x)


        if (x == 0)

                return 0;

        if (x == 1)

                return 1;

        if (x == 2)

                return 1 + 2;

        if (x == 3)

                return 1 + 2 + 3;

        if (x == 4)

                return 1 + 2 + 3 + 4;

        return -1;



int addBack(int x)


        if (x == 0)

                return 0;

        return x + addBack(x-1);


void test()


        assert(addBack(0) == 0);

        assert(addBack(1) == 1);

        assert(addBack(2) == 3);

        assert(addBack(3) == 6);

        assert(addBack(4) == 10);



int main()


        //printf(artist("levels")); printf("\n");

        //printf(artist("faded")); printf("\n");

        //printf(artist("lose")); printf("\n");


        //for (int i = 0; i <= 4; i++)


        //      printf("%d", addBack(i));

        //      printf("\n");



Recursive functionの作り方も教えました。

I also taught a bit about recursive functions.


Of course, being a Zen programming workshop, we did Zazen. Also, I showed Shinichiro some of the Yoga I had been practicing for 13 years.

Extreme Programmingというなシリコンバレースタイルのペアプログラミングもやってて、2つのモニター、2つのキーボード、2つのマウスでした。あいにく、しん君のキーボードは日本語版だったからかなり苦労しました。

Using the “Silicon Valley style” Extreme programming, we used 2 monitors, 2 keyboards, 2 mice. Unfortunately, Shinichiro’s keyboard was Japanese so we had some difficulties there!


We also had some trouble turning on the lights in the Zazen room, as well as no fan, so Shinichiro was bearing the heat!


It was a short 3 hours, but we were able to do many things, and make some mistakes to help make next time even better!

Amil日本語, EnglishComment