Build a uniform development environnement

keep-calm-and-write-code-11The first issue when developing is to get a working dev environment. This is expecially true when developing for the web where you need a server, a database, some framework, etc. to be able to run your code.

The right development environment needs to check these rules :
  • Individual running environment : avoid having a shared execution place where your code enters in collision with other developers. X devs = X dev environment
  • Instant execution : no time have to be loss to move your code to the running environment
  • Automatic : no manual action to make your code running
  • Before commit : of course, you need to be able to see your code running before commit / push

This drives to only few solutions and my prefered one is a running environment on each developer’s computer for these reasons :

  • The majority of the computers are able to handle this (CPU/Memory speaking)
  • This means that you have a great understanding of your architecture and dependancies
  • The indirect consequence is that every developer will have a great architecture understanding

The main disadvantage of this practice is that a coder could work on several projects and maintaining several dev environments on the same machine can be a nightmare (Software versions, ports attribution, etc.).

A good answer to that is a Virtual Machine but until now, installing, sharing, managing VM’s on personal computers was a nightmare and specific to the host.
Vagrant bring a solution to this, providing a command line wrapper.
With Vagrant, you are able to host the VM configuration into your source control and you can build the development environment with just 3 command lines.

I built 2 minimal Silex environment, the first is Silex Hello World with Vagrant