Pet project: chessboard UI – Day 2

Today was a rather short session. I started by adding a <Game /> component that will be responsible for handling the data of the whole game (mainly the data from the FEN notation). That way we can keep track of the whole game situation, and the <Board /> only has to care about the position.

Then I played a little bit with the chess.js library. I went for a basic test implementation (there are cleaner ways to integrate third party libraries in React components).  Still, this demonstrated the possibilities offered by this library:

Screen Shot 2018-08-24 at 08.47.55
Initiating an instance of Chess in the componentDidMount() method of the <Game /> component.

With this code the board now displays the game, here after the first move ‘e4’:

Screen Shot 2018-08-24 at 08.51.52
One move in!

Now here are a few things I realised and will have in mind for the coming days:

  • Using chess.js sort sof defeat the purpose of this pet project. I’ll learn more by developing the chess logic myself, gradually adding more rules.
  • React DnD (Drag & Drop) looks like a promising option for allowing the user to move pieces. And the official tutorial even showcase this very chess example.
  • I need to start separating the react components between components (responsible for rendering UI elements) and containers (responsible for handling the data and passing it as props to the components). This distinction is sometimes called dumb vs. smart or presentational vs. container components. Here is an explanation from Dan Abramov.
  • I will soon need redux to have the whole state of the app in one place and handle user actions in a more manageable way. This article explains how to add redux.
  • Redux will also allow me to follow a TDD approach when developing the chess logic. For example, I can write a test to see if the game data is updated (using selectors) when a user move a piece (a redux action). This article looks like a good reference.

Book review – Sapiens

Sapiens: A Brief History of Humankind

By Yuval Noah Harari


I chose to read this book after reading ‘The Power of Myths‘ (1988) from Joseph Campbell. I was interested in getting an overview of the history of humankind to see if Campbell’s definition of myths as ‘clues to the spiritual potentialities of the human life’ or ‘the society’s dream’ could be a guiding framework when analysing history.

“You’ve got the same body, with the same organs and energies, that Cro-Magnon man had thirty thousand years ago. Living a human life in New York City or living a human life in the caves, you go through the same stages of childhood, coming to sexual maturity, transformation of the dependency of childhood into the responsibility of manhood or womanhood, marriage, then failure of the body, gradual loss of its power, and death.” – Joseph Campbell (The Power of Myth)

I didn’t need to look too far to find parallels between Campbell and Harari’s views. According to Harari, the biggest consequence of the Cognitive Revolution (-70.000) is the new possibility for us Homo Sapiens to create fiction (myths, legends…). Harari says that ‘the real difference between us and chimpanzees is the mythical glue that binds together large number of individuals, families and groups’.

Both Harari and Campbell also point out the incredible pace at which our modern world and societies are changing. According to Harari, we as a species are becoming more and more united in a ‘global Empire’. And human evolution is confronted to questions such as animal suffering or overall well-being of nature. As an historian, Harari doesn’t truly choose a position in this book, but the way he exposes the modern history supports Campbell’s idea that our modern, global society requires the emergence of new myths that would allow our species to live in harmony with nature.

This book delivered on all the expectations I had and even more. The most important takeaway for me is that it helped me appreciate the value of studying history. I used to look at history as a rather ‘boring’ subject to study because all the events happening are contingent and I couldn’t find a way to learn anything meaningful about the way we think. The main thing I got from this book are a set of concepts and a general framework to consider and understand all historical events in the general context of human history. With this point of view and those concepts in mind, historical events are no longer mere random accidents. They are manifestations of long-lasting trends which origins are closely related to the way our very own minds work, as individuals and members of a species.

Reading notes available here.

About this blog

Although I write this blog primarily for me, it is also for my family and my friends who want to know what I’m up to, as well as any random Internet user who think they could find something useful here. If somehow you find something that resonates inside you, makes you smile or helps you in any way, I would be very happy for you!

During June 2018 I slowly realised something: I had been depressed for a few months without being aware of it (probably like in all depressions).

For the first time in my life I talked about my issues to other people and started a serious introspection work. The discovery I made was a revelation: I had spent the last few years of my life focusing almost exclusively on personal success, money and reputation. And this behaviour wasn’t me. So I wasn’t myself anymore. This obsession was clearly unhealthy for me and I had gradually be disconnected and closed to the world.

This realisation was the first step to a new quest: being myself again. Day after day, I started changing small things in my life to find my balance again. I started to understand what was important for me and what values I care about. I designed personal rules that help me keeping my balance. As I’m writing those lines, this quest is still ongoing. In fact I believe it is the quest of a lifetime, for the ideal balance is never really reached. And new situations in life require constant attention and readjustments.

Writing this blog helps me understand who I really am and who I want to be. I gather my thoughts and share achievements about my hobbies. This helps me to stay motivated and become a better version of myself.

All those things make me feel happier and more alive. And the best part is that by focusing on being myself, I’m also helping others at the same time. Why? Because as life comes from life, happiness is contagious.

Book review – A Woman Looking at Men Looking at Women

A Woman Looking at Men Looking at Women: Essays on Art, Sex, and the Mind

By Siri Hustvedt


After a few months in Sweden, I realized that the way women behave and are perceived is very different here than in countries that I know better, like France or China.

At first it was unconscious observations, but recently I started thinking more actively about questions that are studied and developed by thinkers called ‘feminists‘. I didn’t know anything about feminism. I found this book at random in a bookstore and after reading the summary I knew this was the book I had to read right now to nurture my rising interest in the topic. Ten days later I finished this rather intense reading which gave me insights far beyond my expectations.

This was my first book from Siri Husdvedt. In my opinion, the great thing about this book is that it’s not directly about feminism. It is first and foremost an encounter with a brilliant mind that take you on a journey to her own personal story as well as her quest to constantly question and improve our understanding of crucial questions like “who are we?” or “what is thinking?”, “what is the mind?”. And during the process, you get the best demonstration about why feminism matters.

The themes discussed by Husdvedt are powerful, and reading through her analyses, I learnt both about the themes and about “how to think about such questions”. I can already see that my way of thinking has been changed forever. I want to continue learning about as many and diverse disciplines as possible. I want to read fiction. I want to write. I want to go back to my previous reading notes and gather everything together to continue thinking about all those questions. I want to experience through my body new emotions and feelings, play with my imagination and creativity and become a more complete human being.

The only thing I didn’t really like about this book is that some themes are repeated among several essays and my analytical mind might have preferred a topic-based approach. I also found some essays harder to penetrate for me as a non-initiate, although the author did mention in the preface that some articles were mostly designed for a specific, qualified audience. But this book is such a gift that I can only blame myself for not being up to the task of truly understanding all its subtleties.

Reading notes available here.