24PullRequests 2016

Last year I already wrote about different initiatives in the period leading up to Christmas. In one of my talks this year, Level Up Your Team I've been discussing many ways of learning, and for this year I want to highlight one of the initiatives that I participated in last year, and again am trying again this year: 24 Pull Requests.

What is it?

The idea is that you send (at least) one pull request to an open source project in the days leading up to Christmas, starting on December 1st. The website will keep track of your progress and give you a list of suggested projects.

Why would you do it?

The most obvious reason is to contribute something to open source. If you, like me, earn most of your income by using open source code in your projects, this is most certainly a good reason to contribute to open source. But there's more...

When do you learn most? I learn most when I am challenged, when I am pushed out of my comfort zone. This is one of the reasons we get so much positive feedback for WeCamp, because we push people out of their comfort zone in every possible way. That same thing applies with 24 Pull Requests: You are forced to send a pull request to an open source project 24 days in a row. While they can be 24 PRs to the same project, it works better to have a look at the suggested projects and try to contribute to multiple projects, preferably ones that you don't know (that well).

Is it easy?

No. Not every project has a low hanging fruit or easy pick tag, and even if they have them, it may not be easy for someone new to the project/codebase. Also: Actually writing a PR every single day for 24 days is not easy. At least if your calendar is as busy as mine, it's not easy.

Actually last year, I completely failed. I can't find the actual stats anymore on the 24PullRequests website, but I think I sent maybe 5 or 6 pull requests. Time was mostly the reason for this failure, but I tried. And even though I didn't succeed in sending 24 pull requests, I did push myself to contribute to open source, and I did learn about some projects. For instance, I had not looked at Disco until last year. And this year, I've already contributed a simple typo to RMT, which I did not know until yesterday, and I've contributed a bugfix to Bolt, a CMS that I've been using a lot in the past year.

Join in!

So go ahead, start contributing!


Get rid of -m

I can't remember where I actually first read about this little developer's lifehack, but I've been using this for a while now and really like it: Not using the -m option anymore when commiting with git.

What I used to do...

I use Git nearly exclusively on the command-line. My main reason for that is being burned by a version control integration of an IDE somewhere in the remote past. Since then I don't really trust any version control integration anymore and I want to have the full control over my version control tool of choice, these days mostly Git.

Committing changes had a certain never-changing process:

git status

To check which files I've touched.

git diff

I'd diff each file separately to see if the changes in that file belong to the stuff I currently want to commit.

git add

I'd add every file that belongs to the current change.

git commit -m ""

Then I'd commit the staged changes with a small comment about what the change contains

The main problem with the above flow was that the -m promoted short and simple messages. And tempts a bit too much to write bugfix or just a little change in the controller. It is just too tempting. Also, even though I'd just changed on which changes there are in the files I'm committing, I wouldn't have it all in my head anymore.

Get rid of -m

Some time ago I'd read a tip from someone that said "just don't use -m. It took some time to process the usefulness of this tip in my head, but eventually I decided to try it. It works!

The last step in my flow now is:

git commit

This opens up (in my case) vi, where I see a list of the staged files and I can type a commit message. Because I'm not on a command-line anymore but in an editor, I'm less tempted to write only a short commit message. Instead, I can describe what is in the changeset. And since I have the list of changed files there as well, it's easier to remember what I changed and for what reason.

It's a simple lifehack for a developer to write better commit messages, and it works (for me)!


The Serendipity Machine

I recently finished a book that has been in my possession for quite some time already, The Serendipity Machine by Sebastian Olma. Subtitled A Disruptive Business Model for Society 3.0 sounds very buzzword-y and startup-y, but despite the subtitle it was a very good book.

I've been a big fan of the Seats2Meet concept for quite a long time. The idea of getting a free working place including free lunch in exchange for sharing your knowledge and experience with others really appeals to me. I was first introduced to the concept quite a while ago by a colleague. Despite my business model causing me to work on-site with customers most of the time I've worked at Seats2Meet on several occassions, and with PHPAmersfoort we also organized meetups at one of their locations.

Some of the things discussed in the book really already describe what happens naturally in the PHP community. Especially things like sharing knowledge is happening a lot. One of the things where I think we can still improve though is the facilitating meetings. On the higher level, I mean to combat the isolation of the "islands" inside the greater PHP community, such as Drupal, Joomla! and all the different framework communities. But on a lower level, I also mean the people attending usergroup meetings and conferences. In a way, initiatives such as FIG provide a way of doing this, but on that smaller, lower level, we fail to do this, perhaps also because we fail to facilitate this. The fact that the majority of PHP developers is pretty introvert does not help, but all the more reason to facilitate these meetings.

So how do we facilitate this? you may ask. This is where we can have a look at how Seats2Meet does this. Their platform, where all visitors of the Seats2Meet locations sign in, allows people to "tag" themselves. In their profile, they list the topics they're expert in. For instance, my profile for Seats2Meet contains the following:

Tags in Seats2Meet profile

When you've book yourself a seat, you'll see the tags of other people that are there together with you, and you can look for the specific knowledge that you need. This is an active facilitation of meetings between people that have something in common. If at some point during the day while working at Seats2Meet you find yourself in need of some specific knowledge, all you have to do is check their system to see if someone with that knowledge is also at the location you are at.

The hallway track

This is where the hallway track at conferences becomes useful. While most people are in a session, staying in the hallway is a great way of meeting other people that made the same choice of a skipping a session. These kinds of random meetings are harder during breaks: There are so many people in the hallway at such a moment that it's hard to really decide who to talk to outside of the people you already know, also because everyone else is also talking to people they know. During a session though, there is little choice. So next time you skip a session, just talk to someone else that made the same choice. Even if you can't help eachother at that moment, you've expanded your network (or value network as Sebastian calls it in the book).

Conferences may facilitate these meetings by allowing "tagging" of people. Either through an online platform or by allowing people to add "tags" to their name badge. I can't tell you exactly how this should be done, but I do feel this is something that can be done in a better way, to facilitate these "random" meetings. To enhance the serendipity.

If all this sounds good, I would recommend you picking up a copy of The Serendipity Machine. It is an inspiring read, especially for those that are active in the PHP community. And if you're near a Seats2Meet location, book a seat for a day every once in a while. It's free and it's awesome.

The Serendipity Machine (ISBN 978-90-8169, November 2012, Creative Commons BY-NC-ND) is also available as free PDF download.


ZendCon 2016

It's just past 5AM as I start writing this. I'm sitting downstairs in the ZendCon hotel, with a view on an empty bar and brightly coloured gambling machines. Since I woke up at 3AM (don't you love jetlag?) and today is the day I travel back home, I've been reflecting on the conference. I'll be missing a few sessions because I had to leave early, but I've already gotten a lot of new stuff to ponder about, my head is pretty full. Time to let it sink in a bit.

As I was pondering the lessons of this conference, I thought back to the last talk of yesterday, Exploiting the brain for fun and profit by Alena Holligan. One of the things Alena talked about was how you can improve your learning. One of the things she mentioned was teaching others. Teaching others really helps you to learn stuff yourself. But the other thing was: Write it down. Writing things down will help you to not forget stuff. She even mentioned the situation I've been in a couple of times: Googling for a problem only to end up on your own blog, where you discuss the solution. As such, I'm writing down some of my lessons of ZendCon. So I won't forget, and hopefully to help others learn about this stuff as well.

Let's start with the opening keynote by Andi Gutmans and Rod Cope. Andi and Rod looked back at where we came from and where we're going with technology. While the picture for the future that was painted sounded awesome for users, it sounded horrible for privacy. I'm really curious to see where this will be going.

I also attended the Composer for corporate use talk that Stephan Hochdörfer did. One of the things I learned from that talk is the composer license command, which gives you an overview of the licenses used by your dependencies. Related to that, I also learned about VersionEye, which seems like an interesting service. That is now on my list of things to check out.

I was really looking forward to see Uncle Bob do a keynote at ZendCon, and this turned out to be an amazing keynote. He gave a nice overview of some common patterns from the past as well as the present. It also taught me that at my current project we're doing pretty well for some of these topics. There's always room for improvement, but we're on the right track. It is good to get that kind of confirmation.

Next to the talks I also had a nice chat with some of the sponsors at their booths. My most important lesson there was the Clean Coders video platform. Before ZendCon I was not aware it even existed, but with a lot of material delivered by people like Uncle Bob, Corey Haines and Michael Norton on topics such as architecture, technical debt, testing, SOLID etc it looks like an amazing opportunity.

It has been another amazing ZendCon, and I'm bringing the lessons back home with me.


On Priority

I got a private message on one of the Slack networks I'm on on August 2nd. Mike Bell invited me to write something for Geek Mental Help-week. As usual, I delayed to the last moment to write that, and the Geek Mental Help-week was last week. I'm publishing this now, a couple of days too late.

For quite a while I was thinking about what to write about. I had quite a few good topics I could possibly write about, but I just hadn't decided yet. I've thrown out all those topics (for now at least) because I am too late, and that actually gave me the best topic.

Last Thursday was a horrible day. I felt my mind being tricked into depression. I specifically use these words because I can not really control when it happens, or what happens. I've had cognitive behavioural therapy to recognize when it happens and to try and counter it, which usually works, but on Thursday I had a really hard time actually doing so.

I had a full-day training session scheduled on Friday, a training session I had already postponed earlier. I could not cancel that. So I set my mind to delivering that on Friday and was able to do so, in a way I feel was good. It went much better than I had anticipated, which made me feel a bit better. It was also incredibly exhausting, and I've found myself to have an extra hard time keeping myself out of depression when I'm tired. I succeeded though, but again, I struggled.

Over the past years I've tried to force myself to have actual weekends more than before. I try to stay away from the computer a bit. During therapy I learned that one of the ways to try and stay out of depression is by staying active, doing things, going out. And so when the idea came up to head into the nearby city to catch Pokémon, that sounded like a good plan. It worked. It kept my mind occupied enough, distracted enough. It was still hard work to keep my head straight though. On Sunday, this resulted in me sleeping quite a bit through the afternoon. Unsurprisingly, I may add.

And now it is Monday. The day started just as bad as the previous days, but somehow as the day progressed, my head cleared. And for the first time in 5 days, I started feeling quite well again. By the end of the day, my head had cleared. What's left is this tired feeling in my head. I'm pretty sure that will clear though.

It's been a long 5 days, but I've survived. And while I never can tell for sure, I'm pretty sure it had to do with me setting priorities. Going out with the family on Saturday, not working on either this blogpost or my keynote for PFCongres next Saturday or my talks forZendCon the week after. And while I'm sorry that this blogpost is a bit too late, it illustrates all too well that it is important to set the right priorities. The great thing is that many people had their priorities right last week. This list of articles is the proof of that.


PHPStorm & OSX: Mouse Stopped Working

This is just as much a post for future me as it is for the rest of the world.

While I was working on preparing a training for the end of the week and was using PHPStorm to create some example code, all of a sudden my PHPStorm stopped responding to my clicks. I could click whatever I wanted, it just would not work anymore. As you can imagine, this is quite frustrating when you're trying to get some work done. The weird thing was: My trackpad worked anywhere else in OSX, just not in PHPStorm.

I took to Twitter to vent my frustration, then tried the more constructive approach of tweeting to @PHPStorm with this problem:

@phpstorm somehow my PHPStorm does not respond to mouseclicks anymore, just to keyboard strokes. What can I do to fix this?

Kevin Boyd quickly responded with a link to the Jetbrains forum. The problem seemed similar, but aside from "reinstall the IDE" there was not really a good solution there. While I was searching for other people that may have the same problem, another tweet came in, from Damon Jones:

@skoop @phpstorm Mac? You've zoomed the window slightly (pinch to zoom). Zoom back to normal and you should be okay.

OK, that seems very weird, but let's see what happens if I "unzoom" while in PHPStorm. WHOA! This was it! Apparently, while using my trackpad in PHPStorm I had accidentally pinched to zoom just a little bit. Not enough to be noticable, but enough to make PHPStorm stop responding to any mouse interaction.

Thank you Damon. I owe you a beer at a conference some time.


Win a FREE PHPNW ticket

I've said it before and I'll say it again: PHPNW conference, every first weekend of October in Manchester, is the best PHP conference I've ever been to. I buy my ticket blindly as soon as they go on sale every year. I've been accepted to speak very regularly in previous years and then raffle off my ticket. I was not expecting to need to do that this year, since I did not get accepted to speak. I was looking forward to experience PHPNW as a delegate this year.

Things have changed though. Unfortunately one of the speakers had to cancel their speaking and I've been asked to be the replacement. Of course I said YES! Speaking at PHPNW is a fantastic experience, and I'll gladly help them in a situation like this. But this also means that I don't need my ticket anymore.

This means, however, that I have a spare ticket. As it has become a tradition by now to raffle my conference ticket once accepted as a speaker, I'm again raffling my PHPNW ticket. The ticket has full access to all events of the main conference, including the hackathon on Friday, the social on Saturday and the Sunday conference day. The only thing is: The conference is THIS WEEKEND!

So: If you want to win my ticket, the only thing you need to do is send me an e-mail: stefan@ingewikkeld.net. Please only send an e-mail if you can actually make it this weekend. On Wednesday I'll do a random draw of the winner and send them an e-mail.

PHPNW will be awesome again. See you in Manchester!


The Speaker Package

I've been meaning to write more about speaking recently, so after I wrote about my personal CFP rule, let's write about a very related topic: The Speaker Package.

What is it?

The speaker package is the term used for the package of reimbursements and other advantages you have as a speaker. This may (or may not) include a free ticket to the conference, travel and/or hotel reimbursements, a speakers dinner and some other things.

Why is it important?

When submitting to a conference, it is important to realize what the speaker package consists of. For instance, if you can not pay for your own travel or hotel and don't have an employer that does so, you need to be sure that the conference can cover this. Also, for planning purposes it may be useful to know about speakers dinner, so that you block your calendar so you are able to attend it.

I made the mistake once of making assumptions about the speaker package (in this case: I assumed travel was being reimbursed) when submitting proposals to a conference. I got accepted, but then found out my flight was not covered by the conference. Because of that, I had to cancel that conference. Cancelling a conference is never fun, but especially not because of something like this.

Speaker package unclear? Ask!

If something is unclear about the speaker package, do not hesitate to contact the conference about it. I've found that many conferences these days use OpenCFP for their call for papers. The OpenCFP standard template contains some information about the speaker package, including:

Complimentary airfare/travel (according to conference policy)

Unfortunately, conferences usually do not elaborate on what this conference policy actually is. Since some conferences only give partial reimbursements for airfare, you're never really sure how much of the flight you're going to pay for yourself. If a conference has this standard text and no additional information on their reimbursement policy, just get in touch with them! Get them to clarify this before submitting to their CFP.

Another personal rule

In my previous article I explained about my personal rule to not submit to a conference unless I'm sure I can make it if I get accepted. I have another personal rule, this one concerning the speaker package:

I will not submit to conferences that do not make an effort to reimburse their speakers

Unfortunately, there are conferences out there that do not offer to pay for anything for a speaker. These conferences mostly seem motivated by the idea that "you're already coming to this conference anyway, so become a speaker while you're here". I can sort of understand this sentiment, but I personally feel like this implies a certain lack of respects towards the speakers.

Speakers invest a lot of their time in a conference. They spend hours, sometimes days on preparing a talk, creating slides, rehearsing it, finetuning it, submitting it to conferences. They also spend a lot of time on the conference: car trips or flights, actually being at the conference, talking to people before and after their talk. They even spend money because they come to the conference: They need to eat and drink, park their car, etc. If the speaker is a freelancer or entrepreneur, they'll also miss income because they can not make billable hours while at the conference. All this is a huge investment, to be part of the conference. Speakers are usually passionate and willing to do this, but when conferences do not even make an effort to reimburse at least part of this, this is a reason for me to not submit to a conference.

It is the effort that counts

I'm not saying that all costs should be reimbursed. As I mentioned before, speakers are usually passionate and willing to invest in conference speaking. I know I am more than willing to do this. I've spoken at conferences where travel is not being reimbursed (the best PHP conference in the world does not reimburse travel) and I've spoken at conferences where I offered to pay for travel (because the conference offered sponsorship packages in return for covering travel). All of these conferences have one thing in common: They all offer to pay for (part of) the cost of speaking. And in case of PHPDay, they even offer a valid way out of their reimbursements by offering sponsorship in return for not having to reimburse. It is the effort of trying to cover expenses that counts to me.

So now what?

Next time you open the CFP page for a conference, look for the speaker package information and make sure that it meets your requirements. If you have an employer, talk to them to figure out if they can perhaps cover part of the cost, so you can help make the conference an even bigger success. If anything is unclear in the speaker package information, get in touch with the conference to clarify before submitting. And if it doesn't meet your requirements, simply don't submit.


On submitting to CFPs

One of the first things you do if you want to speak is that you submit to a CFP (Call for Papers) of a conference. Most conferences use this system to get a nice selection of talks out of which to compile the schedule for a conference. The idea is that speakers tell the conference what they want to speak about and the conference can make the selection of speakers and topics for their conference.

Having been a conference organizer as well as a speaker, I've seen both sides of the CFP process. Because of that, I've made some decisions as a speaker on how I handle CFPs. Since I've discussed this with several people in the past year but it keeps coming up, I've decided to document one of my decisions here.

Overlap

Today I tweeted:

#firstworldproblems #speakerproblems call for papers closing before other conferences in same period have announced their speakers

To give this some context: I was looking at the currently open CFPs (thanks to the awesome CFP Report newsletter) and noticed that the CFP for PHP[world] is closing today. Now, I submitted some talks to ZendCon, which is in the same period, and I can't really handle two North-American conferences in such a short time period so I need to make a choice. However, ZendCon has not sent out acceptance/rejection e-mails, so I don't know if I get accepted there yet.

Andreas Heigl responded with:

@skoop apply and then see what happens. First one calling wins ;)

This is actually what I used to do, and I know other people do this as well. And from the speaker perspective, this makes sense. Having been on the other side, however, I've decided not to do this anymore. Let me explain...

The CFP process

Most conferences get hundreds of proposals, where they have between 5 and 25 slots to fill, depending on how big the conference is. You may already notice the problem: You'll have to make a very small selection out of a big pile of proposals.

My experience with a CFP is that it is usually pretty easy to discard the first 10% of the proposals. They are one or more of the following:

  • Unclear
  • Not appropriate for the theme of the conference
  • A single talk for an international speaker (too expensive for most conferences)
  • Just plain bad

I must admit that the last reason is actually becoming more rare. Speakers are putting much more effort into their proposals and talks than they used to, but it sometimes still happens.

The biggest problem with this is: After removing 10% off the big pile, you still have a pretty big pile of appropriate, high-quality talks left. You'll have another 70-80% of the talks to reject.

The process of going through all these talks is hard. It usually involves a lot of reading, research, trying to find a balance in the offered subjects, deciding on how many international speakers you can afford to fly in and trying to find the right talks to accept for those international speakers (international speakers usually need at least two talks to be accepted to make it financially viable to invite them).

I've been involved in the CFP team for a lot of conferences. This whole process is usually a team effort of between 2 and 20 people. Imagine the amount of time that goes into creating a balanced schedule out of the CFP. Hours and hours of work.

Now, imagine what happens when you finally send out the acceptance e-mails, and one or maybe even two or three speakers respond with "sorry, I can't make it".

That response means (part of) the above process begins again. I know it happens, but it is not a nice experience as a conference organizer. So...

My personal rule

As a result of the above, I've set a personal rule only to submit to the CFP of a conference when I know for sure I can make it (emergencies and such are the exception to that rule of course). It seems only fair to conference organizers that I can make this guarantee when I submit to their conference.

Now what?

I'm not saying all speakers should adhere to this rule, but I hope this blogpost will give a better perspective to new and existing speakers about "The Other Side" of the CFP.


Command or Controller

A couple of weeks ago while walking towards lunch with Jelrik we were having a bit of a discussion about the use of the term Command. Not long before that, Jelrik had asked a question about naming of Commands in our Slack channel, which led to some confusion.

The confusion of the term Command

The confusion of the term Command in the Symfony context is not strange. Jelrik was talking about a Command class, and since we're working with Symfony, both me and other colleagues assumed Jelrik was talking about console commands. Funny enough, he wasn't.

We're also using an implementation of command bus in our project, and Jelrik was actually talking about that instead of Symfony console commands.

What is a command?

This triggered a conversation about the confusion and how this can be avoided, which led to the question of what a Symfony console command actually is. The answer seems to be quite easy:

A controller for commandline requests

If we start thinking about console commands in this way, the next question is easy:

Why call it a command?

If a console command is actually a controller, why do we still call it a command. The main answer to this question would be:

My GreetBundle\Command\GreetCommand is automatically recognized up by Symfony

Of course, this is extremely convenient, but on the other hand we're perhaps breaking with our best practices and application design. When I do code reviews for customers, I often find a pretty good design for the "real" controllers, but the console commands are sometimes 100's of lines long and completely ignore best practices. Somehow the fact that they are executed on the commandline instead of through a webserver means one can quickly hack together a script.

Let's call it how it is

So here's a little proposal for you: Let's name our console commands for what they are: Controllers. Perhaps then we'll actually offload the business logic to services, and keep our commands controllers clean. While this does mean we'll have to manually register our commands, it creates a much clearer overview of what our code is doing.

Let's go for an example

And what better example than Hello World? ;)

So I've created a new Symfony application, and created my fantastic new IngewikkeldHelloWorldBundle inside that application. The bundle has the default directory structure:

  /Controller
    /DefaultController.php
  /Resource
    /config
      /routing.yml
      /services.yml
    /views
      /Default
        /index.html.twig
  /IngewikkeldHelloWorldBundle.php

This basic setup gives me a nice web-based Hello World, but I also want a nice console Hello World. Instead of creating a Command-directory with a new Command class in it, I just create a new Controller:

<?php

namespace IngewikkeldHelloWorldBundle\Controller;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class GreetController extends Command
{
    protected function configure()
    {
        $this
            ->setName('demo:greet')
            ->setDescription('Greet someone')
            ->addArgument(
                'name',
                InputArgument::OPTIONAL,
                'Who do you want to greet?'
            )
            ->addOption(
                'yell',
                null,
                InputOption::VALUE_NONE,
                'If set, the task will yell in uppercase letters'
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $name = $input->getArgument('name');
        if ($name) {
            $text = 'Hello '.$name;
        } else {
            $text = 'Hello';
        }

        if ($input->getOption('yell')) {
            $text = strtoupper($text);
        }

        $output->writeln($text);
    }
}

To get this Controller to be picked up by Symfony, I register it as a service:

services:
    ingewikkeld.greetcontroller:
        class: IngewikkeldHelloWorldBundle\Controller\GreetController
        tags:
            -  { name: console.command }

The tag here is the magic key to recognition as a console command. It's not that hard, is it?

Avoid confusion, improve your code

The more I've been thinking about this approach, to more I'm starting to like it. Optionally, we could make a subnamespace inside Controller to communicate the purpose even more. Something like:

\IngewikkeldHelloWorldBundle\Controller\Cli\GreetController \IngewikkeldHelloWorldBundle\Controller\Web\DefaultController

For bundles with a lot of different logic, this could make working with the difference between CLI and web controllers a bit easier. The main idea to call it a controller stays the same though. It makes sense, doesn't it?