Certes, les langages utilisés par les masses de développeurs évoluent lentement. Mais ils évoluent quand même. Fortran et Cobol disparaissent, PHP et Python ont gagné en popularité. Et ces langages s'améliorent aussi avec le temps. C++, Java et PHP ont fait de gros progrès et auraient sûrement vu leur part de marché décroître si ce n'était pas le cas.
Pour les langages fortement liés à une plateforme (et c'est le cas du JS), ça peut aller beaucoup plus vite. Je ne serais pas surpris qu'Objective-C soit devenu quasiment négligeable devant Swift d'ici quelques années. Bref, même si le développeur moyen, dont c'est juste le boulot, se fout de son langage, il code quand même avec un langage bien meilleur aujourd'hui qu'il y a 20 ans.
Et, en dehors de ces gros langages, il y a de la place pour d'autres langages pour des développeurs qui veulent mieux que ça. Ruby, ou plus récemment Go, sont des langages plus agréables pour le développeur, mais avec un écosystème suffisamment riche pour quand même pouvoir répondre à des besoins plus larges que juste ceux d'une niche très spécifique.
Et pour les grosses boites, il y a aussi du changement. Elles se retrouvent prises dans les technos web et mobiles. Et là, le changement est obligatoire. Elles demandaient du jQuery, maintenant c'est du Angular et on commence à voir du React. Elles veulent maintenant être elles aussi à la pointe. Et des concepts comme "Mobile first", "responsive" ou "continuous deployment" sont des bons moyens pour faire changer les mentalités.
Pour le coup, je ne suis vraiment pas convaincu par un tel exemple. 11 lignes, ce n'est pas beaucoup, mais ici, ça a l'air truffé d'erreurs.
varmyPool{
Il manque le = ? Ou ça aurait dû être une définition de fonction ?
mySocket.on('RST','DESTROY','CLOSE'){
J'imagine que ça aurait dû être mySocket.on(['RST', 'DESTROY', 'CLOSE'], function() {.
Promise.allSettled.timeout
Les Promise ont été normalisées, mais allSettled et timeout ne font pas partis de cette API. Je suppose que ça doit venir d'une implémentation tierce à la bluebird.
curSocket.Clients.map(raiseRetryEvent)
La fonction raiseRetryEvent n'est pas définie ici, mais elle n'aura pas accès à curSocket, ce qui paraît bizarre. J'aurais plutôt attendu curSocket.Clients.map(curSocket.raiseRetryEvent.bind(curSocket)), histoire d'avoir d'utiliser une méthode rattachée à curSocket.
if(typeofresult==='function')
Ça peut suffire ici, mais il faut faire attention. Il y a beaucoup de choses qui peuvent passer au travers (les classes ES6 sont vues comme des fonctions IIRC, lodash traite aussi de certains cas particuliers : https://github.com/lodash/lodash/blob/4.6.1/lodash.js#L10020).
result(myPool.allocateConnection);
Sans l'implémentation de myPool.allocateConnection, c'est difficile à dire, mais je pense que ça devrait probablement être result(myPool.allocateConnection.bind(myPool));
L'appel à curSocket.cleanup devrait sûrement être en dehors de la boucle.
Bref, c'est un bel exemple que le JavaScript est un langage avec beaucoup de pièges. Et je pense que les 5 langages que j'ai cités dans mon journal s'en serait tous tirés bien mieux que ça sur cet exemple.
Cozy (avec un 'z') est un projet tout ce qu'il y a de plus actif. Le code est disponible sur github dans l'organisation cozy et occupe plusieurs dépôts git.
Oui, Microsoft va proposer très rapidement de pouvoir utiliser chakra à la place de V8 pour nodejs. Ils ont déjà fait un shim pour V8 (une sorte de couche de compatibilité pour que chakra puisse être utilisé avec l'API de V8) et ont forké nodejs pour l'intégration. Ils attendaient la publication sous une licence libre de Chakra pour pouvoir faire la demande de merge.
On peut lire un article sur ce sujet : https://blog.andyet.com/2015/12/31/the-future-of-node-is-microsofts-fork/. Il ne faut pas faire attention au titre, mais il y a quelques informations intéressantes dedans. Par exemple, on peut découvrir dans un tweet de Brendan Eich (ancien CTO de Mozilla) que Mozilla avait une équipe de 3 personnes pour faire tourner un nodejs avec leur moteur JS. Mais ils sont tous les 3 partis chez Facebook donc ce projet est mort.
Pour les exclusions, il y a raison particulière de ne pas avoir utilisé le même format que gitignore ? Là, le format où tmp signifie en fait un fichier avec une extension .tmp, je trouve ça assez déroutant.
inotify est spécifique à Linux. Par contre, il y a des équivalents sur les autres OS : fsevents pour OSX, kqueue pour les BSD et un truc avec un nom bien long sous windows.
Est-ce que les modifications d'un fichier sont aussi détectées ?
Est-ce qu'il utilise inotify, fsevents et consorts pour suivre les modifications ? Ou c'est "juste" un parcours de l'arborescence de temps en temps pour voir les modifications ?
Est-ce qu'il y a du code un peu particulier pour éviter les race conditions ? Par exemple, il arrive d'avoir un événement "suppression" avant l'événement "création" quand un fichier est déplacé avec inotify ou fsevents (je ne sais plus lequel des deux).
Comment est géré le cas où deux fichiers sont permutés (mv a c && mv b a && mv c b) ?
Est-ce qu'il est possible d'ignorer une partie de l'arborescence ? Si oui, est-ce que les marqueurs de détection sont quand même placés ? Et, toujours si oui, ça se passe comment quand la liste d'exclusions change en cours de route ?
Même dans un contexte familial, il est souvent désirable de séparer les fichiers, agendas et carnets d'adresse. Un système fin de partage entre les utilisateurs serait le top.
On est tout à fait d'accord sur ces deux points. On pense qu'il est préférable que chaque personne dans la famille ait son propre cozy (tâche à nous que ce soit facile et économique de faire ça) et on travaille beaucoup sur les questions de partage entre instances cozy. C'est d'ailleurs le sujet de thèse d'une des personnes dans l'équipe.
Pour te paraphraser, il faut effectivement que l'on trouve une manière jolie, fluide et efficace d'utiliser cozy dans un contexte multi-utilisateurs.
1/ En faisant payer des sociétés. On compte par exemple fournir des outils pour déployer facilement à grande échelle plein de cozys (payants, pour un hébergeur) et vendre de l'expertise cozy à des grosses boîtes pour lesquelles ça fait du sens.
2/ On aimerait bien mais on a eu quelques difficultés (de tête, je ne saurais plus dire quoi). En attendant, on fournit les apk sur https://files.cozycloud.cc/android/.
Pour la synchro des calendriers, ce n'est pas encore géré (mais ça va arriver). On peut faire avec DAVdroid en attendant.
Pour la synchro de fichiers, je vais y aller par étapes. On va commencer par quelque chose de moins ambitieux, puis améliorer ça au fur et à mesure. Pour les quelques gigas, ça ne devrait pas poser de problèmes (sauf s'il y un seul fichier qui fait ces quelques Go à lui tout seul, ou au contraire, des centaines de milliers de petits fichiers).
Pour les compliments, je transmets aux personnes concernées dans l'équipe.
Bitnami permet de déployer en quelques clics sur des serveurs des applications web pour lesquelles ils ont créé une image. Le concours se passe entre applications et celle qui a le plus de votes gagne le droit à son image. En pratique, ils ont pris du retard et l'image pour Cozy Cloud n'est pas encore disponible.
Normalement, à la prévisualisation, c'est déjà remplacé. Par contre, si tu édites un paragraphe, c'est la forme brute (pas encore de remplacement). Tu as un exemple où ça ne marche pas ?
Chez ZeroHeure,
non, je préfère que les gens ne le fassent pas. On remplace déjà automatiquement les espaces par leurs variantes insécables à l'intérieur des guillemets français et mettre directement une espace insécable pose des problèmes (mettre de l'italique à l'intérieur des guillemets par exemple).
LinuxFr.org est codé avec le framework Ruby on Rails et celui-ci dispose d'une protection contre les attaques CSRF. Sur LinuxFr.org, cette protection est active sur les votes pour les sondages ou, comme ici, sur les votes pertinents/inutiles. Pour une raison assez obscure, elle provoque une erreur quand les entêtes HTTP sont contradictoires (X-Forwarded-For et Via si je me souviens bien). En pratique, ça ne peut pas arriver, sauf si quelqu'un joue avec ces entêtes (à la main ou via une extension comme ipfuck).
D'autres personnes ont déjà eu ce problème et voici les solutions qui m'ont été remontées :
ajouter LinuxFr.org à la liste blanche
cocher l'option pour synchroniser les entêtes
désinstaller IPfuck.
Personnellement, je recommande la dernière solution.
[^] # Re: La force de l'inertie fait que rien ne changera
Posté par Bruno Michel (site web personnel) . En réponse au journal Et si JavaScript allait droit dans le mur ?. Évalué à 5.
Certes, les langages utilisés par les masses de développeurs évoluent lentement. Mais ils évoluent quand même. Fortran et Cobol disparaissent, PHP et Python ont gagné en popularité. Et ces langages s'améliorent aussi avec le temps. C++, Java et PHP ont fait de gros progrès et auraient sûrement vu leur part de marché décroître si ce n'était pas le cas.
Pour les langages fortement liés à une plateforme (et c'est le cas du JS), ça peut aller beaucoup plus vite. Je ne serais pas surpris qu'Objective-C soit devenu quasiment négligeable devant Swift d'ici quelques années. Bref, même si le développeur moyen, dont c'est juste le boulot, se fout de son langage, il code quand même avec un langage bien meilleur aujourd'hui qu'il y a 20 ans.
Et, en dehors de ces gros langages, il y a de la place pour d'autres langages pour des développeurs qui veulent mieux que ça. Ruby, ou plus récemment Go, sont des langages plus agréables pour le développeur, mais avec un écosystème suffisamment riche pour quand même pouvoir répondre à des besoins plus larges que juste ceux d'une niche très spécifique.
Et pour les grosses boites, il y a aussi du changement. Elles se retrouvent prises dans les technos web et mobiles. Et là, le changement est obligatoire. Elles demandaient du jQuery, maintenant c'est du Angular et on commence à voir du React. Elles veulent maintenant être elles aussi à la pointe. Et des concepts comme "Mobile first", "responsive" ou "continuous deployment" sont des bons moyens pour faire changer les mentalités.
[^] # Re: Opinion personnelle
Posté par Bruno Michel (site web personnel) . En réponse au journal Et si JavaScript allait droit dans le mur ?. Évalué à 10. Dernière modification le 04 mars 2016 à 11:02.
Pour le coup, je ne suis vraiment pas convaincu par un tel exemple. 11 lignes, ce n'est pas beaucoup, mais ici, ça a l'air truffé d'erreurs.
Il manque le
=
? Ou ça aurait dû être une définition de fonction ?J'imagine que ça aurait dû être
mySocket.on(['RST', 'DESTROY', 'CLOSE'], function() {
.Les Promise ont été normalisées, mais
allSettled
ettimeout
ne font pas partis de cette API. Je suppose que ça doit venir d'une implémentation tierce à la bluebird.La fonction
raiseRetryEvent
n'est pas définie ici, mais elle n'aura pas accès àcurSocket
, ce qui paraît bizarre. J'aurais plutôt attenducurSocket.Clients.map(curSocket.raiseRetryEvent.bind(curSocket))
, histoire d'avoir d'utiliser une méthode rattachée àcurSocket
.Ça peut suffire ici, mais il faut faire attention. Il y a beaucoup de choses qui peuvent passer au travers (les classes ES6 sont vues comme des fonctions IIRC, lodash traite aussi de certains cas particuliers : https://github.com/lodash/lodash/blob/4.6.1/lodash.js#L10020).
Sans l'implémentation de
myPool.allocateConnection
, c'est difficile à dire, mais je pense que ça devrait probablement êtreresult(myPool.allocateConnection.bind(myPool));
L'appel à
curSocket.cleanup
devrait sûrement être en dehors de la boucle.Bref, c'est un bel exemple que le JavaScript est un langage avec beaucoup de pièges. Et je pense que les 5 langages que j'ai cités dans mon journal s'en serait tous tirés bien mieux que ça sur cet exemple.
[^] # Re: Vitalité de Cosy
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Cinq ans de projets libres : bilan et retour d'expérience sur la contribution. Évalué à 9.
Cozy (avec un 'z') est un projet tout ce qu'il y a de plus actif. Le code est disponible sur github dans l'organisation cozy et occupe plusieurs dépôts git.
Le dernier commit date d'il y a 2 minutes : https://github.com/lemelon/cozysdk-client/commit/40abd53e931d1a1ca9c9743ae47704bfd605f905. Bon, je triche un peu, ce commit fait parti d'une pull request qui n'a pas encore été intégrée à la branche principale. Sinon, ce matin, il y a eu la publication de pas mal d'applications. Par exemple, la version 2.1.7 de cozy-home a eu pour commit : https://github.com/cozy/cozy-home/commit/21e56d4d1399fa08d607ad7cf3cfacc823a5ef6a.
Un peu plus éloigné du code, la semaine dernière, Cozy a remporté le Concours Innovation Numérique et une développeuse front a rejoint l'équipe. Bref, Cozy se porte très bien ;-)
[^] # Re: Moteur de rendu != Moteur javascript
Posté par Bruno Michel (site web personnel) . En réponse au journal le moteur JavaScript de Microsoft Edge sous licence MIT. Évalué à 7.
Oui, Microsoft va proposer très rapidement de pouvoir utiliser chakra à la place de V8 pour nodejs. Ils ont déjà fait un shim pour V8 (une sorte de couche de compatibilité pour que chakra puisse être utilisé avec l'API de V8) et ont forké nodejs pour l'intégration. Ils attendaient la publication sous une licence libre de Chakra pour pouvoir faire la demande de merge.
On peut lire un article sur ce sujet : https://blog.andyet.com/2015/12/31/the-future-of-node-is-microsofts-fork/. Il ne faut pas faire attention au titre, mais il y a quelques informations intéressantes dedans. Par exemple, on peut découvrir dans un tweet de Brendan Eich (ancien CTO de Mozilla) que Mozilla avait une équipe de 3 personnes pour faire tourner un nodejs avec leur moteur JS. Mais ils sont tous les 3 partis chez Facebook donc ce projet est mort.
[^] # Re: sync agenda ?
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 3.
La dernière version de l'appli mobile gère maintenant la synchronisation des calendriers.
[^] # Re: Questions
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 3.
1/ Cozy Cloud a refait son site web et il y a maintenant une page about avec une partie sur le business model : https://cozy.io/en/about/
[^] # Re: Quelques questions
Posté par Bruno Michel (site web personnel) . En réponse au journal Publication de la première version de fwtchrq.. Évalué à 2.
Merci pour les réponses. Je ne compte pas utiliser fwtchrq, mais c'est intéressant de savoir comment il fonctionne.
Ça se configure assez simplement : https://github.com/cozy-labs/cozy-desktop/blob/master/doc/inotify.md
Pour les exclusions, il y a raison particulière de ne pas avoir utilisé le même format que gitignore ? Là, le format où
tmp
signifie en fait un fichier avec une extension.tmp
, je trouve ça assez déroutant.[^] # Re: Quelques questions
Posté par Bruno Michel (site web personnel) . En réponse au journal Publication de la première version de fwtchrq.. Évalué à 3.
Oui, c'est ça :
ReadDirectoryChangesW
.[^] # Re: Quelques questions
Posté par Bruno Michel (site web personnel) . En réponse au journal Publication de la première version de fwtchrq.. Évalué à 4.
inotify est spécifique à Linux. Par contre, il y a des équivalents sur les autres OS : fsevents pour OSX, kqueue pour les BSD et un truc avec un nom bien long sous windows.
# Quelques questions
Posté par Bruno Michel (site web personnel) . En réponse au journal Publication de la première version de fwtchrq.. Évalué à 7.
Intéressant ! Je travaille sur un logiciel de synchronisation de fichiers et un des composants importants de ce projet est la surveillance d'une arborescence de fichiers, ce que
fwtchrq
a l'air de faire. Du coup, je me pose quelques questions sur son fonctionnement :Est-ce que les modifications d'un fichier sont aussi détectées ?
Est-ce qu'il utilise inotify, fsevents et consorts pour suivre les modifications ? Ou c'est "juste" un parcours de l'arborescence de temps en temps pour voir les modifications ?
Est-ce qu'il y a du code un peu particulier pour éviter les race conditions ? Par exemple, il arrive d'avoir un événement "suppression" avant l'événement "création" quand un fichier est déplacé avec inotify ou fsevents (je ne sais plus lequel des deux).
Comment est géré le cas où deux fichiers sont permutés (
mv a c && mv b a && mv c b
) ?Est-ce qu'il est possible d'ignorer une partie de l'arborescence ? Si oui, est-ce que les marqueurs de détection sont quand même placés ? Et, toujours si oui, ça se passe comment quand la liste d'exclusions change en cours de route ?
# Fait
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Créer une section Téléphonie (VoIP, ToIP etc...). Évalué à 3 (+0/-0).
La section Téléphonie a été ajoutée.
[^] # Re: LA fonctionnalité manquante
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 3.
Merci, j'ai corrigé cette très grosse faute. D'habitude, je fais plus attention que ça.
[^] # Re: LA fonctionnalité manquante
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 9. Dernière modification le 07 novembre 2015 à 12:45.
On est tout à fait d'accord sur ces deux points. On pense qu'il est préférable que chaque personne dans la famille ait son propre cozy (tâche à nous que ce soit facile et économique de faire ça) et on travaille beaucoup sur les questions de partage entre instances cozy. C'est d'ailleurs le sujet de thèse d'une des personnes dans l'équipe.
Pour te paraphraser, il faut effectivement que l'on trouve une manière jolie, fluide et efficace d'utiliser cozy dans un contexte multi-utilisateurs.
[^] # Re: C'est Noël avant l'heure !
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 5.
Merci, ce commentaire fait plaisir à lire ! Je transmets à toute l'équipe. À bientôt sur le forum.
[^] # Re: Questions
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 10.
1/ En faisant payer des sociétés. On compte par exemple fournir des outils pour déployer facilement à grande échelle plein de cozys (payants, pour un hébergeur) et vendre de l'expertise cozy à des grosses boîtes pour lesquelles ça fait du sens.
2/ On aimerait bien mais on a eu quelques difficultés (de tête, je ne saurais plus dire quoi). En attendant, on fournit les apk sur https://files.cozycloud.cc/android/.
[^] # Re: sync agenda ?
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 5.
Pour la synchro des calendriers, ce n'est pas encore géré (mais ça va arriver). On peut faire avec DAVdroid en attendant.
Pour la synchro de fichiers, je vais y aller par étapes. On va commencer par quelque chose de moins ambitieux, puis améliorer ça au fur et à mesure. Pour les quelques gigas, ça ne devrait pas poser de problèmes (sauf s'il y un seul fichier qui fait ces quelques Go à lui tout seul, ou au contraire, des centaines de milliers de petits fichiers).
Pour les compliments, je transmets aux personnes concernées dans l'équipe.
[^] # Re: Bitnami
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Nouvelle application contacts pour Cozy Cloud. Évalué à 7.
Merci.
Bitnami permet de déployer en quelques clics sur des serveurs des applications web pour lesquelles ils ont créé une image. Le concours se passe entre applications et celle qui a le plus de votes gagne le droit à son image. En pratique, ils ont pris du retard et l'image pour Cozy Cloud n'est pas encore disponible.
# Fait
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Créer une section Cloud. Évalué à 4 (+0/-0).
Merci pour le logo, j'ai ajoutée cette section.
# Zut
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Mettre à jour et activer le formulaire pour badges VIP Paris Open Source Sumit. Évalué à 3 (+0/-0).
Oops, j'ai été très pris et j'ai raté la date limite :/
[^] # Re: Nope
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Espace insécable dans les guillemets. Évalué à 3 (+0/-0).
J'ai été voir cette dépêche dans l'espace de modération et on a bien les espaces insécables.
[^] # Re: Nope
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Espace insécable dans les guillemets. Évalué à 3 (+0/-0).
Normalement, à la prévisualisation, c'est déjà remplacé. Par contre, si tu édites un paragraphe, c'est la forme brute (pas encore de remplacement). Tu as un exemple où ça ne marche pas ?
# Nope
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Espace insécable dans les guillemets. Évalué à 4 (+0/-0).
Chez ZeroHeure,
non, je préfère que les gens ne le fassent pas. On remplace déjà automatiquement les espaces par leurs variantes insécables à l'intérieur des guillemets français et mettre directement une espace insécable pose des problèmes (mettre de l'italique à l'intérieur des guillemets par exemple).
[^] # Re: IP fuck ?
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi système de pertinence en rade. Évalué à 3 (+0/-0).
LinuxFr.org est codé avec le framework Ruby on Rails et celui-ci dispose d'une protection contre les attaques CSRF. Sur LinuxFr.org, cette protection est active sur les votes pour les sondages ou, comme ici, sur les votes pertinents/inutiles. Pour une raison assez obscure, elle provoque une erreur quand les entêtes HTTP sont contradictoires (
X-Forwarded-For
etVia
si je me souviens bien). En pratique, ça ne peut pas arriver, sauf si quelqu'un joue avec ces entêtes (à la main ou via une extension comme ipfuck).D'autres personnes ont déjà eu ce problème et voici les solutions qui m'ont été remontées :
Personnellement, je recommande la dernière solution.
# Retour dans l'espace de rédaction
Posté par Bruno Michel (site web personnel) . En réponse à l’entrée du suivi Dépêche inaccessible après rédaction ?. Évalué à 3 (+0/-0).
Bonjour, j'ai rebasculé cette dépêche dans l'espace de rédaction. Elle est accessible ici : https://linuxfr.org/redaction/news/numba-0-22
# Portabilité des données
Posté par Bruno Michel (site web personnel) . En réponse à la dépêche Consultation « République numérique », soutenez les propositions de vos organisations préférées. Évalué à 7.
J'encourage les lecteurs de LinuxFr.org à voter pour les suggestions ci-dessus. Il y en a également une, portée par le CNNum, qui me paraît très importante : Consacrer un droit effectif à la portabilité des données.