dimanche 22 mai 2016

Why Javascript in 2016 ?

Many of my friends express their surprise when I say I chose to learn JavaScript in 2016.

With so many cool languages to learn, why using a "toy language" of the past instead of, let's say Haskell, Go, Nimrod, Rust (just to name some)?

First and foremost, for me it's not as much as learning JavaScript in 2016 as learning a new language in 2016. But whatever your reasons : not become fossilized, improve your efficiency with new tricks/paradigms/tools or just plain fun you'll probably feel the urge to learn a new language sooner or later.
This bring us back to the question why JavaScript in 2016?

Reason to choose JavaScript


It could be handy to be able to do everything in one unique language (from command line tools, front-end Web dev,  server coding, phone applications to robots programming) and JavaScript now allows that. That wasn't the case before but with node/express/commander/ionic/cylon.js (to name few) you'll have all your needs covered.
Data mining, 3D display, efficient network agents, whatever the task, you can do it efficiently in JavaScript.


Every study will tell the same story: Javascript developers are on high demand, and the demand is growing.
  • CodingDojo list Javascript as the 3rd top requested language.
  • Bloc.io give interesting figures on the growth.
  • ...
This makes JavaScript an excellent skill to possess.


When learning, the community is as much important as the technology studied.
I find in the Javascript community the same things I've learnt to love in the Perl community : efficient tools, diversity, an unorthodox/innovative/open/somewhat messy but pragmatic approach.
This community is easily reachable through the numerous quality blog and sites :


You could evaluate a language ecosystem by many ways but let's consider the JavaScript ecosystem by it's users base and by its language central repository.

The site modulecounts lists NPM as the first module repository whatever the language (be it for total modules count or average growth) and even if some things are to be improved, npm offer a really easy way to manage/reuse the impressive JavaScript's modules list.

Concerning the users base, a github study on languages (2015)  place Javascript as the top language.

That is just numbers of course, but whatever the criterion you choose, chances are that the Javascript's community will score well against all the other languages.


Although not as disruptive for your coding habits as another language (like Haskell) could be.
JavaScript brings many things to play with and extend your confort zone.
Want to play with asynchronicity (would be a good Idea if you still haven't done so in 2016 ;-) )? What about trying promises?
Want to try functionnal programming? Check Ramda or Immutable.
Love to explore new Web paradigm? I suppose things like React / Flux or Koa might interest you.
With the language itself being in constant improvement and the use of transpilers, even the syntax evolves regularly.


That's another area where JavaScript shines. As a developer, having  many configurable linters (JSHint, ESLint...), transpilers (Babel), test libraries/frameworks (Jasmine, Mocha, Chai, PhantomJS...), task runners (Grunt, Gulp) enable you to enforce good practices, better code quality/consistency and globally speed up langage learning.


For some the abundance of choice and constant change may be daunting.
But if you're not among them, be prepared, with JavaScript, to explore a world where there are always plenty of new options and no consensus on the "best" tools to use.
New tools/projects pop up faster than you can list them and issues tend to be solved in no time.


If you're embracing change, 2016 could be the perfect time to learn JavaScript.
I hope this article gave you enough information to convince you. In all cases, don't hesitate to comment and give your feedback.

mercredi 18 mai 2016

Migration dans la simplicité.

Après une mise à jour de mon système je me suis retrouvé avec un postgresql 9.5 flambant neuf (et vide) ! et une version 9.3 encore en place avec toutes mes bases dedans.

Mais moi je veux toutes mes bases dans la 9.5 et pas de 9.3.

Modification du Port à 5433 dans /etc/postgresql/9.3/main/postgresql.conf et 5432 dans /etc/postgresql/9.5/main/postgresql.conf

Un petit redémarrage en tant que root

root@vault:~# pg_ctlcluster 9.3 main restart
Redirecting restart request to systemctl
root@vault:~# pg_ctlcluster 9.5 main restart
Redirecting restart request to systemctl

Une copie simplissime en tant qu'utilisateur 'postgres' :

postgres@vault:~$ pg_dumpall -p 5433 | psql -d postgres -p 5432

Un peu de nettoyage

root@vault:~# pg_ctlcluster 9.3 main stop
Redirecting stop request to systemctl
root@vault:~# pg_dropcluster 9.3 main

Et voila toutes mes bases migrées...

J'adore PostgreSQL !