Tuesday, July 28, 2015

Minimal Bootstrap "Hello World"

I hadn't checked out Bootstrap in a while, but came back to it this weekend while working on a side project. I re-read its getting started guide and found that their "hello world" was still too complex for my taste. It included cruft for IE8 support and required uploading extra files to my server.

So I present my own, further slimmed down, version of a Bootstrap hello world example. Bootstrap tells us that all of these lines are necessary:

<html lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

We then need to include the minified Bootstrap CSS file and a default theme.
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

I'm using Bootstrap's recommended CDN so there's no need to upload extra files to my own server. Finally, our body includes one simple container with two example columns, and the minified required .js files.
<div class="container">
  <h1>Hello, world!</h1>

  <div class="row">
    <div class="col-md-6">.col-md-6</div>
    <div class="col-md-6">.col-md-6</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
An important note is that I've stripped out elements needed for IE8 support. I also haven't had the chance yet to test this template in IE.

Monday, July 20, 2015

Don't give up?

Not an amazing article, but short enough to be worth recommending:
There’s actually a good name for this in the realm of psychology. It’s called “goal disengagement,” and it’s actually a good thing when you get older. A 2011 study on the topic ... found that a willingness to give up goals that were no longer attainable actually helped decrease depression in the elderly. 
It doesn't necessarily support the point made in my previous post but provides incentive and a rational explanation for not persevering beyond the point of failure.

Tuesday, July 14, 2015

Failure and Giving Up

You can't fail, if you don't give up. -- Stephen in The Last Kiss
It's a "deep" statement that isn't obviously true or false.

There's an entrepreneur I know who has tried an idea that has clearly failed. It's failed due to a combination of it not being needed enough and other people doing it better. I don't know which is the killer of his implementation, but one of them is. This person has still not realized that their version won't ever be enough or that it fails to beat competitors' versions. Yet they keep trying. They've failed, but they have not given up.

Here are some signs that tell me they've failed:
  • It's been a long time. The person has been at it for 8+ years. Set a deadline for yourself. If it's over some reasonable amount of time, you're probably deluding yourself.
  • Failure is ignored. The person has already achieved failure. The product has no adoption after repeated attempts. There's no revenue, no recent investment, nothing. The world is saying he's failed but the person is ignoring it. Set metrics for yourself. If you haven't achieved them, you've probably failed.
But here's how the original quote could be true. The most successful founders are "relentlessly resourceful" [PG's great essay]. They are relentless. They do something which is resisted. It doesn't matter how long it's been. It doesn't matter how many signs paint a picture of failure. If they believe, they can make it true. 
  • Maybe you haven't tried for long enough to figure out if the market wants your product. Maybe, with just the right change, growth will accelerate and you'll find product market fit.
  • In the movie the quote is from, this problem is considered in a personal context. You've waited on her doorstep for hours. But maybe it takes days. She's told you there's no hope. But maybe she doesn't mean it. Or maybe she means it but doesn't realize that there is hope, and she just doesn't know it yet.
The problem is, the statements supporting the original quote being true are silly graduation-speech-style stupid self-help statements. In reality, there are thousands of people who believe they can overcome failure but actually can't. They simply morph what they were originally believing into something different, and fool themselves about their original belief.

It's the pessimist in me... but you can fail even if you don't give up. The original statement is not true.

Wednesday, August 1, 2012

Craigslist now asks for exclusive license when posting

I don't remember seeing this before at the bottom of the Craigslist posting form. I'm guessing this is the result of the Padmapper debacle? (bolding mine)
Clicking "Continue" confirms that craigslist is the exclusive licensee of this content, with the exclusive right to enforce copyrights against anyone copying, republishing, distributing or preparing derivative works without its consent.

For comparison, here's Yelp's language:
As such, you hereby irrevocably grant us world-wide, non-exclusive, royalty-free, sublicensable, transferable rights to use Your Content for any purpose.
 And Facebook's:
you specifically give us the following permission, subject to your privacy and application settings: you grant us a non-exclusive, transferable, sub-licensable, royalty-free, worldwide license to use any IP content that you post on or in connection with Facebook
When you upload or otherwise submit content to our Services, you give Google (and those we work with) a worldwide license to use, host, store, reproduce, modify, create derivative works, communicate, publish, publicly perform, publicly display and distribute such content. 

Saturday, July 14, 2012

Do you know anyone who...?

In the business world, the question "do you know anyone who..." must get asked thousands of times a day. Do you know anyone who... can program? Would be interested in investing? Would be a good fit for this position? Is looking for a job and has this particular skill and background?

I personally get asked this question several times a week. Most of the time it's by a business contact that I'm either friends with or have recently met. Sometimes the question is code for "Are you interested?" But most of the time, when it's used in that way, the sentiment comes bundled with "well if you aren't, do you know someone who might be that you'd recommend?"

Whenever I get asked this question, I struggle to think of names on the spot and often promise that I'll "keep them in mind" afterwards and send anyone I know their way. Although I try to follow-through on this commitment I almost always feel like I'm letting the person down afterwards. In my address book are 728 entries and I probably "know" several more thousand people in Silicon Valley alone.

Not only can I not remember everyone I know, an equally hard if not harder problem is that I don't know what they're all up to. Each person is in a different state of their career progression and while I might know someone with the right skill set to answer the "do you know someone" question getting that person at the right time is difficult.

In a sense, answering this question is an information retrieval problem. The field of information retrieval has the notion of precision versus recall. When people struggle to answer this question they're primarily facing a recall not a precision deficit. In other words, the people they're able to remember are probably pretty good fits (no false positives) but they are likely missing many individuals who would make good candidates (many false negatives).

Why are so many missing? For two big reasons: they can't remember people or they don't know if a person would be a good fit. They're both large components of why the question is tough to answer and I'm not sure which is the larger factor. The first reason is a consequence of how the human brain works. It just isn't made like a computer database, able to lookup thousands of entries in milliseconds by a particular criteria. The second is the lack of perfect information. You might remember that Jane would be a good fit for a particular position, but is she looking for a job right now? Or is she happy as a product manager at Facebook.

Finally, even if you have remembered someone and have recently spoken to them (thus having perfect information) the actual assessment of whether they match the criteria asked in the question is a difficult and fuzzy one. Would an engineer who became a product manager be a good fit for a role at a venture capital firm? It depends. Notice how this assessment of relevance is more complex than picking a restaurant, where the most important relevant factors are likely only location, price, food type, and star rating.

To summarize, why is answering the question "do you know anyone who..." difficult:

  1. Recall - it's impossible to remember everyone you know, especially when trying to filter according to a particular criteria. Your brain isn't designed to sort through thousands of entries and find the correct ones.
  2. Missing or outdated information - even if you remember a person, you might not know that they're looking for a job, unhappy in their current position, or would be enticed by a new role. What's worse, this information is constantly in flux. You might have checked in with a person a two months ago but now they've found a new job.
  3. Complex criteria matching - assuming you've remembered a person and have perfect information about their situation, making an assessment about how well they satisfy the criteria of the question is a difficult one. 
I personally don't like the feeling of not living up to my commitments. I also like the feeling of genuinely having helped someone else out. The solid referrals I've made in the past are some of the more emotionally rewarding "favors" I've been able to perform.

Some of my recent brainstorming has been around building a tool that would better help me (and hopefully many others) better answer this common question. And I believe before thinking about solutions it's best to understand deeply the problems associated with answering it.

Thursday, August 25, 2011

My one question for Steve Jobs in 2001

I’ll always stay connected with Apple. I hope that throughout my life I’ll sort of have the thread of my life and the thread of Apple weave in and out of each other, like a tapestry. There may be a few years when I’m not there, but I’ll always come back. [Playboy, Feb. 1, 1985]

I've had two personal encounters in my life with Steve Jobs. The first was in 1997 when my parents forced me to stalk him after a Cirque du Solei show in San Francisco and I shook his hand. I wouldn't recommend doing this to any famous person, although in my parents' defense Steve wasn't as famous back then except to fanboys like me.

The second encounter, however, happened 4 years later at Apple in the summer of 2001. I was an intern there and one day the head of the intern program gathered the almost 100 interns into the Town Hall auditorium in Infinite Loop 4 for a "surprise guest speaker" that wasn't really much of a surprise: Steve Jobs.

The meeting had no agenda but I had a hunch that when Steve (everyone who has ever worked at Apple just calls him "Steve") ended his remarks there would be a Q&A session. My mind started racing. This was probably going to be the one time in my life when I would have the chance to ask Steve Jobs a question and get a reply. This has *got* to be a good question. This was like getting a chance to shoot a basket with Michael Jordan, you want to take a good shot.

I can't remember exactly the questions that I decided against, but I remember specifically thinking that I wanted to ask something that hadn't been captured in the numerous books I had read about Apple's history. Something Macworld magazine hadn't reported on. Something Steve hadn't talked about in the press before. And something personal to him. The other interns, disappointingly to me, were asking questions more about the company like "Is Apple ever going to go after the enterprise market?" (Steve's response, a refreshing "If you're interested in that, you're probably at the wrong company.")

Steve got to about his 4th question from the audience and by this point almost every single intern had their hand up. He gestured in my direction but I could tell he was actually looking at an intern in the row right in front of me. I got a bit aggressive and barged ahead with my question anyway before the other intern could begin. Steve smiled a bit in apology to the intern I had just trampled over but let me continue.

I was nervous. "Steve, many years ago you left Apple to start Next. But recently you returned to Apple. Why did you come back to Apple?" I could be filling in false details, but I remember Steve thinking for a moment with his characteristic "fingertip pressed together downward glance". He then proceeded to give a two part answer.

The first part of his answer I've completely forgotten because it seemed to be a canned spiel that he had used before. It had something to do with Apple's products or mission. I started losing interest because it sounded like something I might have even heard Steve say before at a keynote. I felt a bit disappointed that my one chance to learn something new and unique about Steve was probably about to end.

But then, as if to try again at my question, he added a second part to his answer.

"When I was trying to decide whether to come back to Apple or not I struggled. I talked to a lot of people and got a lot of opinions. And then there I was, late one night, struggling with this and I called up a friend of mine at 2am. I said, 'should I come back, should I not?' and the friend replied, 'Steve, look. I don't give a fuck about Apple. Just make up your mind' and hung up. And it was in that moment that I realized I truly cared about Apple."

When I was 5 I first played with an Apple II GS. And when I was 10 (or 12?) my parents got me a Macintosh IIsi, put it in my room, and subscribed me to Macworld magazine. Apple and Steve's work has been a part of my life for almost as long as I can remember.

To bring a company that in 1997 was losing money and had changed CEOs nearly every year for many years in a row, to be the most valuable company in the world is a feat I'm not sure we'll ever witness again in our lifetimes.

Steve managed to find work he loved and did it to the very best of his ability. It's a concept that sounds so simple but in practice is hard to do, but one that is worth striving for.

Update 1/7: On page 315 of Steve Jobs, Walter Isaacson quotes Jobs telling the same story where he uses Andy Grove by name , instead of "a friend".

Thursday, July 7, 2011

Code components not features

A few days ago, I asked one of the "grey hairs" (experienced people) at my startup:
Is it better to have engineers coding features or components? Should they work on a vertical slice, a feature, that cuts through many layers in the technical stack? Or instead, should they focus on one component in one layer of the stack?

I wasn't sure of the best answer, but the experienced-one recommended a one-engineer-per-feature approach, especially for a startup. His argument cited greater individual motivation, higher functional quality of the feature, and faster iteration on the feature.

They say an easy way to make a 50/50 decision is flipping a coin, and if it comes out heads and you're disappointed you know you should have decided on tails. So let me try to make the opposite case: you should always have engineers work on just one particular component, in one layer of the stack, and never on an entire feature.

When you have a system, whatever system that might be (a company, a technology product, a team of people), the system will naturally have a tension between the goals of the individual parts of that system and the system as a whole. For example, the star hitter on a baseball team might want to go for a homerun everytime to improve his stats. But sometimes, it's best if they only go for a single because the team needs another man on base.

A tech startup has two big systems: the product itself and the team creating the product. Happier teams make better products so we'll focus on optimizing the "team system" first. Where the post linked above goes wrong is here:
Nothing is more motivating than feeling like your work really makes a difference.
Programmers, however, aren't motivated by quantity they're motivated by quality.

The quality of one's work is directly tied to one's self-esteem a trait inherent to human nature. A piece of code that is executed by a processor 750 million times isn't necessarily higher quality than a piece of code that is executed only once.

The very idea of a startup is a perfect example of this principle. When you're writing code at a startup it will likely get used by no one at first. So the only motivation you have is making something that is high quality.

Since about 1960 the software world has agreed that producing high quality software requires breaking a system down into smaller parts. This isn't too surprising given the way large systems (like countries and corporations) have always been organized.

It's easier to make one thing of high quality than ten things of high quality. And while an engineer might enjoy creating more rather than fewer high quality things ("Yay! Big contribution, I know I can do a good job on all of them!") it's going to be best for the system (the team) to have each person focus on making at least one thing of high quality first.

This encourages better encapsulation, abstraction, and in the end a better product which can go on to lead a company to becoming the second biggest in the entire world. It comes down to a focus on quality first and all else second that wins the day.