PHP UK Conference 2017
So… I confess. After 15 years of PHP programming, I’m still new to PHP UK. What a diverse collection of talks by some excellent speakers and contributors. This is the community that has been powering my career for most of my adult life and I didn’t even know it.
The annual conference welcomes approximately 700 delegates from over 16 countries. Numiko sent three of the development team to attend and take in the knowledge from some of the industry’s greatest minds. I don’t want to regurgitate the event so instead, I’ll share some of the exceptionally inspiring moments that will give you something to think about.
State of the Community
Eli White gave a rousing speech. He spoke about divisions over frameworks and CMS choices (Drupal/WordPress) forming community islands but continued by emphasising positive action that is emerging. Eli highlighted the hopes for PHP 7 and its potential as a unifying force within the community. He mentioned bridges being built between communities such as Drupal’s adoption of Symfony components. On a very personal level, there is also great work being done to promote mental wellbeing and even an encouraging campaign in @PHPHugs.
Your Next Web Server Will Be Written in PHP
It was at this point that we began speculating about the titles and whether they were deliberately provocative but, it turned out that David Zuelke of Heroku knew what he was talking about. Following a rundown of how we'd got to the common web server situation with PHP running as a tightly integrated aspect of Apache, there was a discussion of the Ruby/Python web servers. Using ReactPHP there would be the possibility of a PHP-built web server with your framework components already instantiated, handling the requests without the need to reload the full stack for each client connection. As a team that deals with high demand websites the performance implications being discussed meant that we were suitably excited by this prospect.
All about the GOTO
Another provocative title, but one that whet my appetite. It’s been a long time since I got my hands dirty with C and Assembler and even longer since starting with BASIC, but it was really interesting to see the compile stages from PHP code to AST (Abstract Syntax Tree) via a process of tokenisation and on to bytecode (Opcodes in PHP).
This talk by Derick Rethans was probably the highlight of the conference for me. Breaking down each of the functions into their bytecode counterparts formed largely of JMPZ (a line jump) and going through a few of your favourite functions, for me it was a bit of a 'greatest hits of PHP' deconstructed. I had never thought too much about the language compilation despite experience with C and Assembler. I'm pretty sure that now it will never be far from my mind as I write code.
Unit Testing by Example
Anna Filina gave a presentation outlining her Unit Testing experience; it was exactly the sort of talk that is important to the whole community. She highlighted the importance of testing, and also how those not currently employing unit testing could benefit and gently ease themselves into the practice with useful tips. Anna gave Cyclomatic Complexity (a theme also mentioned in ‘All about the GOTO’) a pragmatic spin with a focus on real-life scenarios, useful when deadlines are an important factor. She also highlighted a very important premise: "Testing = Pre-emptive debugging".
Hannes Van De Vreken took us through his experience of a robust code review process, which both encouraged and educated. His concepts are best summarised:
- Use git pull requests as the tool for implementing code reviews and include expansive comments within the pull request, including change log and justifications for any decisions taken.
- Using coding styles PSR 2 (soon PSR-12) plus some additions not only adds consistency, it also prevents the need for these elements to form part of a review process.
- Code reviews should not highlight higher level concepts, for example, "take a different approach", but instead focus on:
- Variable/method naming
- Code clarity (e.g. ensuring the developer has not been a bit "too creative")
- Have interfaces/design patterns been implemented correctly / appropriately?
- Will the code deploy?
- Seek opportunities to educate by linking to articles/blogs where possible
- Praise - if you've learned from or spotted something good, then you should seek out opportunities to include this.
- (Also gifs are an important part of a code review (-; )
- It is important that the language in use is chosen carefully, be positive and avoid aggressive or provocative language and always opt for a suggestive tone.
Testing Upgrades to PHP7
We don't currently employ PHP 7, but it’s only a matter of time before we get to play around with it. With figures being banded around of 50% reduction in page execution time and 30% CPU usage drop I think it’s pretty obvious why I’m eager to give it a go.
With that in mind, it was really interesting to hear Adam Baratz walk us through his team’s two-year project to take the Wayfair online store from PHP 5 to PHP 7. He discussed some of their approaches as well as their pitfalls en route. This account, accompanied by tips and tools used, made for a great presentation and has only served to further whet my appetite for trying out PHP 7.
The final talk went full circle as Michael Cullen returned to the topic of Framework divisions. This topic title sounded the most divisive, yet in-talk all made perfect sense. He spoke of frameworks being merely libraries for use within PHP. Using that logic PHP has a veritable feast of libraries to choose from, and if all those components can work seamlessly with each other then the whole community could benefit hugely.
This reduces the need for Symfony Developers and Zend Developers and instead forges the way for PHP Developers. This hypothesised unification can only be great for Developers and great for the industry.
If this sounds interesting, we're searching for a PHP developer as fascinated as us to join the team. Have a look at our available roles and get in touch.