# 2. Langage, design et evolution

Le talk que Ryan Dahl (le créateur de Node) a donné à la JSConf EU 2018 m'a rappelé 2 autres talks, l'un de Brian Kernighan «successful language design», l'autre de Rasmus Lerdorf (le créateur de PHP) «PHP in 2018».

Ces trois talks décrivent le même phénomène: comment un projet à succès est forcé à évoluer au-delà de son design initial pour remplir les exigences de ces utilisateurs. A chaque fois, cette évolution a un impact négatif sur le design du langage. Pour Node, ça a impacté le système de module:

[...] The module system was essentially an afterthought that got added on as users needed this stuff, and it is reflected in how Node works now. Ryan Dahl
10 Things I Regret About Node.js - Ryan Dahl - JSConf EU 2018 (opens new window)

Pour Brian Kernighan, avec sa longue expérience en design de langage, c'est même une «observation plus générale sur les langages»:

[...] The problem is that stuff was added later, so the syntax is really weird and irregular. And that i think is a general observation about languages. You start with something that you think is relatively clean. It has what would be called [...] "conceptual integrity". And then you start adding stuff to it and you lose that whatever cleanliness there might have been originally. Brian Kernighan
Computer Science - Brian Kernighan on successful language design (opens new window), 2015

Dans le cas de PHP, c'est encore plus extrême, même l'objectif initial du projet a été détourné par les utilisateurs, d'un langage de templating à un langage complêtement fonctionnel:

[...] The problem was though that people wanted to do more and more logic in the templating system. Nobody wanted to write C code and I couldn't convince people to write C code because the web was growing so fast and they weren't enough C developpers in the world. My idea of PHP never came to be [...] The entire world disagreed with me [...] And my ultimate failure came when people started writing templating systems for my templating system and at that point I knew I had lost [...] I have to switch gears and actually make this rather crappy templating language a good programming language. Rasmus Lerdorf
PHP in 2018 by the Creator of PHP (opens new window)

En un sens, Ryan Dahl et Rasmus Lerdorf ont rencontré le même problème mais ont eu des réactions complètement différentes. L'un a créé un nouveau projet pour corriger ses regrets sur Node (jette un coup d'oeil à deno (opens new window), si ce n'est pas déjà fait), l'autre a choisi de changer de braquet pour accompagner les besoins de ses utilisateurs (sans casser internet au passage).

Et puisqu'on parle de design, une dernière citation de Ryan Dahl:

[...] What I've come to learn now that I'm aging is that whenever you're designing a program there's thinks that you think might be cute to add in. You always regret those. If they are unnecessary and simply cute, don't do them. Ryan Dahl
10 Things I Regret About Node.js - Ryan Dahl - JSConf EU 2018 (opens new window)

Mais tu devrais vraiment regarder le talk de Brian Kernighan (opens new window) maintenant.

Dernière mise à jour: 6/10/2021, 8:43:16 PM