One Line

Most new applications today are built up out of many 3rd party components and glued together with some business rules. This means that any 3rd party service is highly incentivized to make integrating their service as easy as possible. Often times we end up reducing that down to a simple statement like

“Just one line of Javascript is all it takes!”

Most of the time that’s all it takes, and you’ve got a new customer.

Unfortunately it’s not that simple.

One line for a developer is 2-3 minutes of effort. One line for a business is 2-3 months of change requests, releases, product meetings, sprint planning, regression testing and hopefully a production deployment. Thats after you finally get approval from legal, and a finance department, because you only have so much discretionary income to be able to spend on “3rd party tools that dont help the bottom line”.

Just something to keep that in mind when you write your “super easy to plug in” service.

In Defense of the Intrapreneur

I read a rather harsh criticism on Hacker News today about “Intrapreneurs”. The Intrapreneur is an “Internal Entrepreneur” who starts up new projects, ideas, etc, but from within an established company. I personally feel this criticism is rather misguided. The key to the argument was that Intrapreneurs take no risk, and therefore do not deserve to be associated with any deviation of the word “Entrepreneur”. Update: My colleague Bryan has also written his thoughts on the subject. You can read them here.

As an entrepreneur who has done both, here’s why you’re wrong. You can follow along with the original article if you care at all.

“Intrapreneurs take no REAL risk” - Entrepreneurs take great risks at the benefit of great possible reward. A successful entrepreneur can make his entire career by taking a chance. You’re confusing someone who drives internal product direction with someone who just shoves paper all day. Innovative products that come out of companies (like the iPod, Motorola Razr, Kinect, etc) were all driven by internal entrepreneurs. You may feel that the term “entrepreneur” is being trodden upon by these lowly individuals who have chosen not to go bankrupt. Sometimes that’s just not an option. But an entrepreneur by definition is someone who works on a new idea and is held accountable. Have you ever failed a multi-million dollar project? That’s a risk and responsibility very few people are willing to take.

“Little Accountability” - Entrepreneurs blame all sorts of things when their startups fail. The market conditions weren’t right. We couldn’t get enough investment. Johnny should have written our webapp in Python instead of PHP. At the end of the day, that’s not an “intrapreneur” vs entrepreneur issue. That’s a goddamned character flaw. Intrapreneurs rarely get a second or third chance to start over. Entrepreneurs usually flee with their tail between their legs. In either case, it takes balls to do it over again.

“Little Upside” - 10k in bonus money? If you come up with the next iPhone and you get stuck with a 10K bonus then you’re an idiot - not a hesitant entrepreneur. Stock options, bonuses, a career, a significantly higher salary. Again, this is a risk vs reward scenario. For many serial entrepreneurs, they aren’t in it “for the money” they’re in it for the experience. Building something new is (and arguably should be) its own reward. The money is a bonus.

“Intrapreneurs dont call the shots” - If you’ve started or a project that would be significant enough to justify calling yourself an “intrapreneur” then by definition you’re calling the shots. How many entrepreneurs are great at press releases anyway? I can tell you straight up that the number is pretty low. Sometimes having an entire department to spruce up some product documentation would be nice. Is the process a pain - sure. But if i’ve built something good enough this issue is moot.

“Scarcity of Resources” - Yes. Yes there is. It’s called a budget. Sometimes you go over your budget and you have to beg for more money. I’m not saying it’s glamorous. It’s certainly not as “glamorous” as asking a VC for more money, but it’s real. Just because you work for a big company, doesn’t mean you get to piss that money away on catered lunches and sparkling water.

“Knowing, Not Doing” - It’s incorrect (if not downright delusional) to believe that after raising money internally an “Intrapreneur” can sit back and watch everything magically happen. Again - we come back to risk vs reward. No VC is going to throw their money into a project that has no traction with an inexperienced team. But many times, a kick-ass team and a great idea, and a track record will get you seed financing in the millions of dollars range. You’re wrong.

“Intrapreneurs piggy back on a Brand” - Companies of the size you’re describing as so massive that the “shared resources” benefit is not really a benefit at all. It’s more of a cost. The brand very often has nothing to do with the quality of a product. It gives you a little bit of marketing money, but at the end of the day that doesn’t necessarily result in sales. Most recent example of this is the Blackberry Playbook. All the marketing money in the world won’t save them from the fact that nobody cares about having Flash if the thing doesn’t have email. Bad products are not made good by means of a logo. Startup or not.

“Luxury to Specialize” - Yes. The Marketing, Finance or Tech people have specific functions. But by your very definition, they’re not “Intrapreneurs” if they just go to work and do their very specific pigeon-holed jobs. That’s called “Having a job” and there’s nothing wrong with it. If you want to start up a new idea at your company, you have to learn a whole bunch of other “Entreprenerial” skills. How to sell your idea, how to write a presentation, how to socialize with people who decide if you get your money or not, how to run a team, etc. If you’re an entrepreneur who is worrying about writing contracts, and how to do all your taxes then you’re doing it wrong.

How to do Prototype Validation in Javascript

I hacked together a quick model for a prototype REST API written in Node.js, and wanted to validate an object prior to saving it to a database. I didn’t want or need some wacky full blown ORM but I did want to ensure that the records I was storing were consistent.

Validating in Javascript can be done in many ways but this is a method I came up with after a couple iterations. Let’s take a look at the code.

PictureValidations = function() {

  this.name = function(name) {
    return /^[A-Za-z0-9_-]{8,64}$/.test(name);
  }

  this.type = function(type) {
    return /^(jpeg|png|gif|bmp)$/.test(type);
  }

  this.tags = function(tags) {
    for (i in tags) {
      if(!(/^[A-Za-z0-9]+$/.test(tags[i]))) { return false };
    }
  }

}

exports.Picture = function(options) {
  this.name =  options.name ||"unassigned" ;
  this.tags = options.tags;
  this.description = options.description;
  this.created_on = new Date().getTime();
}

exports.Picture.prototype.valid = function() {
  var validations = new PictureValidations();
  var valid = true;
  for (v in validations) {
    valid = validations[v](this[v]);
    if (valid == false) { break ; } // stop checking on first failure
  };
  return valid
}

How it works

We’ve defined a new Object called Picture which has all the properties associated with it, as well as some defaults.

We also specify another object called PictureValidations which contains a bunch of functions. Each function is named after the properties in the Picture that we want to validate. Each function will return either True or False when it is called with the valid() method which has been added to the Picture prototype. The key is the line that says:

valid = validations[v](this[v]);

This is storing the status returned from the function in the validations Object we’ve instantiated with the value of the current objects properties (this). It will then check to see whether or not it passed or failed.

The nice thing about this method is that you can write a function that does just about anything to determine whether or not something is valid.

Anyway, it seems to work, but I’d appreciate any feedback!

How to learn Node.js from Scratch

Server-side Javascript has appealed to me for quite a awhile, and while watching from the sidelines was interesting, I still never had the time to really get my feet wet and see how the language really worked. That changed after joining Joyent, of course. We’re the proud home of Node.js, and it would be wrong unforgivable if I didn’t know how to write JS.

It turns out that learning Javascript has been quite fun, and really easy. There are numerous resources on the internet for learning how to manipulate the DOM, and do ridiculous stuff with JQuery. But I’ve never been a UI person. I’m a server and network guy, through and through. It turns out, the hardest part about learning Javascript is finding decent documentation. Most of my learning experience has been through reading other peoples wacky, sometimes incomprehensible code, and then going through lists of tutorials that I wrote for myself. Breaking things seems to be the best way to learn how to write stuff. I also was able to rely on some of my brilliant co-workers who are full time software engineers.

Here’s a list of resources I found helpful, which don’t necessarily show up at the top of your Google search results.

NodeTuts

A decent list of tutorials as screencasts. They can be a little on the long side, but there are a few gems. Check out the one about learning how Sys.pump (util.pump) works. Once you understand how it works you’ll kind of be blown away at how easily you wrote something so powerful

Node.Js Documentation

The API documentation for node is extremely well written, a testament to Ryan’s Benevolent Dictator for Life mentality, which is a really good thing.

Crockford on Javascript

Douglas Crockford has a ton of really well written examples, standards, “best practices”, and videos. If you’re interested, check out “Javascript - The Good Parts” post, hosted on the Yahoo! developer network (Mirror please…)

Mozilla Developer Network Javascript Reference

I don’t know why this wasn’t the first result I found when I searched for things like “Javascript Object” or “Javascript Array”, but this is the best resource that explains what the native objects are, what methods they include, and provides some decent examples on their usage. A MUST read.

Learning Advanced Javascript

John Resig is putting together a book on the Secrets of Javascript, and it has something to do with Ninjas. But this part of the book is available for people to read today, and it’s pretty cool. After you nail down a lot of the style, prototyping, and closure stuff, be sure to check out this list of examples on advanced JS.

Layerboom Acquired by Joyent!

I’m happy to announce that my company Layerboom has been acquired by Joyent, a leading provider of Cloud Computing services and solutions. Here’s the press announcement.

Layerboom & Cloud Computing is something I’ve been working on for 2 years but I’ve been thinking about cloud since school. Startups require quite a bit of sacrifice, and this definitely wasn’t an exception. I had to give up a lot for the opportunity to try and for that reason I have a ton of people to thank. Most of you I’ve thanked in person already, but here it is again for ‘the record’.

A big thanks to our Investors for taking a chance on a couple guys with a laptop and an idea, and a big congratulations to the rest of the guys on the Layerboom team for being persistent, forward thinking, and above all a pleasure to work with.

I also have to thank my Friends for being really supportive and putting up with my bullshit over the last 2 years; You’re like family to me and in case there was any doubt, you’re worth more to me than anything.

As part of our deal I’ve taken a job at Joyent and I’m really happy to be working for a company with excellent leadership and vision . We can’t wait to show everyone the projects we’re working on!

ps We’re hiring, so if you’re a developer and you’re looking for a killer opportunity send me an email.