List of all blog posts

Hors sujet : impératif catégorique de Kant et masculinité toxique

Je regarde de temps en temps des vidéos essais sur youtube mais rarement celle-ci provoque en moi l’effet que ces deux vidéos que je vous présente. La première m’a fait réaliser que l’impératif catégorique de Kant n’est pas l’idiotie que l’on m’a toujours été expliqué. La seconde est une chaîne dédiée aux représentations de la masculinité toxique dans la culture populaire.

De l’impératif catégorique

Agis seulement d’après la maxime grâce à laquelle tu peux vouloir en même temps qu’elle devienne une loi universelle

Cette phrase, ainsi que d’autres, sont les termes utilisés pour décrire formellement l’impératif catégorique. Pour vulgariser ce concept, on préfère les exemples simplistes du style :

Moving the blog to Purerl, the journey into type safety land

I started implementing my own blog more than a year and a half ago. Since I was working with Ruby on Rails at the time, I wanted to experiment Phoenix. It was an introduction to functional programming and I really enjoyed it. I wrote a small guide for beginners and later learned Purescript. I consider myself as an intermediate haskeller (my understanding goes as far as ReaderT). I used to enjoy dynamically typed languages, but my experience with sum types really changed my perspective. I cheer on the static side now!

I implemented my blog with a full event driven approach. It allowed me to fix issues more safely than ever. At least that was what I thought. A year after the first lines, it had become very difficult to fix bugs. The problem is really about refactoring the code. Not declaring types had become a pain. In the following code, focus on the publication.publication_date variable:

def execute({state, new_events}, %PublishDraft{} = publication) do
  cond do
    state == nil -> {state, {:error, "Does not exist yet"}}
    draft_should_not_be_published?(state) -> {state, {:error, "Draft non conform to publication"}}
    true ->
      {state, new_events}
      |> apply_event(%PostPublished{
        aggregate_id: publication.aggregate_id,
        publication_date: publication.publication_date,
        slug: slugify(state.title)

What is its type? Is it type that my database driver expects, NaiveDateTime? Or is it a string that I need to format? What does the apply_event function expect as an argument, a string or a NaiveDateTime? If I want to answer those questions, I need to dig in two directions in my code and I might not even find a satisfying answer, since some library might hide the details of implementation. I really enjoy Elixir as a language, but refactoring can be really problematic, especially when you don’t actively maintain the code base.

Unexpected values in Java

You read the documentation of Java and you find the method you were looking for. What are the possible scenarios when running this method?

public static LocalDate parse(CharSequence text);

Documented execution results

The documentation gives 2 explicit answers and an implicit one :

Revue de presse : spécial parcoursup

Les motivations pour changer de système de sélection sont diverse. L’ancien système APB, pour admission post bac, n’était pas sans reproche mais avait derrière lui la solidité reconnue de l’algorithme qu’il utilisait : le fameux Gale-Shapley. La solidité n’était pas seulement liée à ses propriétés mathématiques, il a été utilisé dans l’attribution des élèves à la sortie des classes préparatoires aux grandes écoles (CPGE).

Plus d’information sur le fonctionnement de l’algorithme ici :

En septembre 2017, la CNIL émet une mise en demeure à l’encontre du ministère de l’éducation nationale pour manquement à la loi Informatique et Libertés pour l’APB. En cause : différents manquements à la loi concernant l’information des étudiants sur les finalités de traitement de leur données. L’algorithme utilisé est lui aussi remis en cause. L’utilisation de l’aléatoire lorsque candidats et candidates ne peuvent être descriminés par ailleurs.

Deux mathématiciens sont alors diligentés pour trouver un algorithme qui puisse convenir aux requètes de la CNIL, tout en ayant les mêmes performances que l’APB. Ils ont expliqué leur travail dans cet article. Pourtant ce ne sont souvent pas les algorithmes qui sont problématiques, comme le faisait remarquer Hubert Guillaud sur twitter :

Simple take on monadic types : the List

Monads are often introduced as an abstract mathematical concept or as an abstract design pattern. In this series, humbly called “Simple take on monadic types”, we’re going to manipulate the objects which have monadic instances. We’ll extrapolate their properties and gradually discover their power. If the concept of monads is not familiar to you, you only need some knowledge of Java or Javascript and some attention. For the first article of the series, let’s play with the type List<T> or List a.

The goal of our program is to harvest trees (🌳) to get apples (🍎) and bake them into pies (🥧)! In order to store them, we’ll use the abstract (but familiar) concept of List, everything is much easier when stored in a list.

Bake the piece of pie

Let’s consider this function:

Les types algébriques pour les langages orientés objet

On pourrait renommer les languages fonctionnels (à l’exception d’Erlang, mais c’est une autre histoire) des languages algébriques à tel point que les structures algébriques sont leur outil de base. Nous allons essayer de montrer les analogies que ces structures ont avec les outils qui nous sont offerts dans les languages orientés objets et comment la réflexion en types algébriques permet de simplifier la modélisation de nos problèmes.

Les types sommes

Vous connaissez certainement déjà les types sommes : c’est le nom savant des énumerations. Vous savez ce qu’on utilise en Java pour désigner les méthodes Http ?

public enum HttpMethod {

Happy new year of code

What happened in 2017

2017 has been a rich year for me! All of those good things happened to me this year:

  • I have found a job at malt. It’s the best working environment i’ve experienced so far: a growing team of fantastic individuals, a motivated and welcoming team spirit. I’m super happy to contribute to the adventure!

  • I’m a new member of the Lyon Tech Hub and the Cara Lyon, mostly organizing the Coding dojos and DDD events. Our biggest feat has been the return of the Code Retreat.

  • I wrote a blog post every month at least on this very blog. I didn’t write compuslively, and I tried to search for my articles. Most of them are short but most likely asked a lot of research.

  • I have abandonned the redaction of an unusually long article on processes and threads in different languages. I worked many hours on it, and it will certainly never be published but I learned a lot on concurrency models a low level.

  • I have learned Purescript/Haskell basics while working on side projects. It took a lot of effort to get to a poor level, but it teached me a lot about other languages and gives me a higher point of view (and reasons to dislike javascript)

What is planned for 2018

Response to Vjeux article on Ocaml

Vjeux works on React at Facebook. He published a small list of things that he feels are bad patterns in Ocaml language. I can’t have an opinion on Ocaml itself, since I don’t know the language, but I disagree strongly on some point he makes about functional programming.

Naming is the most difficult thing in computer science

This famous quote by Phil Karlton captures a lot of our job: naming things is hard, because it’s the only way we have to carry meaning and intentions. Here’s the example vjeux uses to critisize a bad style of writing code: => fn(x))

My experience with Purescript so far

Purescript is a pure functional language. It is highly inspired by Haskell and compiles to javascript. I learned it on a side project (not a very serious one) and to write scripts to query our mongodb instances at malt. I will simply present my point of vue on the current state of the language.

Environment tools

First off, the install and setup of the environment is straight forward. Pulp works like a charm! It is intuitive and it never went in my way. The incremental build is super fast on my machine so you can have a quick feedback on your test while you code with a simple pulp --watch test.

The second thing purescript excels at is documentation browsing. If you look for the documentation of the map function, just look up on pursuit. It’s a shame that the results are weidly ordered. I would have preferred to have the Data.Functor (map) at the top, since it’s the most common. But this is only a detail, I’m sure maintainers are aware of these sort of things and are working towards a better browsing experience.

Digging in the depth of Fibonacci

Not so long ago, I read an article on fibonacci. I suggested a more elegant solution to my eyes, but the problem kept bogging me. Let’s get into it!

The naïve recursive approach

The first implementation, which reads like the mathematical formula, looks like this:

def fib(0), do: 1
def fib(1), do: 1
def fib(n), do: fib(n-1) + fib(n-2)

Common pattern for bash auto complete

After reading my last article, I was disappointed. I could have shown you how to deal with the point 1:

[You can] Suggest based on subcommands and options available to the user. This means you need to create a tree of possibilities: goat push supports —force option but goat pull does not, etc.

The first thing to discuss is the COMP_WORDS variable. COMP_WORDS[0] is always the name of the command, goat in our case. Also the current word to be completed ${COMP_WORDS[COMP_CWORD]} represent at least an empty string. You can be sure that you have at least 2 string in your COMP_WORDS array. We’ll use that at our avantage and use a case to complete subcommands:

_goat() {
  prev=${COMP_WORDS[COMP_CWORD - 1]}

  case "$prev" in
        COMPREPLY=( $( compgen -W "log commit push pull clone add" -- ${cur} ) )
      case "$cur" in
          COMPREPLY=( $( compgen -W "--author= --edit --no-edit --amend --include --only --allow-empty" -- ${cur} ) )
  COMPREPLY=( $( compgen -f "${cur}" ) )

complete -F _goat goat

How to create a bash auto complete

Bash auto-complete seems pretty magic. People who use bash extensively (I’m part of them) tend to have a certain love for the [TAB] key! It looked mysterious to me until I implemented one for myself. I’m not proficient at Bash, but basic knowledge of arrays and compgen will make you king of autocomplete.

The compgen magic

This Bash builtin is the base of auto-completion. It takes two arguments: a list of terms, a dictionary, and an input to compare it with. It will return the list of terms in the dictionary which could match with the input. You can use it like this:

$ compgen -W 'init list new compile install lint' -- li
list lint
$ compgen -W 'init list new compile' -- compile
$ compgen -W 'init list new compile' -- lists

Press review #5

It’s been a long time i haven’t written a blog post, even a press review. This is fixed now and the rate of publishing should accelerate next weeks. I gave myself some holidays, and it gave me even more ideas on things to learn. Anyway, enough with boring news on the blog, let me share my best reading lately!

100 days of algorithm: I’ve got lately into algorithm. It’s an interesting field of software I have forgotten for too much time, the more I read about it, the more fascinating it is. The small subset I had time to read are really mind blowing, I hope it does help!

Project package organization: This article is about package organization in Java. I’m a fan of organizing package by features (as presented in the article). Even if you don’t use hexagonal architecture or CQRS, it forces you to think within your knowledge of the domain.

Deploy Elixir app to a vps: Most tutorial on deploying an Elixir application are unclear or too specific, this one is perfect. It covers the basics of the tools without sacrificing the productivity they offer.

The survival kit for functional language beginner

Functional languages like Haskell, OCaml or Erlang based Elixir are difficult to learn when you come from an imperative or object oriented languages. Concepts like immutability, high order functions or monads are very difficult to implement in classical languages (let's call them that way). Thankfully, those functional languages share a lot in common and i'll try to introduce to the most important concepts behind them.

This kit is not a learning guide, and knowing those patterns will not teach you the specifics of each langugages. The road to mastering functional languages remains a hard path to take!

Pattern Matching

Let's start with the most important syntax helper from functional programming: pattern matching. Did the ruby syntax of a b = b a mixed your head up? Prepare some aspirin because... no, I'm joking! Pattern matching is very straight forward if you start practicing it. It allows to assign variable similarly to arithmetic equations. For instance: (Note: example are written in Elixir or Haskell)

Press review #4

This week's review is so diverse! From SQL WITH syntax to a list of good books, you'll find everything, even a critic of "Corporate Agile"

arpinum/awesome: I think it's important to share shortlists of books and this one seem pretty good!

#NoTDD - by Eric Gunnerson: many problems with TDD comes from the lack of design being done. This article tells how design needs to be emphasize when testing first.

Literate SQL: although I do not practice SQL daily, I find this syntax very interesting! Tell me if you use it in your requests.

Why null leads to bad implementations

Bergson once said:

Le néant, c'est la traduction des données de notre perception dans le language de nos attentes.[1]

The void is the translation of the data of our perception in the language of our expectations.

Expectations are wicked things to represent in a program, they are implicit, changing, immaterial and conceptual. We should instead talk about things that exist, that represent reality, and its continuous realm of possibilities.

One could say that this issue has been solved in computing systems through the implementation of types. Types characterize systems without leaving any expectation implicit. This vision, however, fails to take into consideration the infamous null present in nearly every language [2].

Press review #3

Today's press review is about mostly Linux and system toolkit. It's a rather short and technical review, so without further a do, let's go into it.

Shell scripts matter: Bash is almost always unconsidered, this blog post learns you how to create better ones. I've been working with git hooks lately and this guide has been a great help!

ssh_config: This one is not really a press review, it's more a discovery i made while searching the way to bookmark ssh connection. For long I used the CTRL + R history functionnality of the terminal, but this time is over!

Manually Throttle the Bandwidth of a Linux Network Interface, Slow down your internet with tc, tc: Adding simulated network latency to your Linux server: not one, not two, but three article at once! They all cover the same subject: the utility tc for linux.

Press review #2

I liked writing the first press review, so i was impatient to write another one! Here it is. It revolves around user experience and more, I hope you'll like it!

Sideways dictionary: As they put it: "it's like a dictionary, but using analogies instead of definitions." A dictonary for technology principle. It's a very well designed website, cool concept and user's suggestion can be funny. I'll let you explore it!

Improving mobile web conversions just by optimizing web forms: This one is easy to summarize: use autocomplete to your forms as much as you can. As promoted, it will reduce the pain for users, especially for mobile users. I'm pretty confused, because as this tweet showed, the autocomplete could be used to steal user's private data.

How to launch software changes without pissing people off: This article seems very important to me. We tend to consider users as passive, ready for every changes. We are not. We are pissed when our habits get crambles. I don't advocate for them not to happen, rather to accompany them for a smooth transition. As Proust said:

The alien erlang syntax choices

Some developers still argue about which punctuation is the best. Some would support the C syntax with semicolon ; at the end of each line, something that would look like:

int main() {
  int a = 6;
  int b = 3;
  if (a > b) // notice this line has no punctuation
    printf("a is greater than b \n");
  return 0;

Others will say the best syntax is a ruby/python-like with no punctuation. You can write in elixir (very close to ruby):

def print_file do
  # notice the punctuation in the method!("scratch.txt")
  |> Enum.each(&IO.puts/1)

Press review #1

Since I have a lot of time to spend and to read various articles, I thought it would be a nice exercise to review the nice articles i find here.

Want to blog? Read this: i'll start with the article that inspired me to write down this article. It might also inspire you if you plan on writing in your blog but don't have any idea.

Architecting Continuously Testable Systems: Managing large systems is not the most common task for developpers, but delivery management reminds us with the complexity that goes on outside of code. This article goes deep down in the architecture of one system with an emphasis on testability.

Names that Make Computers Go Crazy: how did you configure your database for names? varchar(255)? This article explains how this setup is a nightmare for people like James Dr No From Russia with Love Goldfinger Thunderball You Only Live Twice On Her Majesty's Secret Service Diamonds Are Forever Live and Let Die The Man with the Golden Gun The Spy Who Loved Me Moonraker For Your Eyes Only Octopussy A View to a Kill The Living Daylights Licence to Kill Golden Eye Tomorrow Never Dies The World Is Not Enough Die Another Day Casino Royale Bond, a UK citizen!

Quick introduction to macro in Elixir

When i first ran into macro in Elixir, i felt it was too much for me to learn on the first round. The concept seemed too stepped to digest for the moment. Immutability, pattern matching and Erlang processes are already pretty difficult to grasp when you come from utterly different environment (Java & Javascript in my case).

What a regret i have now! Even if macros are a powerful and complex tool, you can use them to make code much more readable without having to enter the hard bits. That's what i'll try to prove you with some simple examples.

What is a macro

Elixir is a compiled language based on Erlang. Compilation time can be annoying, but it provides more powerful tools such as code generation through their preprocessors. This feature is called a macro in Elixir. When I learned C I felt this was a useless feat, but now that I've grown aware to readability and reusability in programming, thanks to Software Craftsmanship mentality, I see macro a very different way.

Experimenting pushstate to boost page loading

After some nice surfing on, i realized the loading of articles was blazing fast. After a little investigation, i found out they're using instantClick, a javascript library that speeds page display by loading content on mouseover event, once the user clicks on the link the content is displayed in a flash since it's already downloaded! Although i could have simply used the library, i wanted to experiment with the underlining concept: pjax, the contraction of pushState and Ajax.

I don't need to explain Ajax, but pushState needs a little explanation. It is the DOM api that allows you to manipulate the browser history. Simply put, you can change the url without page reloading. Most frontend frameworks like angular, vuejs or react provide router library using this api under the hood. As usual, the best documentation you can get is available at MDN.

pushState: a naive approach

When i first read the documentation, my first thought was "great! it is as simple as the location api", and i tried without any further information. The code ended up like that:

Developer's Proust Questionnaire

Marcel Proust
Marcel Proust

After finishing reading the Search of Lost Time by Marcel Proust, I desperately craved to connect it with my job. It took me a while to realize that the best way to do that is to complete a developer's Proust questionnaire.

The questionnaire has one goal: capture time. We have long term thoughts that we consider defining our identity. But our relationship with those thoughts change through our lifetime. Proust wrote in Search of Lost Time to capture and make us wonder what we've been doing all these years. I suggest you try reading this wonderful book, although i admit it is particularly hard to read.

What do you have to do ? Simply answer the questionnaire. You'll look back to it In maybe 5, 10 or 15 years from now and i guarantee you that your older self will be very surprised how your younger self is (not) that stupid.

If-less game of life

Let's implement an if-less game of life. I discovered this game during a code retreat and the simplicity of its rules make it the perfect field to experiment patterns.

The rules

The game of life consists of a two dimension board filled with cells. Each cell can be either dead or alive. For simplicity sake, we'll only implement the behavior at the cell level. At each step, a cell behavior follows those 4 rules :

  1. Any live cell with fewer than two live neighbors dies.
  2. Any live cell with more than three live neighbors dies.
  3. Any live cell with two or three live neighbors lives on to the next generation.
  4. Any dead cell with exactly three live neighbors becomes a live cell.

Kafka n'est pas kafkaïen

TL;DR; Utilisez kafkaïen pas « digne de Kafka », machiavélique pas « une politique proche de Machiavel »

La modernité et l’avènement d'internet nous pousse à écrire nos opinions de plus en plus rapidement, à les partager inlassablement, quitte à négliger nos formulations. Bien que twitter nous a quelque peu forcé à raccourcir nos phrases, à compresser notre pensée dans le plus petit espace possible, il nous arrive encore de rallonger notre texte, pensant que l'utilisation d'une phrase plus alambiquée serait le reflet d'un esprit plus vif.

Ainsi en est-il des journalistes qui qualifie des procès, des situations « digne d'un roman de Kafka » (j'admets avoir perdu la référence qui m'inspire ce billet), facilité renforcée par l'origine de l'adjectif qui se trouve évidemment dans le nom de l’écrivain Pragois. « Quel malheur à utiliser ce terme ? » Pourriez vous vous demander.

Ode à l'esperluette

Autrefois 27ème lettre de l'alphabet, aujourd'hui haï pour son nom et son utilisation trop commercial, la beauté de l'esperluette a peut-être trouvé refuge dans la chaleur de nos lignes de code. L'esperluette a toujours un rôle mystérieux qui convient à son apparence tourmentée, sa graphie sinueuse, emmêlée et convoluée.

En C++, l'esperluette a repris souffle. Reprenant les opérations qu'elle supportait déjà dans le simplissime C, la voilà en charge des références. Combien d'étudiants et de développeurs chevronnés auront pensé à ses belles courbes avant de déclarer un argument de fonction par référence ?

Esperluette italique
Esperluette italique

On peut regretter que les polices de caractère monospace ne supportent pas l'italique, nous pourrions alors apprécier sa jolie ligature. Mais devant l'évidence que ce n'est qu'un « e » et un « t » assemblés timidement, nous aurions reconnu ses origines et peut être voulu lui réserver un rôle plus évident, la confiner dans les opérations binaires et booléenne.

L'éthique libérale et l'esprit de l'Agile

Dans son livre L'Éthique protestante et l'esprit du capitalisme, Max Weber a montré l'influence des courants protestants sur le développement du capitalisme dans l'Europe du 18ème siècle. Cette démarche d'archéologie des idées est très inspirante (je vous conseille l'écoute de ce podcast sur le sujet), nous allons nous en inspirer pour comprendre la particularité de la méthode Agile dans l'écosystème des méthodes de l'entreprise et comprendre les risques de sa propagation au delà du monde de l'entreprise.

Agile, discipline et efficacité

Les valeurs de l'Agile sont avant tout des valeurs d'entreprise, rien de surprenant dans cela, c'est le domaine dans lequel l'Agile a vocation de se déployer. Parmi les douze principes de son manifeste, le premier pourrai servir de définition du capitalisme :

Notre plus haute priorité est de satisfaire le client en livrant rapidement et régulièrement des fonctionnalités à grande valeur ajoutée.

L'argument ontologique de l'agilité

L'agilité est-elle un Dieu ?

please please please before starting to write another 'what's wrong with agile' article, rename it to 'what's wrong with my organisation'

— Gojko Adzic (@gojkoadzic) May 25, 2015

Si j'en crois ce tweet, l'agilité n'est pas une méthode théorisée par de simples mortelles, mais est belle et bien un Dieu. Qui ne peut souffrir de reproches si ce n'est Dieu ? On appelle cela l'argument ontologique de l'existence de Dieu.

L'hégémonie de l'agilité

Pourquoi Software & Machiavel ?

J'écris ce blog pour rassembler mes idées, abouties ou non, sur la programmation, le développement logiciel, mon travail en somme, en regard de mes lectures.

Pourquoi Machiavel ?

Rien de surprenant que Machiavel soit une source d'inspiration transcendant la politique ou le militaire, ce n'est pas tant le contenu de son oeuvre qui soit digne d'intérêt, mais sa méthode. En ignorant sciemment l'éducation chrétienne moralisante de ses lecteurs, il a produit une une analyse de la situation politique de son époque en des termes nouveaux ouvrant la voie à une science politique délivrée de la morale.

C'est cette position amorale (et non immorale) que je vais essayer de conserver tout au long du blog et ainsi dépasser les positions simplificatrices.