Addicted to advice July 31, 2017

Self-help books. Articles on Medium and Thought Catalog. Top ten lists. Seminars. Order my monthly coaching package.

And in rushes the anxiety. Are you doing everything you could be? Are you doing enough? Do you have what it takes? What will happen if you don't act now? Are you falling behind?

Are we addicted to advice? Are we listening too much too often to the babble of other people who tell us they know better how to be?

I challenge myself today to rely on instinct. To act on intuition. To beat my own drum and to listen to the song.

I'm Teejay, and I'm a recovering advice addict.

Integrity July 31, 2017

Integrity is a virtue.

There are a million ways to make your website convert better. But some of them abuse the visitor and dangle carrots that don't help them.

I can't remember the last time I saw an on-exit popup that made me smile.

It's easy to make a living selling the idea of becoming rich or famous and then not deliver.

It's harder to make a living encouraging someone to do their best and genuinely help them get as far as they can.

I don't want to sell shovels to miners. My vow to my clients is simple: I will always act in your best interest.

Fighting the urge to remain in motion July 29, 2017

Do you ever find yourself involuntarily trending toward making life more difficult than it need be? To crave change and excitement—the very same that you were trying to eradicate through the simplicity and calm you now inhabit?

I've felt that way recently. A drive to shake things up for the sake of shaking them up. Funny though; where I am now was a dream only a year ago.

It pays to reflect on our journey occasionally to recognize our progress. But fighting the urge to remain in motion is futile until we reach the grave.

Remote for life July 22, 2017

The last time I went to an office was in 2007.

I remember never quite feeling at ease. Wanting to work but feeling like there was a pressure to stay for the full eight hours. Not feeling like I could go take a break to clear my mind. Subordination.

Ten years later and I've invested in working from home.

I've built myself a lovely minimalist workstation where I'm able to be productive without distractions. I work in my sweatpants and make my own lunches. I'm simultaneously productive and happy and free. This is the lifestyle that works for me.

I know I might be missing out on career opportunities because of my stubbornness to work from home, but in my view they're not worth the commutes and the feeling of entrapment.

There was an article in the New York Times yesterday about people with commutes more than 2 hours. If you work an 8-hour day and commute 4 hours per day to get there and back, that's a 33% pay cut.

My trip to Portland reminded me how city commuting can be stressful. The busyness and the sense we all have to be somewhere fast. From my perspective, we ought to spend our time figuring out how not to do that anymore.

That's why I've built my life around working remotely. And while I might turn down opportunities to grow, I know I'm in control of my own time.

The Portland I used to know July 18, 2017

I went to Portland this past weekend to attend Edward Tufte's excellent Presenting Data and Information course.

Having lived there for the better part of a decade, I've always thought of Portland as my adulthood home. A place to which I'd return someday. A place bookmarked in time.

But now I'm not so sure. The experience I had in Portland this time left my befuddled: Had Portland changed so dramatically in the three years I'd been gone, or did my own values change?

My friends there say it's probably a bit of both. I remember a Portland where ordinary people could afford to open small businesses. Now it seems as though all of those lovely local businesses are closing. I'm not opposed to change and certainly don't think preservation legislation is the answer, but it's a difficult and depressing pill to swallow.

And can we talk about the cultural shift? I don't mean to stereotype, but I'm about to. When did Portland go from a place where the punks and weirdos thrive to a place where it seems as though people go to great lengths to manicure their appearance to the point of absurdity? Was Portland always the epicenter of douchey-cool and I've just grown out of it? Or has it reached its tipping point?

I still love the Portland cityscape and don't bemoan out-of-towners who dream of moving there. One of the unique draws of city life is being surrounded by people different from you. But Portland's recent homogenization represents a shift away from that diversity. I'm not talking about racial diversity or even ethnic diversity. I mean diversity of ideas. A place where both artists and businesspeople can thrive. That's the Portland I left. And now I'm not so sure I'll go back.

Buffers July 11, 2017

Life is peaceful when there are buffers.

The time between the present moment and your next obligation is a buffer. The money in your bank account that protects you from insolvency is a buffer. Food in the pantry. The space between your neighbor's house and your own.

As I've grown older, I've noticed I want wider buffers. I'm less willing to allow them to shrink to their size ten years ago. Busyness. Brokeness. Empty pantries and tiny apartments.

Part of me misses that wild abandon. But when I sleep at night knowing there's a cushion between me and the world, I smile.

How to name and organize your React components July 10, 2017

When I first began building complex React applications, I struggled to determine the best way to name and organize my components within my codebase. Having come from the Rails school of convention over configuration, I was perplexed to find that most modern JavaScript apps rely heavily on custom configuration and don't adhere to any sort of community-driven conventional norms. That's changing slowly with the advent of toolkits like create-react-app, but even its conventions go right out the window as soon as you npm eject.

After a couple years of learning and mistakes, there are a few guidelines I use when organizing my React components so my code is more readable, understandable, and succinct.

Compose your components into smaller subcomponents

While it's tempting to just keep adding bits and pieces to your component's render method, this can grow to the point where it becomes difficult for new eyes to discern your intentions. Imagine a render method like this:

render() {
  return (
    <div className="todo-list">
      <div className="todo-list__items">
        {this.props.items.map(item => (
          <div className="todo-item">
            {item.title}
          </div>
        ))}
      </div>
    </div>
  );
}

Instead of rendering todo items within the root component's render method, create a new component:

const TodoItem = props => (
  <div className="todo-item">
    {props.item.title}
  </div>
);

Then, call it in our root component's render method:

render() {
  return (
    <div className="todo-list">
      <div className="todo-list__items">
        {this.props.items.map(item => (
          <TodoItem item={item} />
        ))}
      </div>
    </div>
  );
}

It's a subtle change, but making these sorts of changes proactively can keep your components readable. And becuase React only re-renders those components that change, extracting smaller components can improve your application's performance.

Extract iterators into class methods or new components

Extracting a subcomponent is a good first step. But we can go one step further by extracting the map iterator call into its own method in the root component. This improves the readability of the render method:

render() {
  return (
    <div className="todo-list">
      <div className="todo-list__items">
        {this.renderItems()}
      </div>
    </div>
  );
}

renderItems() {
  return this.props.items.map(item => (
    <TodoItem item={item} />
  ));
}

Now when we scan the render method, we see a more succinct summary of its contents!

Only use ES6-style class components where state is needed

Notice in my previous example that I've opted to use const to define the TodoItem component. This is because, in its current incarnation, the TodoItem component is stateless.

In React, stateless components are merely functions that return a React-wrapped DOM element. Unlike using the ES6 class keyword or the now-antiquated React.createClass method, stateless components cannot hold their own component state in a this.state object.

The reason this syntax is favorable is because it encourages authoring code in a functional style. Let's expand our TodoItem component to include a "Delete" button:

const TodoItem = props => (
  <div className="todo-item">
    <div className="todo-item__title">
      {props.item.title}
    </div>

    <button onClick={props.onDelete}>
      Delete
    </button>
  </div>
);

Here we've enclosed the title in a new container div, and then added a <button> tag with an onClick handler set to a hypothetical onDelete thunk handler that we would pass through from the parent component.

Just like in our iterator extraction example above, there's opportunity to make this component more readable. However, because this component is stateless we can use a more functional style:

const Title = props => (
  <div className="todo-item__title">
    {props.value}
  </div>
);

const DeleteButton = props => (
  <button onClick={props.onDelete}>
    Delete
  </button>
);

const TodoItem = props => (
  <div className="todo-item">
    <Title value={props.item.title} /> <DeleteButton
    <DeleteButton onClick={props.onDelete} />
  </div>
);

Our goal in doing these extractions is to reduce fatigue when scanning your components' code. New developers who visit this code for the first time will be greeted with components whose markup is only a few lines, making it much easier to parse and understand than if they were tens or hundreds of lines.

Keeping this habit early on will mean your codebase can grow and remain understandable to newcomers.

Organize composed components into subdirectories

So far, we've built the following components:

  • TodoList
  • TodoItem
  • Title
  • DeleteButton

As our codebase grows, the way we physically organize our code on disk is going to become more critical. I've experimented with a couple methodologies.

The first is to create a directory called components, dump all your components in there, and call it a day. This is fine for projects with fewer than 20 or so components, but it becomes cumbersome as the number of components grows.

Instead, I've settled on creating subdirectories for certain root-level components. In our example, we could envision the following directory structure:

  components/
    TodoList/
      index.js
      Item/
        index.js
        Title.js
        DeleteButton.js

Organizing our components in this way has the following benefits:

  • Components only ever reference other components within their own subdirectory.
  • We can name components based on their context. For instance, instead of naming our item component TodoItem, we can call it Item. This reduces unnecessary verbosity.
  • Our components become portable. By encapsulating their hierarchy within a single directory, we can reuse the component in other codebases easily.

That feeling when you want to give up July 10, 2017

Marketing yourself sure is an anxious chore. I'm plenty qualified for all sorts of full-time jobs, but I'm resolute against taking one since I know I work best when I'm free.

What does freedom mean to me?

Freedom means the ability to wake up when my body tells me instead of when an alarm sounds its siren. It means I can take some time between clients to ride my bicycle around town casually without worrying that I need to return to the office. It means I'm not burdened by day-to-day inter-office politics. That I can provide immense value without being physically present.

But it's tough out there. Not in the economic sense; there's probably plenty of work to be done. But marketing yourself as a consultant is no easy task. Most consultants probably wouldn't admit such a thing on their website for fear of being perceived as a failure or a fake.

I'm not afraid of that because I know my value, but I am afraid of failure. I'm afraid I'll soon be applying for jobs and working 40 hours per week and giving up on this whole consulting thing for good. Which is humorous in its own way given the fact I'm nowhere near failing. But that's how fear works, isn't it?

Limiting beliefs and the tech industry July 9, 2017

Limiting beliefs are beliefs we hold which constrain us in some way. We define ourselves by what we do or don't do, what we can or cannot do, what we are and what we aren't.

The tech industry, with its continuous cycle of innovation, cutthroat competition, and social darwninist hierarchy, can foster some pretty sinister limiting beliefs. I struggle with them regularly and I'm sure you do too.

I'm too old. There's plenty of chatter about ageism in the tech community. As someone who's turning 32 this year, I'm fearful of it, in spite of not having experienced it. I do wonder though, whether ageism is a bogeyman insecurity that can be overcome in the minds of those affected, rather than a form of systemic oppression. It's tempting to give up on that new startup or to believe we're unable to grasp new technologies on account of our age. But the market doesn't care how old we are, truthfully.

The market is too saturated. I'm running up against this resistance right now myself. Building a consulting business is no easy task. There is plenty of advice of how best to proceed when building a consulting business, and I've learned over the past few months that it's easy to get sucked into their vortex and forget to do the work. While some of the advice is prudent to follow, most of them are just selling shovels to the miners. I'm learning that the best way to build a business is to build the business. The market doesn't care how many players are in the game. It's just a matter of standing out among them.

All the good ideas are already taken. This one is fascinating to me, but I'm still succeptible to it. Imagine someone saying this in the days before the Internet. Lawyers didn't decide not to start a law firm because there were already lawyers in the world. Dentists didn't say "Well, there are already people fixing teeth. I guess that dream is off the table." Why are we so caught up in the notion that our idea need to be original? Competitors are a sign there are people willing to pay for what we offer. It's just a matter of providing more value than they do.

I'm writing this as a gentle reminder to myself: There's abundant opportunity for thoughtful and innovative people. It's just a matter of training our minds to open.

Why aren't more companies hiring independent consultants? July 8, 2017

I'm noticing a trend as I'm bootstrapping my consulting business. There are plenty of awesome software development gigs, but most of them are full-time positions.

I have nothing against full-time positions; they're great for people who enjoy capturing a regular paycheck each month and don't like the sales process. But I'm not sure I understand how hiring full-time staff benefits the employer, especially in terms of cost benefit relative to hiring results-oriented consultants to complete the same work.

Employees are paid for their time. No matter the enriching culture you provide them internally, they have little incentive to be efficient aside from the possibility they'll lose their job. Most employees do want the best for their company, but their principal concern is the livelihood of their families and their ability to live life on their own terms. Paying an employee's salary for a year does not translate into results for the business. I've spent months as an employee working on projects which never made the company a dime because they were ill-conceived from the start. I got paid and the company got nothing.

Consultants charge for the outcomes they produce. If you need a new user interface for your web application, I'm going to spend a fair amount of time asking you why you need it. I'm going to dig deep into how such a move could improve your business fundamentals. I'm going to ask you difficult questions that have more to do with sales, marketing, and users than technology, infrastructure, or design.

When I send you an invoice, I'm going to tell you exactly the results you paid for. If you're not satisfied, you'll get your money back.

Feeling pressure to keep your team members employed because you know they rely on you for paying their rent? Hire a consultant and you won't have that problem. I'm happy when you don't need me anymore. Hopefully I worked myself out of a job and you can spend the money you would have allocated to my salary on marketing to more users or innovating in other ways.

There's a stigma abound that independent consultants are hawks looking to scoop up a payday without providing real value in return. I want to debunk that myth for good. Consultants are seasoned professionals who realize they don't thrive in the employer-employee model. We want nothing more than for you to succeed and to help you find the best possible path to get there. Our business is not one of billing hours, but of optimizing costs. We charge fees not based upon the time we spend, but based upon the value we provide.