Become a Better Software Developer

Blossom into your full potential with this free 4-piece weekly email series. Learn the proven path to becoming a developer that others love working with, want to keep around, and aspire to become.

Your data is safe.

Working Remote, Away from Home

When “working remote” means “working from home,” we deprive ourselves of life’s rich texture. Most people weren’t made to do the bulk of their computer-based jobs in the same building that they sleep in. A daily commute is a mandatory ritual for most of us to retain our sanity and to experience the harmony and fullness of life. I’m not a fan of celebrating the number of miles saved by working in our houses. Just because we don’t have to travel somewhere to do our work doesn’t mean we shouldn’t.

It’s great that more jobs are going from in-office to remote. It’s not great when we decide that this means we will work from our houses 5 days per week. I’m saying this as someone who did exactly that for years. I’m now working out of a coworking space, and I’m never going back.

Having spent the better part of this year with a 25-minute drive separating my pillow and my desk, here’s a list of things I’ve learned in retrospect:

  • Before, I was experiencing a common melancholy in my home office that resulted from working in isolation. I was starting to ask myself questions like, “Is any of this real?” People who work around others are immune to this. As someone told me a couple months ago, software developers are usually introverts; introverts need to be forced out of their hermit comfort zone, and working from home does the opposite. It compounds the problem.1
  • The boundaries of work and domestic life were blurred and under-regulated. There was never an official, consistent time I started and ended my work each day.
  • Similarly, it was difficult to keep my sleep schedule consistent year-round. Ritual and routine are very important. Almost all high-functioning people have lots of this in their lives.
  • I had convinced myself that because I had fewer human-factor distractions, I was able to get more focused work done. I’ve since learned that this was offset by my freedom to go down useless rabbit trails. It resulted in a zero-sum game. Getting held up in the break room for 5-10 minutes will save you 45 minutes of programming when you get back to your desk. It’s worth having healthy doses of human distractions. Especially if a big part of your job is problem-solving and creative thinking.
  • I’d formed my outlook on working from home by influential thought leaders such as Mullenweg and DHH. But there’s a difference in experience between leaders who work from home and their helpers. Leaders travel a lot, and they talk a lot. They have positive feelings about working from home, because they experience it from a leadership’s lifestyle. Just because Mullenweg and DHH think working from home is great for them doesn’t mean it’s great for you or me.
  • I thought I had more free time since I didn’t have a commute. But I was also upset that I still couldn’t find discretionary reading time. The commute solved this frustration, thanks to a monthly Audible subscription. I’m now using the commute to learn about new things. I’ve listened to more high-quality books this year than I’ve read in any post-college year. I’ve learned to embrace the commute. It’s helping me implement better habits. And it’s allowing me to let go of my day’s work before coming home to my family. There’s nothing wasted about that drive. I need it.

Granted, I could force myself to begin my workday around 8 or 9 if I worked from home. I could force myself to minimize distraction and be done (really, actually done) by 5 or 6. I could force myself to spend an hour per day reading a good book. But who does that?

You want a system in place that brings the lifestyle you’re after with the least amount of effort (not because you’re lazy, but because you want to save your effort for other things). You achieve a healthier, fuller lifestyle with less effort by introducing a commute.

If you have a remote job, be thankful for it. Remote is great! Now convert your home office into a guest bedroom, and find a coworking space.


  1. The gentleman who told me this commutes voluntarily from Atlanta, Georgia to work in physical proximity to his constituents. He could work from home if he wished, but he puts a high dollar value on not doing so. ↩︎

Steven Hackett’s 2018 Macbook Pro Keyboard Is Already Having Problems  

I bought my 2018 MacBook Pro the first day it was available in retail stores — July 13. My keyboard is working great five weeks later.1 But not Steven’s. In just 23 days he’s having issues. As his URL states, “not great, Tim.”


  1. Including a lot of lunches that have been in uncomfortably close proximity. ↩︎

Too Bigly

In many activities of life, we try to make things too bigly. Here are some examples.

  • Beginner runners have strides that are too wide. Shorter strides enable better breathing and less muscle strain.
  • Beginner cyclists have cadences that are too slow. It’s easier to climb a hill with lots of smaller pedal strokes.
  • Beginner house painters make brush strokes go too far. Dipping a brush more often makes the brush last longer and yields better coats.
  • Beginner dieticians eat two large meals per day instead of continuous smaller meals. Smaller meals do a better job with metabolism.
  • Beginner investors invest too much in a few stocks, instead of investing a little bit in a lot of stocks. Aggregate investing is safer and smarter.
  • Beginner software developers put too much code in functions. Smaller functions make code easier to understand.
  • Beginner writers put too many words and ideas in sentences. Shorter sentences are easier to read.

You can probably add several more examples from your experience.

Jack Dorsey on the Sean Hannity Show  

I don’t know normally listen to Talk Radio but this is worth a listen. Taking a purist stance on the First Amendment is something I can connect with, and both Hannity and Dorsey lean in this direction.

How to Create a Bulk Filter in Gmail for a List of Email Addresses

Let’s say you’re on an email thread that you no longer want to be on, but you’re too nice to communicate that. You just don’t want to get any emails from that group any more. Thanks to Gmail filters, there’s a way you can programmatically achieve this without a bunch of repetitious elbow grease.1 First, create a JavaScript file and open VSCode:

cd ~/Desktop
touch file.js
code file.js

Next, get your list of email addresses from which you no longer wish to receive, and format them in a way that JavaScript can understand. Using some simple search and replace in your text editor, it shouldn’t be too hard. The goal is for you to get it in an array format:

const addresses = ["Example User 1 <[email protected]>", "Example User 1 <[email protected]>"];

Next, put this into your newly created file.js, with that formatted version at the top:

const addresses = ["Example User 1 <[email protected]>", "Example User 1 <[email protected]>"];

let startTime = new Date().getTime();
const filters = addresses.map(address => {
  const start = address.indexOf('<') + 1;

  return {
    time: startTime++,
    email: address.substr(start, address.length - start - 1)
  }
});

const template = `<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:${ filters.map( el => el.time ).join(',') }</id>
<updated>2018-08-04T14:41:59Z</updated>
<author>
  <name>[Your name]</name>
  <email>[Your email]</email>
</author>
${ filters.reduce((acc, el) => `${acc}
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:${el.time}</id>
<updated>2018-08-04T14:41:59Z</updated>
<content></content>
<apps:property name='from' value='${el.email}'/>
<apps:property name='shouldTrash' value='true'/>
<apps:property name='sizeOperator' value='s_sl'/>
<apps:property name='sizeUnit' value='s_smb'/>
</entry>`, '') }
</feed>`;

template;

Replace the [Your name] and the [Your email] with your name and email address.

Now copy the contents of this file to your clipboard:

pbcopy < file.js

Then head over to Chrome, pop open the JavaScript console, and paste your clipboard. Copy the string output stored in the template variable, and paste it into a new file:

pbpaste > import.xml 

Now go into Gmail > Settings > Filters and Blocked Addresses, scroll to the bottom, and select “Import filters.” Choose import.xml. Complete the steps, and you’re done.

I just did this successfully with a list of 75 email addresses and it felt amazing.


  1. Gmail’s interface allows you to create filters directly, but there’s a severe character limit when you’re assembling the filter. If you have a list of more than a few email addresses that you’re wishing to filter, you’re out of luck. That’s where this tutorial comes in. ↩︎

Google’s Blatantly Misleading Chromebook Ad  

Since macOS Yosemite debuted in fall 2014, buttons on dialogs haven’t been as skeumorphic as the overwhelming majority of them are in this ad. Google had to stitch together an antequiated collection of imagery in order to depict a false narrative. It’s a farce to pretend that a regular part of using macOS includes these dialogs. They’re infrequent, and when they appear, they’re important. Moreover, for those who don’t need a full-blown desktop operating system — which I unequivocally do need — there’s nothing you can do on a Chromebook that you can’t do on an iPad, with a vastly superior user experience. This ad is garbage.

Will Apple Let You Swap Your Recently-Bought 2017 MacBook Pro for a 2018 One?  

Ben Lovejoy, writing for 9to5Mac:

Apple Store staff tell us that they have fairly broad discretion to do what they believe to be the right thing for the customer. When they want to swap out a machine that is just a little way outside the 14-day window, we’re told that managers tend to ok it.

This past week, I took advantage of the 14-day “no questions asked” policy, but I have two anecdotal stories to show how much discretion Apple Store staff has in addition to that.

On September 4, 2015, I bought a baseline 13” retina MacBook Pro, to replace a 3-year-old machine. Then the following month I started a new job that required a more powerful machine. I took my MBP to the Apple Store on October 8 — more than 30 days after my purchase — and received a full store credit to go towards a retina 15” model. “We just want you to have the computer you need to do your job,” the staff told me.

Then on February 4, 2018, I went to the Apple Store with a Magic Keyboard whose space bar had quit working reliably. I’d purchased it on December 1, 2015. The genius looked at it, went to the shelf, found a matching keyboard, took the plastic off the box, removed the keyboard, and handed it to me at no charge. Again, the explanation was the same — “I just want you to be able to get back to work.” There was no receipt involved. I simply walked in with a broken keyboard and walked out with a new working one.

Apple charges a premium for its products but the service you get with those products is remarkable.

True Tone on External Displays  

Apple:

The True Tone technology in MacBook Pro (2018) uses advanced multichannel sensors to adjust the color and intensity of your display and Touch Bar to match the ambient light so that images appear more natural.

Then the good part:

True Tone can also adjust these external displays when they’re connected to your MacBook Pro:

I can confirm that this is working as advertised on the new 2018 MacBook Pro and the discontinued Apple Thunderbolt Display. Toggling “True Tone” in System Preferences makes a noticeable difference on both the laptop screen and the external display. Heretofore I had been under the impression that the screen itself had to have additional properties in it to support True Tone. Turns out this isn’t the case. The days of needing to use Night Mode are officially gone.

If you’re using an external display and you’re using something other than one of these three, it’s time to get one of these three. They’re the only three external monitors worth having.1


  1. Along with a black keyboard with no numeric pad, I’m waiting for Apple to come out with its own external 5K monitor. Who wants to have to look at that “LG” logo all day, anyway? Gross. I did that with Dell for 4 months and I’m never doing it again. ↩︎

Joël Perras on Boolean Expressions  

I have a lot of respect for Joël, and wholeheartedly agree that flipping inequalities to remove a negation is a win and that boolean expressions that can be simplified should be simplified (the latter two points of his piece). With that said, I quibble with how helpful it is to reduce the number of negated expressions. Joël offers this example, whilst recommending the version on the left side:

not (a and b) == (not a or not b)

When we talk about the readability of the code, one gut check is to see how easy it is to audibly explain the algorithm to someone else. In everyday speak, if we’re trying to communicate the algorithm above, we’re going to use the version on the right. People are very comfortable communicating that way, even non-programmers talking about everyday decision making. It takes substantially more words to communicate the algorithm in terms of the left version, because first you have to create a mental variable of the result of the parentheses. Even as a developer, the left version is a mild brainteaser for me — it requires more cognitive overhead — whilst the right version is easier to grok.1


  1. My verdict notwithstanding, one caveat comes to mind. I’ve heard of situations, particularly in database queries, where ANDing something has proven substantially less expensive than ORing something. There’s definitely a time and place to flip these things around, but I wouldn’t do it for readability’s sake. In my mind it hurts readability. ↩︎

Apple Updates Its MacBook Pro Lineup, to the Chagrin of Those Who Already Bought a MacBook Pro Earlier This Week  

I’m typing this on a 15” 2017 MacBook Pro that I purchased this Monday. Tomorrow I’m taking it to the Apple Store for a full refund in exchange for the model that was introduced today. Life is stranger than fiction. It’s a black box trying to predict when Apple is going to upgrade its MacBook Pro lineup. I’d given up on seeing anything new coming out this year when WWDC came and went with no news on this front. And then, wham.

This lineup refresh took Apple employees as much by surprise. The specialist I spoke with on the phone today walked into work this morning and heard the news for the first time. The new laptops are available for order online today and they’re available for purchase at retail stores tomorrow.

Three Nifty, Elegant Tips in JavaScript

Let’s start with the first one.

Imagine that you have a user object and you want to print its name. Such a method might look like this:

const getName = (user) => {
  return `${user.firstName} ${user.lastName}`;
}

We frequently don’t know if both fields contain data, however. In some backwards systems, the first name might be empty and the last name might be a company name.1 To get around this, you might see some verbose logic such as this:

/**
 * Too much codez...
 */
const getName = (user) => {
  let output = '';
  if (user.firstName) {
    output = user.firstName;
  }
  if (user.lastName) {
    if (user.firstName) {
      output += ' ';
    }
    output = user.lastName;
  }

  return output;
}

A niftier way to handle this is to just assume that both fields do contain data and then trim any whitespace. The function below achieves the exact same thing as the one above, albeit more elegantly:

/**
 * Hire this guy!
 */
const getName = (user) => 
  `${user.firstName} ${user.lastName}`.trim();

Now for the second tip.

Let’s say you’re generating timestamps, such as:

  • 8:04 AM
  • 5:23 PM
  • etc

When you’re piecing this together from a JavaScript Date object, you use something like the Date.getMinutes() property. Often you’ll see code that looks something like this:

/**
 * Whaaa
 */
const getMinutes = (date) => {
  const minutes = date.getMinutes();
  let output = minutes;
  if (minutes < 10) {
      output = `0${output}`;
  }
  return output;
}

The code is trying to make sure that there are always two digits for the seconds. There’s a groovier way to do this though:

/**
 * Lit!
 */
const getMinutes(date) => 
  `0${date.getMinutes()}`.substr(-2);

Lastly the third tip.

Often you see code that looks something like this:

/**
 * We do this all the time, sigh
 */
if (user.location === 'Chicago' || 
  user.location === 'New York' ||
  user.location === 'San Francisco') {
  doTheThing();
}

Here’s a cleaner way:

/**
 * Array literals for the win
 */
if (['Chicago', 'New York', 'San Francisco']
  .indexOf(user.location) >= 0) {
  doTheThing();
}

These tips have use cases outside these particular examples and they can easily transfer to other programming languages.


  1. This sort of blasphemy occurs when you have a lazy database designer who, in their infinite wisdom, chooses to use a single cell-starved table for both personal accounts and business accounts. Such design is pure evil and ought never to be imagined. ↩︎

WP Engine Acquires StudioPress  

Brian Gardner:

It is my pleasure to announce WP Engine has acquired StudioPress.

Our future has never been brighter than it is today, and the road ahead of us is so much longer than the road behind. It’s a new journey that I cannot wait to continue with you.

Over the last eleven years, we have changed the WordPress landscape—from creating a commercial market to building the most popular theme framework. While we were able to do that as a bootstrapped company, the vision I have for StudioPress requires more.

If you’re using WordPress, you need a reason to not be using StudioPress and WP Engine. They’re the emergent winners. This acquisition wasn’t expected but I’m excited to see them come together. I’ve used both of these technologies for years and wish all parties involved the very best going forward.

Taking Risks  

Casey Liss, earlier this month:

This past Tuesday, I woke up as I would any other Tuesday. I got ready for work like any other Tuesday. I went to work, met with my boss, and spoke two words that will dramatically change my life.

“I’m resigning.”

[…]

In my life, I’ve never been one to take risks. However, when I do, I’ve always been rewarded, regardless of the eventual outcome. The well-traveled road brings less surprise, but is paved with the regret of poorly trodden forks not taken.

The well-traveled road is safe and pays well, but every entrepreneur eventually comes to regret it. I wish Casey the very best in his new chapter.

Say the Hard Thing  

Michael Lopp:

The majority of people-related disasters I’ve created originate with my choice to not say the hard thing. On my short list of critical leadership skills, the ability to “say the hard thing” is right after “delegate until it hurts.”

If you’ve ever worked on a team or ever plan to work on a team, this whole piece is mandatory reading. Michael’s experience and insight here are invaluable.

React Still More Popular Than Vue  

Great analysis by Kevin Ball, who shows that just because a repo has more stars than another doesn’t mean it’s actually more popular. See also the comments, where the validity of NPM installs as a metric is itself challenged. It definitely makes sense that React is still more popular than Vue. It is older and has had a longer chance to become mainstream. Five years from now though, we may be seeing a very different story. Time will tell who the real winner is.

Track Your Average Interval Pace With This Groovy UI  

For a while now I’ve been calculating my average interval running paces by hand. It’s been tedious, and today I needed an excuse to spend some quality time writing Vue. So I updated the little app that’s currently running at Distance.MartynChamberlin.com to include this feature. No more having to compute it all by hand. Here’s a screenshot of what it looks like for one of my recent runs on Strava.1 The UI needs some more refinement but it gets the job done for a 1.0 version.


  1. Admittedly this is a somewhat bizarre example because my lap distance turned out to be 2.00 miles rounded to the hundredth and the pace turned out to be 6:00/mi rounded to the second. What are the chances of deriving such perfect numbers if you tried? ↩︎

Vue Passes React in Popularity  

Dan Abramov, author of Redux, the de facto state manager for React:

Congratulations to @vuejs for surpassing React’s star count on GitHub! Seems like I almost captured a historical moment by accident.

The typical developer on the street thinks that the two winners for frontend web libraries are Angular and React. I’ve been stressing over and over again that there are actually three winners: Angular, React, and Vue. And that Vue, which is the newest of the three, took the best ideas from React and Angular and that it’s actually the best of the three. I’ve spent hundreds of hours in all of these frameworks — in the case of Angular and Vue, thousands of hours. I can say unequivocally that Vue has the lowest learning curve and simplest API, has significantly fewest gotchas, and enables the fastest development cycle, all the while sacrificing nothing in performance. And now I can finally say that in a mathematical, quantitative metric, Vue has surpassed React in popularity. React is officially in the rear view mirror. If you’re wanting to start a new project or migrate a legacy project to one of these new frameworks, choose Vue. By all means, play with the others so you’ll know what you’re saying no to, but come back to Vue. There’s a reason it’s the most starred of the three projects on GitHub.1


  1. Also, if you’re not on the JavaScript Weekly newsletter, you really need to be. It’s the moral equivalent of Drudge Report for JavaScript. ↩︎

Called It  

Ewan Spence, writing at Forbes:

Apple continues to use the proprietary lightning connector on its iOS-powered devices, but that could be set to change. According to a number of suppliers, Cupertino is looking to move the iPhone and iPad lines over to USB-C, just as it has with the MacBook family of laptops.

If this is true, then I was a year premature in what I still consider to be a valid argument. This contemplation makes me unlawfully gleeful because it means I’m going to be right and someone else is going to be very wrong.

Strava Brings Kudos to Other Networks  

Strava:

Our thumbs give kudos for effort and activity, not political rants or latte art. Kudos are how millions of Strava athletes share support for each other and spread positivity in our community, and now we’re spreading it even further.

I’m delighted to see Strava mock political rants and latte art for their uselessness. Strava is a social network for people who are too fit, too busy exercising, to whine and doodle. Strava people ship.

Apple Brings Apple Maps to the Web  

Yuge. Some of the stuff in the opening keynote was of less weight than this; it should’ve gotten a mention. Memoji, for instance. Nobody’s going to use that. Lots of people are going to use this.

The Verge: “Microsoft Has Reportedly Acquired GitHub”  

If true, then this is mind-blowing.1 If you’re a developer working on web technologies, it’s difficult to imagine what Apple could announce tomorrow at WWDC that in the long run would be bigger news than this.

Update: the acquisition is confirmed.


  1. It also makes the top-rated answer on Quora for this question look really silly. Anyone who actually thinks that Microsoft’s Visual Studio Team Services is better than GitHub is laughably insane. I’ve used them both extensively and there’s no comparison. The question at this point is this — will TFS and GitHub continue to exist alongside each other? I’d love to see TFS get cannibalized by GitHub. ↩︎

Back to the Mac  

This afternoon I built a mini web page that I can turn to throughout the workday in solace.

Here’s the thing: I get it. Windows has better enterprise software, and it makes sense that corporate America prefers — nay, mandates — the use of Windows software over Apple software.

But it burdens my heart that WWDC is this upcoming Monday and the only way I’ll be able to stream it from my skyscraper desk is via my iPhone, since Apple understandably restricts playback to its own devices. My Dell Latitude 7480 won’t be able to stream it. [Update: turns out this isn’t true. I was able to stream it from Edge on my Windows machine just fine. Apple’s restriction isn’t an arbitrary choice but rather having to do with whether your browser can support its video streaming requirements. Makes sense.] There are a finite number of months that one can go on in this condition. Using Windows for frontend web development is a losing strategy if you’re used to the finesse and vast superiority of macOS. Again, I quote Steve Jobs:

The problem with Microsoft is they just have no taste. They have absolutely no taste, and what that means is, and I don’t mean that in a small way, I mean that in a big way.