Categories
Programming WordPress

Potential Tech Conference Talks

I am constantly thinking of new potential talks that I would want to either give or convince others to give. Some of these have been on my list for almost a decade, while others are relatively recent ideas.

Roles on a web team

There is a big difference between roles, jobs, and titles. I cosider a role to be the atomic unit and they bunch up into a job. So for example, a role is “Writer of CSS” and that might be a part of the “Front end developer” job. It also might be a part of the “Designer” job. I want to look at all the roles that need to be filled (I think there are somewhere around 100-200) in order to build, launch, and maintain a website and how successful teams are able to define jobs.

Improv for Web Developers

It’s been a long time since I did improv, but many of the things I learned from it are foundational things I use every day. This could be participatory; this could be a disaster. Just like an improv scene.

This is likely closer to a lightening talk than a full talk.

Axioms for the Web

Axioms are ideas we use to start our reasoning that are so fundamentally true, we use them to define what is true. They come from a Greek term that roughly translates to ‘that which commends itself as evident.’ They are phrases as simple as: A + B = B + A. One look at this phrase and we understand the truth within it.

I want to expand on a lightening talk I did a few years ago to look at what things are so fundamentally true for websites that they define what is true.

DUX – Developer User Experience

What is the experience of contributing to and using your code base like and how can we use lessons from user experience design to influence ways in which we improve it?

Interviewing developers

I’ve refined my interview questions over the last decade and think it could be interesting to share these questions, perhaps even doing a mock interview on stage. I might even talk about questions I used to use and why I don’t use them any more.

Foundations of HTTP

A look at the http standard, how it has evolved to http/2, how it is evolving to http/3 and the foundational concepts of http verbs and status codes that are incredibly relevant to all web developers.


Get in touch if you would like for me to give one of these at an event you are organizing. None of these are fully flushed out so they will take some time, but I think there would be interest in all of them.

Categories
WordPress

Random Thoughts on… Keynotes and WordCamps

Dave Bisset shared some of his thoughts in response to my random thoughts on travel and WordCamps post. One paragraph stood out to me:

Some organizers associate keynotes with “headline speakers”. I personally don’t like keynotes as a speaker organizer and in 12+ years with WordCamp Miami I only did two official planned ones. I’ve too often seen events have a single keynote that is often executed poorly – where it’s seen to put a spotlight on a local or national speaker that was meant to be used as a “see… see… our conference has someone important!”. You can tell this because their subject material didn’t apply to the majority of the audience – they were just there because they were a “big name”. I’m not saying keynotes are bad, but i’ve walked out of more awkward keynotes at WordCamps that I have feel good ones.

I’ve given three WordCamp keynotes and have also organized camps with and without keynotes. In that time, I’ve developed a handful of random thoughts on the topic.

  • Not every WordCamp needs a keynote. It’s far from a requirement.
  • When it is decided to have a keynote, I think it’s best to come in one of three flavors:
    • If you are a new camp and want to bring in someone who can really help build up your community.
    • If you have someone in your local community who should be given a chance to give “One Big Message”, a message that everyone should hear. The best one of these I have seen is Tracy Levesque at WordCamp Philly. Boone Gorges also gave a fantastic one at WordCamp NYC.
    • If you can bring someone from outside that wouldn’t normally be a part of the WordPress community who has an interesting thing to share. WordCamp Lancaster 2017 had a local computer science professor.
  • Keynotes should leave the audience asking questions of themselves, and this should be for just about everyone in the audience.
    • My WordCamp Baltimore Keynote from 2013 “Citizenship in the Open Source World” aimed to ask what does it mean to be a part of Open Source.
    • My WordCamp Philly 2015 Keynote “Why WordPress Works This Way” aimed to get the audience to question what philosophies they wanted to use in their decision making
    • My WordCamp St. Louis 2016 keynote was somewhat last minute, so I based it on my 2015 WordCamp Philly one. Though this time it was more based on “We can learn from something without emulating it exactly” and asked “What can we learn from WordPress?”
  • A poorly executed keynote makes a sizable portion of the audience question why they were there.
  • Keynotes are opportunities for “Big Messages”, not minutia. It’s not a time for “How”, it’s a time for “What”.
  • You should never take questions at the end of a Keynote. If you are giving one, it’s your stage and your message. The hallway is the right place for the conversation to continue.
  • Opening/Closing/Mid day keynotes all are ok.
  • I would rather no keynote than a bad keynote.
  • I would rather no keynote than an ok keynote.
  • A “regular talk” should not become a keynote simply because they are the biggest ”name” attending. Great keynotes and Great instructional talks are different
    • You still want to be careful with your scheduling. Don’t put another developer talk at the same time as Andrew Nacin preparing an “Advanced Topics in WordPress Development” talk.
  • It’s ok to save a good talk idea for when you are going to keynote. Or let organizers know in your application that you only want a specific topic considered if it would be a keynote.

Comments and ping backs are open: What are your thoughts on keynotes and WordCamps?

Categories
Random Opinions WordPress

Random Thoughts on… Travel and WordCamps

While looking at the list of WordCamps that I’ve spoken at, it got me thinking about travel and going to WordCamps away from home. Here are some random thoughts on that matter.

  • In General, I think it’s best for local camps (i.e. not specialized events like WordCamp for Publishers or regional camps like WordCamp US) to be majority local.
  • Defining local is hard. Am I local to Montclair? It’s less than an hour for me to get there via train. If yes, does that also mean I am local to Philly? I would say I’m not really local to either of them even though they are all NYC Suburbs.
  • I like to think of things as being in kind of four different classifications:
    • Very Local. This is the place you live or the place you work.
    • Day trippable. These are the places where it’s super realistic to wake up one morning and decide “I’m going to visit X today”. It’s generally things in like a 2 hour not flying radius.
    • Hard Day Trips. These are the places that it is possible to do a not flying day trip to, but it’s not going to be the easiest trip. If flight times work, a flying day trip is completely doable.
    • Overnight trip required. There is no way around, this is real travel
  • For the past few years, I’ve limited myself to speaking in the first 3 categories. Partially to take it easy on travel, and partially since I took 2018 off from speaking entirely.
  • It’s important for people who can be considered “Names” to make space for the next group of contributors and this includes not speaking all the time.
    • Sidenote: I was chatting with another core committer recently and we noted “We are not the future of WordPress”. I don’t intend to go anywhere, but I also recognize that my strength for the project today isn’t to be the loudest voice.
  • I’m not at all convinced that “Names” sell tickets for local WordCamps. I am convinced that developing and nurturing a quality community sells tickets to WordCamps.
  • It’s important to visit other communities to meet people, but that doesn’t mean I need to speak. One of my favorite camps was WordCamp Seattle 2014 as I got to meet a number of people and see some old friends that it had been years since we spent time in person.
  • My first ever camp that I went to with no connection to the local community was super important to my growth as it allowed me to meet a lot of folks, many who became long time friends. WordCamp Phoenix 2011 was a special event.

Overall, I think going forward I’m going to try to travel a bit more, while staying firmly in my local and near local communities.

What are your thoughts on WordCamps and travel? How do you approach your decisions on when to fly to a different city for a camp?

Categories
Code Programming WordPress

__DIR__ vs dirname( __FILE__ )

Calling a constant should always be faster than a function call, right? PHP contains two different ways to get the directory that a file is currently in. __DIR__ is a magic constant added to PHP in 5.3. The official PHP documentation specifically states: “This is equivalent to dirname(__FILE__).” Equivalent in return doesn’t necessarily mean equivalent in performance though, so I decided to test the performance of both accross a couple of variables.

Testing Methodology

When running lots of tests, I’ve found that travis-ci can be a big helper. You can define the matrix of the tests you want to run as your testing matrix and then use the results. So I setup a repo for my tests. The repo contains four main pieces:

  1. A file generator which creates the code I’ll actually run the performance test on.
  2. A test running script which runs the actual tests.
  3. The travis.yml file to define my tests matrix
  4. Files used for the actual test. This is not linked, there are 400,000 files. The generator shows them off.

My test calls the function I am looking for 100,000 each. One run has all the files in 1 directory, and the other has one file per directory. I wanted to rule out the possibility that a single directory could affect this call.

I ran this test on six version of PHP: 5.6.40, 7.0.33, 7.1.27, 7.2.15, 7.3.9 and 7.4-dev. Each test did 650 runs and I looked at the user time for each of those runs. This means that I called both __dir__ and dirname( __file__ ) 130,000,000 times each. I then took the times for each of these runs and looked at that maximum (slowest) run for each and the 95% time ( the average between the 618th and 619th slowest) to rule out any extreme cases. Overall, the results between maximum and 95% are similar.

User is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is only actual CPU time used in executing the process. Other processes and time the process spends blocked do not count towards this figure.

Stack Overflow

__DIR__ vs dirname( __FILE__) Test Results

95% performance

Script5.67.07.17.27.37.4
dir ( 1 folder)1.42.762.082.512.271.3615
dir ( many folders)1.382.292.552.36152.651.57
dirname( 1 folder)1.58152.272.74153.242.411.5215
dirname( many folders)1.682.292.08153.292.68151.87

Overall, the results show that __dir__ is generally faster, but it’s rarely much faster. Consider that in the slowest run ( using PHP 7.2 and calling dirname( __FILE__ ) on multiple folders), each call took 0.0000329 seconds. The fastest run was 2 hundred-thousandths of a second faster. This is such a micro optimization that except under extreme scale, it’s unlikely you will ever notice a difference. That said, under most versions of PHP, __DIR__ is faster.

So: __dir__ or dirname?

At the end of the day, the performance of __DIR__ is ever so slightly better, but more importantly I think it’s clearer and easier to read. So I’m on team __dir__, but the performance is only a bonus.

If you have a different thought, or think that my testing methodology could be improved, please let me know in the comments below.

Categories
WordPress

This might be the first post ever published on WordPress using PHP7.4.

I have every reason to believe that this is the first post ever published on WordPress using PHP7.4. It’s likely coming a bit premature, but if you aren’t willing to have some fun, then why maintain upstream language compatibility of an open source project. I’ve worked on php version support in WordPress since PHP7.0 and made the first post using WordPress on php7.3, so this is becoming a fun tradition.

Yesterday I added code to WordPress core to fix a number of deprecations in PHP7.4. PHP7.4 is scheduled to be released on November 28, which is 74 days and 5 release candidates away. The goal for WordPress is that version 5.3 will fully support PHP7.4 and that version is scheduled to be released 12 November 2019.

The biggest deprecations in 7.4 that affect WordPress core are around magic quotes and

For plugin and theme authors, you’ll want to look into:

PHP7.4 features for WordPress Developers

It’s not just deprecations in PHP7.4 that WordPress developers can look forward to, but the PHP internals team has added some new features for us to use as well.

Typed Properties continue the evolution of PHP’s type system to allow for class properties to be type strict. The only Property types you can’t use are void and callable, otherwise every type decleration is supported.

Arrow Functions allow for simpler anonymous functions. I recommend only using these in callbacks such as with array_map in order to make your debugging simpler.

Coalescing Assignment is here as syntactical sugar. ??= allows for you to add default values easier.

If you see any errors or notices on this site, let me know in the comments. Assuming this actually publishes, then WordPress can be used with PHP7.4, but I only recommend it for those feeling especially adventurous.

Categories
Art Programming WordPress

Art and Commit Messages: Volume 2

Last year I published volume 1 of Art And Commit messages and sold nearly 50 copies! For my first zine, I was ecstatic that so many people were willing to spend $3 on something so unknown. I have already started thinking about Volume 2 and think that it will be a great thing to publish at WordCamp US. I’m also thinking it might make sense to include some different things this time.

Art by more Artists

Volume 1 featured my art, for Volume 2 I would like to feature the art by more artists. I am also thinking of budgeting a small amount so that artists are compensated, but as Volume 1 didn’t make any money I think this is going to be a low amount. Maybe $50 for each piece.

Are you interested in having your artwork featured in Art and Commit Messages? Let me know:

Essays by More Writers

Along the same lines, I want to feature a couple of essays about commit messages from a variety of people. What kind of essays would you like to see in volume 2?

Finally, I want to figure out some sort of game to include. Maybe I loved reading Highlights for Children too much as a kid, but I think a game would be fun.

Art and Commit Messages: Strange Bedfellows

Art and Commit Messages might feel like an odd combination but the best of both are snapshots that convey an intent. Art transposes the emotion of the creator to an audience. It can transport you into the brain of the artist. The best commit messages similarly transport you into the brain of the creator. They share the coders intent.

That’s the message from the cover of volume 1. I absolutely recognize the odd combination, but they are two things that I care about and I hope that by combining these two strange bedfellows I can encourage people to write better commit messages.

Overall, my goal remains to encourage high quality commit messages through education, entertainment, and an understanding of history. I’m not looking to make money, if I was I wouldn’t be making a zine.

Do you have other ideas for making Art and Commit Messages better? Leave a comment or get it touch and let me know!

Categories
mostly pointless. WordPress

An adventure with a super useless one-liner to find the most common words in WordPress commit messages

I read some insight into Drupal committing and they had a chart of the most common words in drupal commit messages. I thought it would be interesting to do something like that with WordPress Core, so I through together a bash one-liner to find this. It’s not the most eloquent solution, but it answers the question that I had. Here is what I initially came up with.

svn log http://develop.svn.wordpress.org/trunk -rHEAD:1 -v --xml | xq '.log.logentry | .[].msg' | sed 's/.$//' | sed 's/^.//' | sed 's/\\n/ /g' |  tr ' \t' '\n' | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -nr | head -n 25

Let’s walk through this since there is enough piping going on, that it may not be the easiest to follow.

svn log http://develop.svn.wordpress.org/trunk -rHEAD:1 -v --xml

I start by getting an xml version of the SVN history, starting at the first changeset and going until the current head.

xq '.log.logentry | .[].msg'

Next, I use xq which takes xml and allows me to run jq commands on it. It’s a handy tool if you ever need to use xml data on the command line. In this case, I am taking what is inside <log><logentry> and then for each sub element, extracting the msg. At this point, the messages are on a single line wrapped in quotation marks with \n to signify newlines. So I run three seds to fix that up.

 sed 's/.$//' | sed 's/^.//' | sed 's/\\n/ /g'

I’m sure there is a better way to do this, but the first one removes the last character, the next one removes the first character, and the last one converts new lines to spaces. Since words are what we are aiming to look at, we need to get all the words onto their own lines.

 tr ' \t' '\n'

tr is a powerful program for doing transforms of text. In this case, I am taking whitespace and turning it into actual newlines (rather than just the new line charachters). There is likely a more elegant way to have solved this, but my goal isn’t the best solution it’s the working one.

tr '[:upper:]' '[:lower:]'

Word and word are not equal, so we need to make everything a single case. In this case, I am again using tr, but now I am transforming upper case characters to lowercase.

sort | uniq -c | sort -nr | head -n 25

Counting things on the command line is something I have done so many times, I have an alias for a version of this. Sort puts everything in alphabetical order, uniq -c then counts how many uniq values there are and outputs it along with how many of each it counted. uniq requires things common things to be in adjacent lines, hence the initial sort. Next up, we want to sort based on the number and we want high numbers first. Finally, we output the top 25.

 28997 the
 27463 
 20429 fixes
 17844 to
 17818 props
 15251 for
 15189 in
 14441 see
 10856 and
 10272 a
 7549 of
 5594 is
 5227 when
 5133 add
 4444 from
 4143 fix
 3847 *
 3821 on
 3489 use
 3320 that
 3267 this
 3064 with
 3043 remove
 2983 be
 2766 as 

That’s not super helpful. The isn’t my idea of interesting. So I guess I need to remove useless words. Since I have groff on this machine, I can use that and fgrep

 fgrep -v -w -f /usr/share/groff/1.19.2/eign

I also noticed that the second most common word is whitespace. Remember when we used to put two spaces between sentences? WordPress Core commit messages remember. So let’s add another sed command to the chain:

sed '/^$/d'

And now the final command to see the 25 most used words in WordPress Core Commit messages:

svn log http://develop.svn.wordpress.org/trunk -rHEAD:1 -v --xml | xq '.log.logentry | .[].msg' | sed 's/.$//' | sed 's/^.//' | sed 's/\\n/ /g' | tr '[:upper:]' '[:lower:]' | tr ' \t' '\n' | fgrep -v -w -f /usr/share/groff/1.19.2/eign | sed '/^$/d' | sort | uniq -c | sort -nr | head -n 25

And since you’ve made it this far, here is the list

 20429 fixes
 17818 props
 15189 in
 5594 is
 5133 add
 4143 fix
 3847 *
 3320 that
 3267 this
 3064 with
 3043 remove
 2766 as
 2435 an
 2432 it
 2109 post
 2103 if
 2080 are
 1889 don't
 1793 update
 1735 -
 1688 twenty
 1523 more
 1500 make
 1471 docs:
 1416 some 

Have an idea for another way to do this with the command line? I would love to hear it.

Categories
WordPress

Mobile Block editor – Initial Thoughts

I’m writing this using a beta version of the WordPress iOS mobile app that integrates Gutenberg. It is fairly stripped down as far as blpacks go.

While this site has blocks from multiple plugins (including Gutenberg so I can try the latest features), the app has much fewer options.

Blocks available from the mobile app

I was definitely surprised to not see all the core blocks, especially not to see my reusable blocks that I have saved to the site.

Another thing that surprised me as a power user is that slash commands for new blocks don’t work.

I also can’t figure out how to access the block inspector to save options on differnet blocks.

Opening up posts with blocks in them other than this initial set shows those blocks as “unavailable”. This includes all the embed blocks.

Unsupported is the new black

The responsiveness of the editor is amazing, and the ability to move blocks up and down makes editing inside the mobile app much easier.

Overall, as a version 1, I like it. I also think that it has long way to go before I will abandon opening a mobile browser for the majority of my on the go blogging.

Categories
WordPress

To Viper

My first interactions with Alex were in the #wordpress IRC channel, likely him helping me with some code. Over the coarse of a couple of months, we joked around and chatted code. At some point the mention of his username prompted the question of if he had a Viper, but I found out he didn’t even have a driver’s license! I didn’t even realize that this person I was becoming friends with lived in my city, but when I mentioned WordCamp Portland I found out I would actually get to meet him in person. Alex became the first person I met through WordPress chats that I got to meet in person.

At WordCamp Portland 2009, Alex led an unconference session on Advanced WordPress development. I think that Matt Mullenweg might have been the one who put Alex’s name on board and pushed him to lead the discussion. It was during this session that I was first introduced to the idea of custom post types. This event was one of the most important events on my journey to were I am today, and Alex leading a discussion was a part of it.

The following year at WordCamp Portland 2010, I gave the final session of the second day. The room was half empty at this point, but Alex had stuck around to support me. Unfortunately, Alex might have been more exhausted than he had let on as I remember looking at him at one point and seeing him asleep. For a couple years, I encouraged him to give a talk at a WordCamp so I could fall asleep in it.

In 2011 at WordCamp San Francisco a small group of us headed out in search of dinner. This is when I found out that Alex was the opposite of an adventurous eater. We discussed multiple places before heading to some chain restaurant that had cheese pizza and I got to enjoy one of Alex’s favorite dishes, but more importantly I got to enjoy a meal with him.

Alex and I continued our conversations for years. We never were close friends, but we always remained friends. After his initial diagnoses with Leukemia, I wrote some unit tests with Alex in mind. Alex’s contributions to WordPress were numerous, and his contributions to my life are unforgettable. Whenever I see a Viper, I’ll forever think of a man who was obsessed with cars but didn’t get his license until his mid twenties. Tonight I raise my glass to Alex, Viper007Bond, Mills.

Categories
Art Code Four Short Things WordPress

Four Short Things – 23 February 2019

Inspired by O’reilly’s Four Short Links, here are some of the things I’ve seen, read, or watched recently.

Leukemia has won

WordPress has allowed me the opportunity to meet hundreds of people first online and then offline, but Alex “Viper007Bond” was the first. When I first started getting involved in WordPress, I spent many late nights in the IRC #wordpress channel on freenode, at first seeking help but then providing it. Viper was commonly there helping others and likely answered more than a few questions of mine as well. He’s been publicly battling leukemia for 2.5 years. His blog is a great tale of the ups and downs of cancer. Alex and those that care about him are in my thoughts right now.

Kevin Beasley: A view of a Landscape

On view at the Whitney until 10 March, this exhibit on the top floor is one encompassing sound and visuals. Featuring the motor from a cotton gin and giant sculptures with Cotton, it explores race, history and the evolution of America.

Writing CSS Algorithms

Lara has done more to change my opinions on CSS than anyone else. This post is a companion piece to a talk she gave at WordCamp US and one that everyone web developer should read.

Pento hits 1000 Commits

13 people have made over 1000 commits to WordPress core over the past nearly 16 years. Gary Pendergast joined the club during the 5.1 release. Overall, there have been 44767 commits so Gary’s count only represents 2.2% of the total activity.

Four Short Things is a series where I post a small collection of links to art, news, articles, videos and other things that are me. Follow my RSS feed to see Four Short Things whenver it comes out.