One of our PHP developers, Andrei, took us through some of the tools that he and the web development team use at Thinslices, in order to maximise and fluidise the programming process.
Tools that make the difference
a. Working with Symfony, the PHP framework for web projects
Symfony was chosen as the most suitable option by the developers at Thinslices. After having worked with Zend Framework for several projects, they switched to Symfony. It all happened in the middle of a very complex project, which did not deter programmers from moving everything from one framework to the other. Ultimately, all existing projects were translated to it.
The sudden shift in framework occurred due to Zend’s extreme complexity (it takes a lot of time to fully understand all its functionalities, as well as to get used to working with them). Symfony saves time and effort.
Businesses choose Symfony over all other frameworks due to its efficiency in the long run. Designed to work with all platforms and infrastructures, Symfony ensures that all code is reusable and testable thanks to the Web Debug Toolbar.
Developers claim that the main advantages reside in
- simplicity and user friendliness: any beginner can install and operate with the basic Symfony skeleton, even with very few programming skills;
- speed: development time is highly reduced and version 2 takes two times less memory than the previous versions;
- flexibility: whether you want to build everything from scratch or you need to improve just some part of the functionality, Symfony might be the right solution;
- sustainability: all major versions receive support from SensioLabs, which ensures high compatibility and risk-free security;
- constant support: as a vast majority of developers worldwide use Symfony, any potential query regarding the functionality can easily be answered on a forum or specialised website;
- expandability: the several bundles that Symfony presents help develop and reuse certain aspects/functionalities of a project;
- extensibility: everything is decoupled and all layers are easily replaceable;
- controllers, helpers and bundles such as Doctrin for databases help save time (no more need to write specific code, like SQL).
Many of the plugins that are extremely helpful are featured on the official page.
An additional reason for its increased popularity is the low cost (Symfony is an open-source framework), compared to the complex high-end solutions it offers. All in all, some claim it is not a framework, but a project of which the micro-components stand more chances of being catalogued as frameworks.
b. Live Reload plugin works perfectly with Sublime
LiveReload is one of those tools that makes developers’ work so much easier. Every time a file is saved, the browser refreshes automatically, thus making file supervision in the system a lot easier.
The download process is easy and made possible through the website. In case you wish to visualise the code snippet, it is available in the GitHub. Plus, this website helps with extensions for all important browsers. The same one can help if you have trouble installing it on your Mac or PC.
An additional installation tip: set up your own web server before installing the browser extension. If you wish to stick to your old code editor, the instructions here might be of use.
Overall web reviews are positive, and this is not only due to LiveReload’s simplicity in installation, but also to its help with debugging: version 2.3.27 successfully deals with most known bugs: slowness, crashes and many output file names ignored.
c. Bundles help integrating other programming languages
Bundles are a godsend, as they help programmers simplify their workload massively. Here are the three most appreciated bundles that Thinslices uses during the PHP coding process.
One of the most used bundles is Kunstmaan, that saves programmers plenty of time with creating pages, editing on-site translations and centralising images. CMS websites are easily done without the need to work on a time-consuming admin interface. Kunstmaan boasts on being user-friendly and it isn't lying: they offer
- an easy content management platform
- very accessible design, that allows handling page functionalities - such as adding or removing different parts of a page - very easily
Copy-pasting code is no longer necessary.
"a set of PHP libraries primarily focused on providing persistence services and related functionality."
This bundle, that boasts on the Object Relational Mapper and the Database Abstraction Layer, helps write Database queries in a language alternative to SQL, thus making the deployment of new versions of any database schema a lot easier.
This is another bundle that eases tasks involving user management. User registration and password retrieval are but a few of the problems FosUser solves. As quoted on the website, this bundle offers
- email confirmation upon user registration
- support for reset passwords
- help with the login form
- help with the registration form
- integration of users within the database
A complete tutorial can be found here.
d. Keeping up with the latest news: reading Richard Miller
Miller is one of the most famous guys when it comes to Symfony2. He is a lead developer at SensioLabs UK and one of the most important contributors to the development hub.
His website, www.richardmiller.co.uk, is equally famous for offering insightful information on configuring different services for different environments, avoiding setter injection, improving elastic search results and many others.
e. Jenkins Deploy Plugin
This plugin helps developers at Thinslices continuously test their projects, by monitoring executions of externally-run jobs. Its main features are displayed on the website:
Easy configuration: Jenkins can be configured entirely from the web GUI, without any need to tweak XML manually;
Permanent links: Jenkins gives the possibility to monitor the latest external projects, by offering readable URLs for its pages and permalinks that can be easily linked from the outside;
RSS/E-mail/IM Integration: Monitor build results by RSS or e-mail to get real-time notifications on failures;
File fingerprinting: dependency can be more easily tracked thanks to Jenkins’ monitoring of jars produced.
Jenkins helps both developers and admins that release often and hence, are preoccupied with continuous integration. The one-click deployment feature helps reduce time, provided that fresh bits of code are inserted into the app daily.
The overall MO for Jenkins is presented in the screenshot below, which is part of a PPT presentation on SlideShare.
To conclude, Jenkins is preferred for
- continuous integration
- continuous inspection within PHP projects.
- easy deployment (even the product owner can do it).
f. Git hooks
Thinslices developers like using the hooks found within the GIT repository. They are
"little scripts you can place in $GIT_DIR/hooks directory to trigger action at certain points."
The Githooks website presents a plethora of scripts to which hooks can be attached.
The main reason why the GIT hooks are so appreciated is developers’ capacity to make a commit and push without ever leaving the GIT.
g. Diff Checker
As the website quotes, DiffChecker is
"an online tool to compare text differences between two text files."
The comparing procedure is done easily, by simply entering the contents of two files and clicking the “Find Difference” button.
A detailed manual for Diff Checker can be found here.
Structure makes the code go round.
The tools used for maximising the potential of the lines of code are essential. However, the secret to achieving KPIs and to constantly working before defined deadlines lies in a structured workflow. Structure works marvels
- within the programming team:
- developers try to structure code in small, reusable chunks;
- all developers do peer review after each Pull Request;
- there is constant refactoring;
- within the whole team, with the aid of SCRUM methodologies.
SCRUM helps developers and project manager achieve professional results in a sustainable manner.
Every sprint (most of the times, a 2-week one) presumes respecting a number of predefined ceremonies:
- planning; this occurs in the exact beginning of the sprint, in which tasks are discussed and in which the client prioritises them.
- daily meetings; this part, that occurs on a daily basis, tries to answer three basic questions:
What was delivered yesterday?
What am I (the developer) working on momentarily?
What are the impediments I’m facing?
- grooming; this normally happens weekly and lasts about one hour. Its role is to discuss future functionalities of the project.
- sprint demo; this part is very client-based. It is now time to show the client what has been done throughout the sprint, and he is now guided within the application.
- sprint retrospective; as the name suggests, it is the time to analyse what has been done during the sprint. Questions regard what went well, what didn’t work out and, simultaneously, what can be improved by learning.