Posterous theme by Cory Watilo

Want to learn to code in 2012? Here's how to get started.

[I decided to put this together after several friends told me they wanted to learn programming this year and asked me how to get started. This is what I told them]: 


If you want to learn how to code this year, then you're in luck. Learning how to program has never been easier. It's also never been more important, so here are some tips for how to get started:

 

Total Beginner's Tutorial

My favorite beginner's intro to programming is Chris Pine's "Learn to Program." It's short, simple, and very clearly written. You can read it for free online, but there are also pdf and paperbook versions:

http://pine.fm/LearnToProgram/

 

Interactive Tutorial

There's a fairly new website called Codecadmy (http://codecademy.com) which offers some pretty cool interactive tutorials geared towards people with no prior knowledge of programming. I haven't played with it too much, but it looks fun.

 

Launch a web app (aka a dynamic web site)

There are three main "web frameworks" in use right now, which are all ways to make it easier to build and launch what they call a "dynamic website" (something like Twitter or Facebook with user accounts, etc.). The most popular framework, and I think the best for beginners---both because it's the simplest and has the biggest community, is Ruby on Rails, which you've probably heard of if you run in tech circles. Here is a great, free tutorial for learning Rails as its commonly referred to:

http://ruby.railstutorial.org/

After you complete the tutorial, try building a small app that you yourself would use. This is the best way to learn (and incidentally, it's also the best way to launch a startup). 

Once you get started, for some more advanced guidance you can check out these other Rails-related sites:

http://guides.rubyonrails.org - the documentation provided by the maintainers of Ruby on Rails

http://railscasts.com - excellent video tutorials for intermediate Rails programming 

 

Free Computer Science Videos and Courses Online

If you want to get more into the theoretical side of computer science, there is always open courseware: free, online courses from leading universities. Stanford, Harvard, MIT, and Cal all have great resources online. Here's a roundup of most of them:

http://academicearth.org/subjects/computer-science

Stanford, in particular, has recently launched an initiative of actual full (still free) online courses (with homework, tests, etc.). Here is a link to their class on artificial intelligence:

https://www.ai-class.com/

 

When you get stuck...

One of the most exciting developments for programmers old and new alike is the recent explosion of online communities around coding. These resources, in particular, can be extremely helpful when you get stuck:

Stack Overflow (stackoverflow.com) is a great place to ask programming questions (or search them --- chances are someone else had already asked)

Github (https://github.com) is a huge respository of open source software where you can usually find some code that already does what you're trying to do (then download it and use it!) 

Many popular code libraries also have their own Google Groups, which you can message. There's also always Google itself as a last resort. 

 

Things to read

If you really want to get into the coder's mindset in '12 you can also read what coders read. 

Follow your favorite open source contributers on Twitter. For instance, @dhh created the aforementioned Ruby on Rails and @wycats has worked on Rails, jQuery (which you'll learn about shortly), and a new programming project called ember.js. 

Read "Hacker News" (http://news.ycombinator.com). It's by far the best source for news about startups and programming. 

There's also Slashdot (http://slashdot.org), which is an old standby news source for coders. 

 

Good luck!

Starting out can be intimidating and frustrating at times, but if you can power through it, then programming is one of the most rewarding things you'll ever do. There's nothing like the feeling of clicking that button and getting the rush of when your program finally works.

 

Happy New Year! Feel free to post any other questions you might have in the comments. Or reach out to me on Twitter (@wxmn). 

 

If you've read this far you should probably Follow me on Twitter and Check out my startup Grouper, which sets up drinks between 2 groups of friends (3 guys and 3 girls).

A Review of News.me

News

This past week Betaworks and Bit.ly unveiled their new iPad news reader, News.me.

I've been working on a news reader of my own for the past few months (Paper Buff), so I was anxiously awaiting their launch. I have incredible respect for Andy and John and the Betaworks team; I had the privilege of working out of the Betaworks offices for two months last summer (on my own, unaffiliated project). Aside: I think they are going to be the next Y-Combinator, in that we will soon see the rise of numerous Betaworks clones once people realize how successful they've been in their approach of both launching  products from within, and then investing in complementary startups. News.me joins Chartbeat, Social Flow, and, of course, Bit.ly, as one of the companies launched from the ground up by Betaworks. The existing three are all crushing it.

After playing with News.me for a few days, these are my initial thoughts:

1) It is beautifully designed
News.me is gorgeous. To pay it the highest compliment I can: it's crafted like an Apple product.  There's a Jobs-like attention to detail. You can "peak" at the full-text of an article form the home timeline with a simple pinch gesture. The header's carousel of avatars provides a clever navigation bar to jump between different feeds. It displays text and images beautifully.

Newsme
The news.me home feed of Betaworks co-founder Andy Weissman

2) The filtering is poor
A central problem in online news is information overload. I only want to see articles about things I care about, but instead my news feeds (whether it's the Times, Reddit, or Twitter) are crowded with irrelevant noise. This turns out to be a very hard problem to solve, but I was curious to see how news.me would address it.

Thus far, I've been underwhelmed by news.me's relevance filtering, which relies on bit.ly's bit.rank popularity algorithm in addition to some personalization techniques.  I am currently working on my own Twitter filtering algorithm for Paper Buff, which actually uses bit.ly data as one of many factors. So while I understand that it can take time to train filtering algorithms, I am still wholly disappointed by news.me's initial efforts. One example is that this morning my home feed contained duplicate entries of the exact same New York Times article. I would expect even a basic filter to prevent this. Tech note: If you're interested, we achieve this on Paper Buff by using URL stemming to trim non-essential params. For instance, http://www.nytimes.com/tech/article1.html?ref=home&topic=tech is stemmed to nytimes.com/tech/article1.html.

Its real shortcoming, however, is poor personalization. Zite, which is a hot iPad news reader and a direct competitor to news.me let's you explictly personalize your news by, for instance, liking particular articles, authors, sources, and even keywords. You train it to learn your tastes, and it works pretty well, even though it requires some extra work. News.me, on the other hand, appears to rely on implicit data (namely, whether or not you click on articles, and whether or not other people have clicked them). I worry that this approach is simply inferior. I much prefer the article discovery experience on Zite, even when taking into account that I've trained it much more (i.e. Zite worked a lot better after 3 days than news.me did). Meanwhile, my perfect news reader, which is what I'm currently trying to build, would go beyond popularity and simple taste profiling to also add intelligent filtering, like the ability to group stories about the same topic, or to predict whether or not I'll be interested in a given piece of breaking news. I was hoping for something of the sort from news.me, but the first iteration is pretty disappointing.

Zite
The personalized recommendation training of Zite, a popular News.me competitor

3) The publishing parternships should be leveraged more
News.me has unprecedented cooperation from major publishers, 600 in all, chief among them the venerable New York Times. In the long-term I imagine this will become a double-edged sword: the benefits of access to their content might be outweighed by the limitations it places on their ability to truly disrupt the news industy.  For example, The New York Times could veto potential features that users might want if it feels news.me is threatening its core businesses. Given these risks, I'm surprised that news.me didn't leverage these partnerships more than it did. Other than the ability to read the article text without ads (which I can already do on any number of other apps), and the presence of several recommended curators from the Times, I didn't really see any other signs of the parternship. They should definitely add things like publisher channels (e.g. a personalized NY Times feed), and generally try much harder to make the most of these rare collaborations. 

4) I dislike "reverse following"
News.me's most novel feature is what it calls "reverse following": rather than showing you the articles a friend is sharing, it shows you the articles that they are seeing in their feed. While it's certainly a clever twist, I found it to have two fatal flaws: I care more about relevance than discovery (Twitter is perfectly adequate for discovery) and in this sense it added to my pain point rather than solving it (there is no shortage of irrelevant articles, I don't need more); and, even more problematically, since news.me doesn't entirely filter out non-news (e.g. personal instagram photos), I saw a lot of intimate stories from total strangers (i.e. friends of experts who I follow), which felt both irrelevant and creepy.

5) I like the idea of a "news-only" context, but think News.me should take it further
News.me should go all the way with filtering out non-news tweets (no cat pictures, no "check out my breakfast" blog posts, etc.). Currently they remove tweets without links in them, but they include twitpic and instagram photos (and the like), almost none of which have anything to do with "news." I really like the idea of a news-only context. The single, biggest contributor to the signal-to-noise problem is social news mixing in with my news news. Twitter now realizes that its strength is news and not social networking, and if they could snap their fingers and change it, I think they would make all the social networking noise disappear. News.me has an opportunity to do this, and they should. Also, this could help them differentiate themselves from Flipboard, another direct competitor (that just raised $50 million), which emphasizes social feeds alongside mainstream news.

Flipboard
A page from my Flipboard's Facebook feed shows random, personal updates from my Facebook friends; I'd prefer relevant news instead

6) The app does not justify its price tag of $0.99/week
At the end of the day, the big question about news.me is whether or not it justifies its $35-$52/year price tag. Its biggest competitors, Flipboard and Zite, are both free. In order to make people consider the jump between free and any price news.me needs to deliver an experience that is substantially better. It does not.

Conclusion
Overall, I think News.me is beautifully executed and refreshingly ambitious, but I am skeptial of its value proposition to readers. It is certainly worth downloading for free and trying for a week, but without more intelligent filtering I will not start paying at the end of the trial period.

The Betaworks team is incredibly smart, though, so I'm curious to see how they iterate. With unprecedented partnerships, and unbridled access to bit.ly and Twitter data, not to mention an extremely capable team, they really have an opportunity to build something special. I'm excited to see how news.me evolves.

 

If you made it this far, you should probably Follow Me on Twitter

Also, if you're interested, check out Paper Buff, and we'll invite you to the Alpha.

Competition Doesn't Matter. Look at Dropbox.

Google_gdrive

When Receivd, a new file-sharing service, launched a few days ago it was heralded as a "Dropbox killer." 

It reminded me of when, in 2007, Drew Houston stormed onto the scene with his "GDrive killer," which was, of course, Dropbox.

The funny this is, four years have come and gone and there's still no GDrive. Meanwhile, Dropbox is killing it

Recently a lot of actual competition has sprung up. Apple is going to launch a cloud storage product at WWDC in June. Amazon launched an offering just last week. A good friend of mine built a successful file sharing app called Crate. And who knows why Google hasn't launched a cloud storage locker yet. But this is four years later.

What's amazing to me is that in the spring of 2007 the GDrive really did seem immiment. I remember holding off on buying a hard-drive because I truly expected to be able to store my mp3's in the cloud "any day now."

Even Houston himself was worried about the looming threat of the GDrive. 

But in the end, Houston just dove in and built something. Dropbox solved a pressing (and difficult) problem really, really well. And, as it turns out, four years ahead of everyone else. 

The simple lesson here? Competition doesn't matter. Edit: As in, if the problem you're working on remains unsolved, it doesn't matter who else has tried or might try or is trying to solve it.

Solve a problem. Build something that people want. Make it good. 

Focus on your product instead of looking over your shoulder at the competition. 

 

If you liked this article you can follow me on Twitter.

Join the discussion on Hacker News.

 

How to Build a Fast News Feed in Redis

News Feeds are a challenging but solved problem. Facebook, Twitter, and others have built massively scalable news feed architectures, but there are still lots of implementation questions for smaller sites looking to add this increasingly common feature.  

There is an excellent post about News Feed architecture on Quora (here), so this post focuses instead on how to implement one. This approach leverages some of the cool built-in features of the persistent in-memoery key-value store Redis (and also, in this particular case, Rails, but it would be easy to translate to Django, Node.js, or any other web framework).

News Feed Architecture  

One brief note about architecture: since it's impractical to simply query the activity of 500 friends, there are two general approaches for building scalable news feeds:

  1. Fan-out-on-read (do these queries ahead of time and cache them)
  2. Fan-out-on-write (write follower-specific copies of every activity so when a given user asks for a feed you can retrieve it in one, simple query)

This example uses the latter, fan-out-on-write. The biggest bottleneck in this scenario is, unsurprisingly, write speed. If a user has 100,000 followers and they update their status, then you need to copy (or point to) this status update with 100,000 additional writes. Fortunately, Redis has extremely fast write performance. It's read performance isn't too shabby either, so it's also ideal for fast retrieval.

Example

So let's say we have a user that has 100 followers, and this user posts a new status update. The new status update is inserted into our primary datastore (Postgresql, Mongodb, etc.), and now on an after_create hook we want to "push" this update to all 100 followers. (As a side note: to be safe, you probably want to handle these writes asychronously in a messaging or jobs queue like Resque, Delayed Job, or Beanstalkd if you're using Rails. Pushing to 100,000 followers could take a few seconds or longer).

The Approach

The general approach is this: we will give each user a sorted set in Redis (that will serve as their "feed"), and every time someone they follows posts an update we will push a presentation version of the post into their feed. Then when they log in, to get their feed we simply need to make one (fast) query to Redis to grab the sorted set.

Code

Our first challenge is that Redis only stores strings, so we need to a few simple helper methods to encode our models in a string format (in this case JSON). We also need to helpers to generate unique keys.

There are three helpful group structures in Redis: lists, sets, and sorted sets. While lists have the fastest performance, if you want pagination the easiest way is to use sorted sets, with a timestamp as the score. This way, you can do simple range queries to get older or newer items in the feed.

Here are some simple methods for retrieving a feed in reverse chronological order (standard for a news feed) then decoding it back into Ruby objects. There are also methods for pushing to the feeds, and an important method for trimming the feeds, since the performance of sorted sets is dependence on the length of the set (so you want to prevent them from getting too long).

To get this working in a Rails app all you would need to do is drop in the feed methods to your User model, and drop in the push methods to your Post or Status model. If you're using Rails 3, the easiest way to do this is with app concerns (which I wrote about in a recent blog entry). 

Hopefully this was informative! If you have any feedback or suggestions please let me know.

If you enjoyed this article you can follow me on Twitter

A Filter for Weeding Out Non-Technical Co-Founders

Gemelos-winklevoss-demanda-mark-zuckerberg

The Filter:

"Have you seen the movie, The Social Network?" 

[They likely say yes]

"Do you think the Winklevoss brothers were right or wrong?"

If they sympathize with the Winklevii it's a dealbreaker. They fail the test. Politely end the meeting and move on.*

An Explanation:

Their response provides a huge information shortcut;  if they're Pro-Winklevii it lets me know that they don't understand tech startups. It means they overvalue ideas and undervalue execution. They overvalue business savvy and undervalue hackers. They simply don't get it. They're not who I would want to work with.

(As an aside: from my hacker-centric perspective I am shocked by how many people I've talked to, in general, who take sides with the Winklevii).

In the past few months I have been pitched by dozens of potential non-technical co-founders. They've ranged from college undergrads to well-known entrepreneurs who have built and sold companies.

In one such meeting yesterday, we talked for about an hour until I realized (by asking them point blank) that they honestly felt that their idea was far more valuable than my ability to build it (which I could do in about 4 hours).

I should've just started with this simple question. It would've saved me a lot of time (in this and many other similar meetings).

So try out the filter. Let me know how it works for you.

 

*One way to end the meeting (optional):

"You have part of my attention - you have the minimum amount. The rest of my attention is back at [my computer where I am] doing things that no one in this room, including and especially [you], are intellectually or creatively capable of doing."

The-social-network-jesse-eisenberg-7-31-8-10-kc

If you liked this article, you can follow me on Twitter

 

Extending Your Models in Rails 3 with App Concerns

App Concerns are awesome.

They've been used for years by 37signals, but there's built-in support for them in Rails 3. They're basically a really easy way to DRY up your code, by letting you easily extend your models with a few handy extras like smart loading. Most Rails 3 gems (like Mongoid v2.0, for instance) use App Concerns to organize their code. Not only is this design pattern great for reusing code across models, but I also use it to refactor large models into component pieces for better readability.

Here's a basic example I was showing to a friend who is a new programmer (pardon some of the obvious OOP notes):

Color is Surprisingly Innovative But Will Still Fail

Let's put aside their astounding $41 million round. I know it's crazy, but if they become the next Facebook or Twitter it will have been a great investment. The thing is, though, they won't.

Color is actually a legitimately innovative twist on social. Their idea of "implied" social graphs, versus tediously managed ones, is a significant leap forward.

When many now have hundreds or thousands of Facebook friends, relevance is becoming a huge problem on social networks. Each of my status updates is probably meaningful to only 10% of my followers, the problem (as the old marketing adage goes) is figuring out which 10%.

Color's use of location to build ad-hoc social networks is brilliant. It tackles the relevance issue from a welcomed new angle: whose photos matter to you? Not only your friends', but those of people near you in real-time, as well. And the best part is: no management required.

It also could spark a mini social revolution by serving as an unprecedented ice-breaker between strangers.

But here's why I think Color will ultimately fail: It is not designed to work as a small network, only as a massively large one. This is a fatal flaw, because if the experience for early users is bad, it will never be able grow to the scale at which it would have become useful.

In other words, you can't launch an application that only works at scale; it needs to work with few users, too, so that it can get to scale.

There are two general approaches to solving this problem: the "bowling pin" strategy that Facebook used (starting with a single, dense network, then going after other self-contained groups), or the "single player" approach that Delicious used (at first it was a useful bookmarking app for yourself, and then later on at scale it became social). [Note: I have to cite Chris Dixon for coining both of those useful metaphors, by the way.]

Even with the ever-increasing prominence of iPhones and Androids, it is exceedingly unlikely that you'll be at a location where multiple people own those phones, have downloaded color, and are using the app at that precise moment.

The saturation requirements for a synchronous, location-based social app are impossibly high. At least for the time being.

Having said all that, if anyone has a chance of solving this problem it's Color. The technology, design, and genuine innovation here are all fairly impressive, but it is highly unlikely that the necessary factors will converge to allow this network to take off. Then again, that's probably what people said about raising $41 million pre-launch...

If you enjoyed this piece, you can Follow Me on Twitter

The Coveted iPhone Home Screen

I have upwards of 150 apps on my iPhone. Only 20 can fit on my home screen. I populate it with the apps I use the most.

Today I realized that this prime real estate illustrates (and also influences) the single most important goal for the vast majority of startups: top-of-mind

There are only so many hours in a day. In order for your app to be successful potential users will ultimately need to carve out some time from their busy schedules for your product. But why would they?

Here is my iOS home screen:

Photo

All of these apps are (basically) single-purpose utilities. They can all be described in one or two words. From left-to-right, top-to-bottom: local search, music, directions, group chat, video, calendar, books, photos, contacts, check-ins, notes, (short-form) news, voice search, (long-form) news, to-do's, phone, email, sms, browser. They all do something basic and useful

I rarely use apps other than these 19. Of course there are some context-specific apps that I'll use every few days or weeks, namely travel apps (like Hipmunk, FlightTrack, etc.), games, some business tools, movie times, etc., but the home-screen 19 represent 95%+ of my phone usage. 

Another thing to notice is that there is virtually no overlap. There is one winner in each category. I chose one synchronized note-taking tool (Simplenote edged out Evernote and Dropbox), one to-do list (Flow over Things, for now), one music player (the ol' iPod still beats Rdio and Pandora for me), one photo-sharing app (sorry Path), one group chat product (GroupMe, although I've been playing with Convore) , etc. 

In the moment, when a user has a particularl itch, only one app will be the first thing to pop into their minds. In fact, oftentimes no app will occur to a user, even if there exists such an app, and even if they've downloaded it. How can that be? Well, it's difficult to develop new habits. It requires a lot of effort to incorporate a new behavior into your muscle memory. Plus, these apps not only vie for attention with each other (think to-do's vs. notes vs. emails), but they also compete with offline options (vs. post-its vs. a whiteboard). That's steep competition for a new productivity tool.

So how do you become top-of-mind? How will users think of your app when they have a particular problem? Well, to start with, and although this may sound obvious, most startups doom themselves by overlooking this simple point: solve a real problem

If your app doesn't solve a real problem that I have, I will never user it. Never. There may be apps on my home screen that you think don't solve a basic problem, but I assure you, they all do. Foursquare, for instance? Location bookmarking. Hashable? Contact management. Twitter? News discovery. I don't care how cool/sophisticated/well-designed/fast your app is if it doesn't solve a basic problem. All of the apps on my home screen do, so that's the bar.

And there's only two ways for your app to join them:

1) Do what one of them does much, much better (enough to justify the switching costs)

or

2) Solve a daily problem that none of them currently solve

One last thing: I guess it goes without saying, but if you're unfamiliar with any of these apps you should definitely check them out. They're all awesome.

 

If you liked this article, you can follow me

The Beatles: The Original Lean Startup

I admit, I'm disappointed that the Apple announcement was only about The Beatles catalogue on iTunes. But whenever The Beatles invade the news I'm always re-inspired by how transformative their work really was---as recording artists, as cultural torchbearers, and even as businessmen. In addition to multi-track recording, concept albums, and tax-sheltered holding companies, another technique that the fab four used long before it became popular was, none other than, the minimum viable product. 

"Love Me Do": The original Minimum Viable Product

Clearly The Beatles' sound evolved tremendously over their 10-year run. The warped time signatures and tonal complexities of "Happiness is a Warm Gun" are a far cry from the simple Skiffle tunes that launched their career. What The Beatles really pulled off, though, is exactly the strategy employed by successful lean startups: they launched with a minimal product that was just enough to get the job done, then slowly expanded it over time. It is likely the greatest "lean startup" success story of all time. 

Audience First, Revolution Later

The Beatles didn't set out to revolutionize music; at first they merely penned simple songs that they thought would have a large audience (e.g. to scratch a musical itch that real listeners already had). Countless startups fail because they try to do too much too soon; they try to "transform a space" with loads of features, months of development time, and huge ambitions. Successful tech endeavors, however, tend to begin with simple, focused products, what Eric Reis calls "minimum viable products", or what John Borthwick and Andy Weissman of Betaworks call "lowest common denominator products." 

Want to shake up social networking? Build something stupid-simple like Group Me (a 24-hour hackathon effort). Their group text messaging is a simple feature that a lot of people want, and though limited today, it can serve as a springboard for much larger ambitions down the road. Hell, Facebook itself was originally built in 2 weeks with only a single feature: user profiles. 

The Beatles were sort of like the Facebook of their day (okay, so that's extremely unfair to the Beatles, but bear with me): they started with a simple, focused product, gained traction, and then leveraged their user base to launch all sorts of unprecedented new "products." 

From Mass Appeal to Critical Acclaim

Early successes like "Love Me Do", "I Want to Hold Your Hand", the Ed Sullivan Show performances, and their first few US tours created enough traction (both in terms of profits and listeners) to enable the later, groundbreaking work that would define their legacy. In 1966, or so, with a large and loyal following, happy record executives (VC's, if you will), and significant learning under their belts (from the 1,400 live shows they performed between 1962 and 1966) they found themselves in a perfect position to try to reinvent pop music.  

The rest is music history.

Revolver, Sgt. Pepper's, the White Album, and Abbey Road are each considered among the most important artistic (and commercial) achievements of the 20th century. But there's no way The Beatles could've started out with these albums. They didn't have the audience to tolerate their experimentation; they didn't have the resources and support needed to actually produce them; and perhaps most significantly, their songwriting skills and musicianship had yet to be honed by a grueling touring schedule and the invaluable data points provided by millions of fans who, every time they liked or disliked a new song, helped Lennon and McCartney to refine their "product" sensibilities for future releases. 

So if you want to be the next Facebook or the next Beatles, then start like they started. 

Go into a garage and create something simple that people want. The revolution can come later.