5. Common problems
• “But it worked on my dev machine! What
happened now?”
• “Oh no! we use version 1.3.15 on the server? I
run 2.6.13 which has the feature X
implemented!”
6. Enter Vagrant
• What it provides
– Virtual Machines called “boxes”
– Provisioning
– Requirements: VirtualBox, Ruby
7. Configuration
• Simple Ruby file called “Vagrantfile”
– http://www.vagrantup.com/
• Plethora of pre-packaged boxes
– http://vagrantbox.es
• Provisioning via Puppet or Chef
8. Benefits
• Consistency between local dev machine & production
server
• Ability to use the same provisioning recipes on production
• Prevents from bloating the host OS with many services
• Production server changes can be tested locally before
being applied to production
• Cloud integration (knife, vagrant aws)
9. Provisioning: Puppet vs Chef
• Never ending discussion
• Chef
– Write Cookbooks in Ruby
– http://docs.opscode.com/just_enough_ruby_for_chef.html
• Puppet
– Puppet manifests in Puppet script language
• Both have the same results
12. SVN vs Git
• Pros
– Simple flow
• Cons
– Brances are separate directories
– Always commiting to repo
– Extreme CPU usage on big repos
13. Enter Git
• Feature branches: No separate directories for
branches
• Submodules
• Stash
• Remotes
14. Remote Repos
• Hosted on 3rd party services
– Github
– Bitbucket
• Can be self-hosted
– Gitlab
– Gitolite
– Gitorious
15. Git
• Pull requests: Non merged commits –Visual
representation of changes
• Squash / Rebase: Merge several commits to
one
– Reverting only one commit if needed
16. Code Structure
• Design patterns
– “Design patterns are reusable solutions to
commonly occurring problems in software
design”
• Help you get a solid start
17. Design patterns
• Not the holy grail
• Help developers read each others code as
structure is somehow pre-defined
• Avoid duplicate code
19. Best Practices
• Avoid hacks
• DELETE your code
– http://www.youtube.com/watch?v=Ev7lM7SWVHE
• Less code is always better
• Refactor while you still code
20. Other tips
• Embrace coding standards
– https://github.com/php-fig/fig-standards/
• Exceptions are your friends
– Traceable, Catchable
• Read other developers’ code
– Github => Facebook for developers, browse repos,
even in languages you are not familiar with