March 1 2010

Cassandra: Too fast

Twitter’s Ryan King on the Cassandra non-relational datastore:

We were originally trying to use the BinaryMemtable interface, but we actually found it to be too fast — it would saturate the backplane of our network. We’ve switched back to using the Thrift interface for bulk loading (and we still have to throttle it).

Awesome.


Comment!

February 22 2010

More JSLint, less JSWTF

The JavaScript community has been enjoying WTFJS this week. Seasoned JS programmers know there are a few weird bumps and traps in the language if you’re not watching. You can take some of the burden off yourself, however, by linting your JavaScript.

There are many JavaScript linting programs out there. As a counterpart to his book The Good Parts, Douglas Crockford maintains a tool called JSLint. Matthias Miller was inspired by this, and maintains a similar but less picky tool he confusingly calls JavaScript Lint. If you want to go even further, there is the Google Closure Compiler.

Take this WTFJS caused by implied semicolons:

function laugh()
{
  return
  {
    haha: "ha!"
  };
}
laugh();
// returns undefined

The lint programs will warn you (in different ways) that your return gets an implicit semicolon, and the object with “haha” in it never gets executed.

Or this one:

parseInt('06'); // 6
parseInt('08'); // 0

Lint will tell you that you can’t use parseInt safely without specifying that you want base-10, or wrapping it in something that assumes base-10.

They’ll also catch things like this:

{
  "ping": "pong",
  "foo": "bar",
} // IE says parse error on the last line of your file.
// (It doesn't understand trailing commas, yay!)

and this:

if (foo == bar) {
{
  // You doubled a bracket.
  // Now need to round-trip to your browser to find out.
}

You can save yourself from these wtfs and parse errors. All you need to do is have your text editor run a lint program instantly when you save your JavaScript. The excellent JavaScript Tools Textmate bundle does this for you using JavaScript Lint1, and is easy to set up. If Textmate isn’t your favourite or you prefer the more aggressive JSLint, you can set up your own save macro on any editor worth its salt.

  1. Even though JavaScript Tools says it’s using JSLint, it’s actually using the more lax JavaScript Lint. []

see also


3 Comments

February 10 2010

An ode to split screen

In-person multiplayer is more fun than playing online. You know it, I know it, everybody knows it. On consoles, playing online is mixed bag that never compares to just sharing a couch with your friends. So why are so many console games nowadays shipping with online-only multiplayer?

  1. It’s not a priority for publishers.1
  2. Everybody has to buy a copy.

Everybody’s favourite console shooter games have great split-screen multiplayer. Halo and Goldeneye are two huge examples. However, for everybody to play split-screen Halo at Tim’s house, he only needs to buy $50 worth of Halo. To fill one battleground of the new PS3 game MAG, you’d need $13,000 worth of MAG copies. Now, you probably weren’t playing 256-player split screen Halo, but still.

Yes, 256 players. What the fuck. At 256, you’re not even pretending that an individual effort can turn the tides, nor is playing with friends reasonable. The MAG article on Wired discusses just some of the reasons adults don’t have much fun getting the shit kicked out of them by 14 year olds online, let alone 255 of them.

So I bought Resistance 2 because it’s the only split-screen PS3 shooter anybody could recommend. It turns out it only has co-op multiplayer. This would be passable, but the game is designed around large online teams, so without at least somebody playing each of the three classes, you’re screwed. Nice.

Despite this attitude, most of the huge titles this generation have been shared-screen multiplayer:

  • Music games (Guitar Hero and Rock Band, but not the failed DJ Hero)
  • Platformers (Super Mario Wii and LittleBigPlanet)
  • Shooters (Halo and Modern Warfare 2)
  • Fighters (Street Fighter IV and Super Smash Bros.)
  • Sports (Wii Sports, NHL, MLB)

Do they actually think people are buying Rock Band so they can play online against randoms? Playing games with people who are actually there is what’s fun. Getting your ass kicked by Korean teenagers isn’t fun. So this is my message to game publishers. Either make split screen a bigger priority than online in your games, or I’ll personally force you to play MAG online without the ability to mute the kids on your team. To death.

  1. Split screen support often gets punted late in the development cycle when there’s frame rate or lag issues. At least, this happens when publishers put the priority on graphics and online play over in-person multiplayer. []

see also



11 Comments

January 14 2010

Unladen Follow 2: How annoying would this user be?

A new version of Unladen Follow is now live. Over the holidays, I received a lot of awesome feedback from users and beta testers, as well as some insight from using it myself. The focus of v2 is researching a potential followee, rather than simply your current ones. Changes include:

  • User detail pages give you linkable details about one Twitterer.
  • “What If” lets you see where a user would rank in your list.1
  • Your followees list now only shows the loudest users by default.
  • The algorithms now completely ignore @replies.2
  • A logout mechanism.
  • A diagram to explain why I created an unfollow helper anyway.

I was tempted to wait for in-app unfollow and more robust error handling before launch, but I’ve been too busy to add much in the last couple weeks. What do you think of what’s live so far?

  1. You can also use this as a trick to update the score of a user you follow using more data. []
  2. In general, your followers won’t see your @replies so they’re not annoying. It would be nice to only count @replies that you can’t see, but now that there’s parts of the app that don’t require authentication, that’s not feasible. []

see also


2 Comments

December 31 2009

Crafting realistic interfaces

Mike Rundle has a great article on subtly realistic visual design for newbies. My visual design skills are the weakest part of my software development toolbox, and this hit a sweet spot for me.


Comment!

December 17 2009

Tab Modality: Chrome makes it happen

I’ve always hated modal interruptions, and Chrome has done what should have been done ages ago: made them modal per tab rather than per window. Apparently this is quite tricky in Cocoa, but I’m glad they bothered to make it happen. Death to modal interruptions!


2 Comments

December 10 2009

Announcing Unladen Follow

The Unladen Follow mascot. He is fat because he ate too many tweets.If you’re like me, you find Twitter can have a high noise to signal ratio. I wrote recently about stopping the fire hose for blogs, but it can be trickier on Twitter, where you don’t have Google Reader’s Trends.

To this end, I built a little tool to help you tone down your Twitter following list: Unladen Follow. It scans your incoming tweets, and uses some metrics to suggest people for you to unfollow. I imagine that an unfollow helper may be construed as antisocial, but I think of it the other way around. By unfollowing a couple spammy users, you can socialize with many more casual Twitterers without overloading your brain.

As you might have concluded from my recent OAuth howto, Unladen Follow uses Ruby, the OAuth Gem, a trivial amount of Rails, and a fair bit of Javascript1.

I have a todo list for version 2, but I’m curious what the Twitter users in the crowd think of it. Is it neat? Is it useful? Is it evil?

  1. I originally used Grackle, which has a great design: instead of wrapping the Twitter API, it dynamically passes Ruby calls into API calls, making it lightweight and resilient. Unfortunately, a memory leak in the package motivated me to move most of the server code into the client. I considered also dropping Rails for Sinatra, which I will do if performance becomes a problem. []

see also


4 Comments

December 8 2009

Chrome for Mac annoyances

I'm so clever.Google Chrome for Mac hit beta today. I’ve been living on Mac Chrome alpha builds for a couple months now, and although it has some great performance improvements over Firefox, my heart still isn’t in it for a few reasons.

Somewhat Less Awesome Bar

As you may know, I am obsessed with Firefox’s AwesomeBar. Google’s Omnibox goes most of the way towards competing with the AwesomeBar, with the bonus that it does away with the pointless detached search field. However, Chrome’s location bar is still immature compared to Firefox’s.

Partial word matching is one example. In Firefox, when I typed ha it knew I meant Hacker News. In Chrome, my destination won’t even be suggested until I type the full word “hacker”, so I end up typing ne to prefix-match the domain. Another example is that when I type aapl, Firefox always knew I meant Google Finance’s AAPL page. In Chrome, my destination doesn’t even come up in the list, even though it’s bookmarked and frequently visited. Chrome’s lack of match highlighting for your URL bar search term makes the matches feel even weaker. Lastly, the default action is a full Google Search, rather than I’m Feeling Lucky. This is totally understandable from a revenue perspective, but annoying.

Unexpected Behaviour

The biggest thing that drove me away from Firefox was flakiness. Chrome’s architecture eliminates most of the beachballing and problems caused by other tabs. As it currently stands, though, Chrome is plagued by some of the same type of issues that Firefox 3 is, where you navigate and nothing happens, often not filling the Location field for you to retry with. The reasons behind these sorts of bugs are often subtle1, but it’s possibly the most frustrating thing a browser can do other than crash.

Flash

I hate Flash. Everybody hates Flash. This is why some of the most popular browser extensions are Flash blockers. Without either ClickToFlash or FlashBlock, hitting Flash in Chrome is painful. This is exaggerated by Chrome’s slightly buggy Flash support. Extension support is coming, and surely one of the first extensions will be a flash blocker, but until then I’m grumpy.

Conclusion

Despite these annoyances, the speed a responsiveness of Chrome makes it just about worth it. When Firefox finishes their multi-process work, I’ll give it another whole-hearted try. Until then, it’s the browser frontier for me.

  1. I’ve seen one based on the rendering processes crashing due to an automatic update, and another caused by command-clicking a link causing a new tab which downloaded something but didn’t display the download manager to indicate this happened. []

see also



5 Comments

« Previous Page · Next Page »

Check out the Archives, or read more about Apple, CSS, Failure, Games, Google, iPhone, Javascript, Startups, User Interface, or Vancouver.