Drupalcon 2016 NOLA Recap
Monday - May 9
This year for DrupalCon 2016 we traveled down to The Big Easy (New Orleans, LA). We packed up the kids and drove from Colorado through Texas, staying just ahead of the thunderstorms and tornadoes. We arrived in New Orleans with plenty of time check in to our hotel.
Monday afternoon was spent setting up our new booth and attending the opening night reception in the exhibit hall. This year we were exhibiting as Drupal Site Support by Monarch Digital.
The kids where able to attend the opening reception and found lots of goodies around the other booths. They quickly became stars with the exhibitors. This was Robert’s second Drupalcon (he attended in Austin, TX at just over 1 year old).
Tuesday - May 10
Keynote
Keeping with DrupalCon tradition, Drupal founder and lead Dries Buytaert delivered the first keynote. Dries spoke about the state of Drupal 8 and helped reassure those facing frustrations with the latest Drupal release. Drupal 8 was released in November 2016 but developers transitioning from Drupal 7 face a steep learning curve. Drupal 8 was rewritten from the ground up based on object oriented principles and PHP best practices. Contributed modules are still catching up with the latest changes.
Dries covered the results from a community survey and proposed several initiatives focusing on both editorial experience and developer experience.
- Media Initiative: Provide a simple drag and drop media interface and better asset management.
- Workflow Initiative (planned): Allow authors and editors to easily collaborate on content. This includes tools to review, approve, and stage content before it goes live. There is already a team working on this initiative. You can see more at http://drupal.org/node/2721129.
- Migration Initiative (in progress): Allow site builders and developers to quickly migrate sites from Drupal 6 or 7 to Drupal 8. The migrate initiative is already under development and can be found in core (as an experimental module).
- Blocks & Layout Initiative: Blocks have been one of the toughest learning curves for new Drupalers. This initiative would provide intuitive tools to manage page layouts and arrange blocks.
- Data Modeling Initiative: The data modeling initiative will focus on simpler tools for defining content types and managing fields and field instances.
- API First Initiative: Drupal 8 already has a built in REST API. This initiative would expand that to implement an API first strategy including javascript and native app SDKs and GraphQL.
- Theme Component Library Initiative: For all the themers out there, this initiative would convert complex render arrays into a reusable set of elements. For example, a simple text box could be extended into a search form which could be further extended into a larger faceted search box.
- Cross-channel Initiative: This initiative will ensure that users have a consistent experience that may flow across multiple channels. This could include e-mail messages and text notifications as well as other emerging devices such as Amazon Echo.
- Orchestration Initiative: Orchestration tools would allow administrators to configure a set of rules for manage cross-channel experiences.
Typed Drupal
I was expecting this session to focus more on managing custom objects in Drupal 8 but it still provided a nice introduction to new scalar type hinting in PHP 7. I’ll cover more about PHP 7 below. You can view the session here.
Wednesday - May 11
PHP 7: The New New PHP
Larry Garfield (crell) gave an exceptional overview of the new features available in PHP 7. The huge take-away from this session was the vast performance increases in PHP 7 vs PHP 5. All of the top PHP CMSs performed at least 50% better on PHP 7.
PHP 7 is the #1 performance impovement you can make on your site today. ~ Crell
In addition to the performance improvements, here are the top 10 new features in PHP 7:
- Return types: You can now define function return types.
- Scalar type hinds: PHP 7 supports scalar types int, float, string, and bool for parameter and return types.
- PHP 7 introduces the new “spaceship” operator (
<=>
) which compares to values and returns -1 ifa < b
, 1 ifa > b
and 0 ifa == b
. - Another new operator is the NULL coalesce (
??
) which checks if a variable is set and is not null. - PHP 7 introduces new random generator functions
random_bytes($length)
andrandom_int($min, $max)
. - Anonymous classes can be assigned directly to a variable or returned from a function.
- PHP 7 adds a new base class for exceptions called
Throwable
. Additionally, a new throwable for errors includingArithmeticError
,AssertionError
,ParseError
, andTypeError
. - The
assert()
method now works in PHP 7. - PHP 7 provides a new
AppendIterator
class to simplify Iterators called. - PHP 7 defines uniform variable sytax that is read left to right. This clears up confusion from statements such as
$foo()['bar']()
.
Thursday - May 12
Keynote: Your Brain Health is More Important than your Standing Desk
In the final keynote, Michael Schmid presented several ways to keep your brain in top-notch condition. As developers, we do elite sports with our brains and it is important to keep it healthy. Michael identified the following ways to support your brain:
- Get a coach to help define your goals and keep you on track.
- Take time to reflect on success and failures.
- Find and use your productive time.
- Split up your day for different tasks.
- Drink plenty of water
- Take short breaks to refocus.
- Find something that relaxes you.
- Get enough sleep.
- Get help when you feel overwhelmed.
- Keep on improving.
Rethinking Loops
Although I was not able to attend this session at the conference, I watched the video as soon as it was available online. John Kary demonstrated several ways to avoid complicated loops and control structures using array functions such as array_map()
, array_filter()
, and array_reduce()
.
Fizz Buzz is a simple problem often used in software developer interviews. It requires printing the integers from 1 to 100 and replacing all numbers that are divisible by 3 with “Fizz”, all numbers that are divisible by 5 with “Buzz”, and all numbers that are divisible by both 3 and 5 with “FizzBuzz”. Usually the solution involves a loop and several if statements. However, this problem can be solved in PHP using only array functions without any control structures.
1
2
3
4
5
6
7
8
9
<?php
$max = 100;
$all = range(1, $max);
$threes = array_fill_keys(range(3, $max, 3), 'Fizz');
$fives = array_fill_keys(range(5, $max, 5), 'Buzz');
$fifteens = array_fill_keys(range(15, $max, 15), 'FizzBuzz');
echo join("\n", array_replace($all, $threes, $fives, $fifteens));
?>
John also introduced the concept of code pipelines and demonstrated the Haystack library which can be found on Github at http://github.com/ericpoe/haystack
BOF: Drupal migrations
At Monarch Digital, we have been working on several migrations from Drupal 6 to Drupal 8. I attended the Drupal Migrations BOF (Birds of a Feather) session to meet with other developers working on migrations. It seems many people are struggling with migrating their content and I heard from several people with very unique problems.
Everyone seemed to agree that the migration process in core is a long way from being usable. There was a wide range of alternate suggestions including managing all migration via drush or using a manifest XML.
I will be presenting on Drupal 8 migrations at DrupalCamp Colorado 2016 in August. You can find more info here
Comments: