03 May 2009

Not Enough Code Review Secrets

I just finished reading Smart Bear Software's book "The Best Kept Secrets of Peer Code Review." It's available for free (including shipping) from their website. (I have no affiliation with Smart Bear, but my company has a site license for Code Collaborator.)

The book does a good job of covering different aspects of covering the why and how of software code review, although it's tarnished by the occasional statement biased in favour of a code review tool like Smart Bear's Code Collaborator (as opposed to email or over-the-shoulder reviews).

The Essays

The first several essays (The Case for Peer Review, Resistance to Code Review) aren't very useful unless you're still convincing your co-workers of the benefits of peer review. If everyone's on board, then there are a few essays (Social Effects of Code Review, Questions for a Review Process) for team leads on how to prevent code reviews from being perceived as personal attacks on coding ability or the importance of separating code reviews from employee reviews.

If you're interested in the science of reviews, then there are several essays (Brand New Information, Code Review at Cisco Systems) that go into what works, doesn't work, and how well it works. Other essays (Measurement & Improvement) talk about metrics and how you can gauge the effectiveness of your team's review process (along with how Code Collaborator can help provide these metrics).

For those of us who are only concerned with doing the reviews, the most useful essay is not so much about code review as it is about software process in general. The SEI Perspective discusses the Software Engineering Institute's Personal Software Process and Team Software Process. Both processes are geared toward making developers more effective at their job -- as individuals and as a team, respectively. The process includes making a personal review checklist and tracking what defects you commonly introduce so you can eliminate them and bug estimation techniques.


In the end, there's not much for anyone who is solely interested in improving their code reviews. If you're not interested in the science of code reviews, then this book may be a bore. On the other hand, if you're interested in the motivation behind code reviews, or want to look at some numbers from review studies or from your own code reviews, or you don't get why code reviews are useful, then this book has what you're looking for.

Reader's Thoughts

In general, I liked the book. I found the science behind code review interesting and I liked seeing the results of case studies. I was disappointed (but not totally surprised) at the lack of magic advice to make your reviews more effective. The essays were written in an engaging tone without sounding like a textbook. You can get the book for free and at 160 pages, it makes for decent light reading. It's a small form factor (the size of a DVD case), so it's convenient to read on the bus.

Code Collaborator

In addition, some thoughts on Code Collaborator: It's a well-designed tool. The integration with Perforce is simple (it's a command-line client that uses Perforce's Custom Tools), but effective (creating a review or adding to an existing review are all you need).

The code reviews are accessed through a web interface. You have a dashboard showing your reviews. You can look at files for each review, diff them through the web interface or download them and diff them with a local viewer (handled with the local client so there's no hassle). However, I haven't used it extensively because my team prefers over-the-shoulder reviews. Nothing in "Best Kept Secrets" convinced me that a tool is necessary. (Having metrics would be a nice bonus, but not necessary.)

Have a link to a blog post or article that does a good job describing how to improve your code reviews? Respond in the comments!

27 March 2009

The Unfortunate Launch of Xbox Community Games

A Great Idea
I love the new Xbox Community Games. Not only are they cheap, but I like the idea of financing indie developers. I recently purchased some great games, but I found a bug (and workaround) in the system.

A Bad User Experience
I downloaded several Xbox Community Games and found some strange behaviour. I launch most arcade games out of Recent Games in Game Library. I downloaded trials of CarneyVale Showtime and Galax-e-mail and played them off and on for a few days.

The game trials both showed up in Recent Games. I eventually purchased some Xbox Live Points (discounted on Amazon) and picked them both up for only 200 points or ~$3.00 CAD each. After purchasing, the games stopped displaying under Recent Games even though other Community Game Trials continued to show!

I figured this was some stupid bug where purchased games didn't show and was slightly discouraged from purchasing more Community Games.

I later downloaded Groov (a great twist on Geometry Wars and similar to Everyday Shooter). I immediately liked it enough to buy it when the trial ran out (also for 200 points). I noticed that it now appeared under Recent Games.

I'm not entirely certain of how I purchased the first two games. It may have been through an in-game purchase menu or from the Xbox Marketplace.

A Workaround
To try and fix this, went to my recent downloads (Xbox Guide > Settings > Account Management > Download History) and redownloaded CarneyVale. No success. However, then I tried deleting CarneyVale from my system (Game Library > Collections > Community Games) and went to my recent downloads (Xbox Guide > Settings > Account Management > Download History) and redownloaded it. Hurrah! Deleting and redownloading made CarneyVale show in my Recent Games.

An Experiment
As another experiment, I decided to buy Johnny Platform's Biscuit Romp (a classic-style, 200-point, platformer with 50 levels). I deleted the trial from my system, went to Community Games, and selected Full Game from Featured Downloads (as opposed to Unlock Full Game). After the game downloaded, I checked and it showed in my Recent Games.

In Summary
  • The Xbox Community Games integration with Xbox is terrible and still needs work.
  • From now on, I'll delete games before I buy them.

Other UI Gripes
While I'm on the topic of Xbox UI issues, there's some other problems with accessing downloadable games in the New Xbox Experience. I'd love to use my Quick Launch bar for some of my games, but it doesn't support Community Games. Even for Xbox Arcade games, there's no quick way to just get a list of those. Why list all of my retail games, when I still have to get up and put in the disc (even after installing to the hard drive)?

The only way to launch Community Games (and if I'm playing a lot of disc games, Arcade games) is through the Game Library > Collections screen, but that screen often takes 10 seconds to load.

Another gripe I have with the NXE is that when you launch the guide, the first item selected is Xbox Dashboard. But I can also press Y to jump to the dashboard. If instead Quick Launch was the first item, then I could quickly get to the Quick Launch screen (it would only require two button presses). Of course, since the Quick Launch bar isn't that useful, I guess this doesn't matter much.

In general, the NXE was an improvement over the original blade interface (with some thoughtful features like holding down stops scrolling at the end of a list, but stepping down will jump back to the beginning), but it still has rough edges.

Reporting Bugs
Finally, does anyone know how to report stuff like this to Microsoft/Xbox Team? I sent an email to Major Nelson, but can't figure out any better place to report it. Of course, it could also be a game bug (and just lots of games have this problem). Regardless, Microsoft should post a best practice or knowledgebase topic for how to avoid it.

18 February 2009

Too Long, Too Difficult, and Too Outrageous

A Link to the Future posted a letter from an "accidental gamer" who was frustrated with games being too long and too difficult.

Recently, (now that I have a full-time job) I'm beginning to understand how people want shorter games and how it makes more sense for developers to make shorter games. Now that I have a full-time job, I don't have nearly as much time to complete the games that I buy. I always want to complete the story, but some games seem to go on longer than they need to. From the developer's perspective, it doesn't make sense to spend a huge portion of your budget on parts of the game that few of your users will play. Maybe I just listen to too many journalists, but there are so many complaints about games being too long and never getting to play games to completion. It seems to make more sense for developers and consumers to have shorter games at a lower price point and make more of them. Especially if you can reuse the engine and spread the development cost across several games.

However, I agree with the "accidental gamer" that all games (where applicable) should have an invincibility mode. These modes are really fun when you're just goofing around, or to enjoy some of a game that's too hard for you. Obviously, you won't get any of the rewards (achievements, trophies, unlocks) in this mode. But more importantly, a "god mode" should not be something that is unlocked after you've already played through the game.

I recently played the Fear 2 demo and I don't think I'd actually complete the full game mostly because I'm terrible at games with ammo scarcity. The game looks really cool and a lot of the scares aren't just because you feel like you're going to die, but it begs for a cheat code.

One issue with adding a "god mode" is that theoretically, someone can get through the game much faster and then sell it as a used copy. It's hard to justify the test effort for a god mode if it's just going to lower the time required to play the game.

The question to motivate developers and help them justify to the higher-ups: Would you pay a dollar to unlock a "god mode"? EA has recently come out with Downloadable Content in the same vein for Skate 2. The description follows:

If you are busy, or just plain lazy, "Time is Money" will unlock all locations, skaters and gear that can be earned by playing through Skate 2's career and online modes

Unsurprisingly, the internet has erupted in outrage.

However, I think this is a fascinating idea. As a traditional gamer, I think that the "Time is Money" is ridiculously expensive. A tenth the price of a game is too much for a cop-out. However, I'm glad it's not free. If it was free, then I'd have this constant temptation every time I failed a challenge to go grab it and just cheat my way through.

Putting similar DLC up for god mode would provide the option to cheat for anyone who wouldn't otherwise play the game, but the cost would provide the same will-power supplement to anyone who wouldn't usually cheat. Someone just has to figure out the right price point.

09 February 2009

Little Big Planet: The Wonderful Game That Disappointed

We've been finalling our game at work, so I'm a little behind on my posts. I played Little Big Planet on the week of 10 Nov 2008, so I haven't seen the new patch. I hope that it addresses many of my concerns.

I can anticipate the screaming and gnashing of teeth before I even say this, but this blog is for me to think out loud, so here it goes: Little Big Planet is good, but not great. It is a game that has a great concept--one that was frequently seen in the trailers and that is occasionally glimpsed in the game. You get some of your friends--local or online--and go through a magical world full of puppies and magic. Or whatever.

The thought of running through a little miniaturized world with several of your friends, co-operatively solving puzzles and experimenting with physics sounds like the ultimate game to me. However, while Little Big Planet (LBP) is capable of this, it doesn't deliver. The story mode can be played with up to four people and while that is fun, it certainly doesn't require four. There are some areas that are only reachable in pairs or squads of four, but those are only for bonuses. To truly show of its ability to entertain groups, LBP needs a stronger focus on collaboration. Of course, it is perfectly understandable that the story mode has to be completable by one person so it can't provide critical-path puzzles that are completed by large groups.

The game's solution to this is the user-generated content. The scope of this solution is quite daunting. The massive number of levels available online is quite promising. But when you play many of those levels--even the ones that the game seems to recommend in the "Cool Levels" section--you find that it is far from perfect. Fans of LBP will point to some of the better levels available and boast how few other games can offer such variety of play. While this is quite true, the phrase "jack of all trades, but master of none" is quite apt here. The true joy of playing many of these levels is merely to marvel in the brilliance of the creators as opposed to the joy of the experience (for example: Little Big Calculator, Little Big Guitar Hero, and Little Big Pong).

LBP offers many parts to build your levels, however Media Molecule couldn't offer the most important: design wisdom. Many levels are unpolished and don't work well with the game's mechanics. I found playing many of the user-created levels to be crushingly disappointing. And not because the levels are bad, but because they do not live up to my expectations for a retail game. Of course, these levels are free, however free does not excuse that the major reason for (me, at least) playing LBP is mediocre at best. While fantastic levels like Illumina Garden, GAF: One Final Heist, exist, most are sub-par and have glaring problems. These great levels also fall short on multiplayer potential. While they are great on your own, bringing in additional players doesn't add anything to the experience.

As I mentioned, the mechanics of the game are not taken into account by many of the designers. The way the characters jump and land makes LBP a poor platformer. If you play a game like Mario, the responsiveness and precision is apparent. The jump is repeatable and you feel in control. However, in LBP, jumps are floaty and landings tend to be slippery. This imprecision adds mounds of frustration into levels that do not take these limitations into account (which, unfortunately, includes most of the levels with any platforming aspects).

Finally, the biggest problem with LBP is the lack of a good method of finding new levels (Edit: Hopefully this has been resolved by the most recent patch). The "Cool Levels" section of the online level search offers no visibility into how it works. Presumably it is somehow based on the 1 to 5 star rating that users can give a level, but you can't see any rating information for levels. You do get to see the number of people who've played the level and the number of people who've "hearted" it (essentially, a kind of bookmarking feature so you can go and find levels again). You can also heart creators so you can easily find other levels they create, although you have no idea of the polish of their levels until you play them yourself. While this system may work well to create a large group of the avant-garde level discoverers, it also means that anyone who isn't interested in being the first to find cool new levels has to wade through all the muck to get to anything interesting.

There are some websites that act as workarounds or users who create (free) PSN accounts that act like social bookmarking, but these are still band-aids on a deep wound. LBP is a game that is supposed to democratize game design, herald a new age of gaming, and bring world peace. Instead, it will frustrate many people, bring delight and more frustration to others, and send me off to figure out a different way of gaming with my friends.

Addendum: I hope to get another chance to play more LBP with the new searching features to see if I can find some fantastic levels. I'd guess that the platforming issues are still there, but as users get more experience making level (and if Media Molecule can improve the tools or provide additional online tutorial videos to help teach users) the game will improve.

17 January 2009

Renewed Vim and Vigor

Today brings and end to my focus on Python. My adventures into programming with python and pygame haven't ended, but I'm doing a bit of transition (just like I promised : ).

I recently started a new job (large video game developer) in a new city (on the west coast). I want to make an effort to start writing more, and this is my outlet. However, I'm so busy with all of these new things that I don't do enough programming in my spare time to produce many posts.

So instead, I'll talk about video games, software, and general technology topics. Of course, anything I say here is in no way representative of my employer.

Hope you enjoy the new cipher.sense!

Glossy Finishes and Translation of Design

Jeff Atwood recently posted about the importance of pearls on a pig.

As you may guess, Jeff and I disagree. In my opinion, the "new" Windows 7 (beta) calculator has not had a UI redesign. It's just been themed so it matches the new Windows look.

If they actually did a UI redesign, then it should result in a BETTER INTERFACE. Why would you ever change your interface if you are not going to improve it?

Let's look at the "new" interface: All of the buttons are the same size. The primary input buttons (numbers) are white, except for some strange blank key next to Mod. (Anyone know what that's for?) In order to maintain the layout of the standard calculator and keep the equals on the bottom right, the operators are split on either side of the numbers, instead of being grouped. The hex-exclusive numbers (A-F) are not obviously greyed out in Decimal mode. (They look the same as the decimal button, which shouldn't be disabled at this point.)

Of course, this is still beta software at this point and things may be improved. Also, I'm not using the calculator. My impressions are based on screenshots. Lifehacker reports that Microsoft has added some nice functionality to the calculator, but what if they took a different approach to design?

How about having a keyboard-focused mode? When I use a calculator, I rarely use they mouse, but I never remember keyboard shortcuts for square root, memory, toggle negative, or several other complex functions (do they exist?). Having those easily accessible would be far more useful. Have an user-friendly way to store multiple numbers.

But instead, the new Calc just looks prettier. Garbage! I love pretty, but pretty without function is a waste of time.

That said, I haven't used a really good calculator app. I often just open a python interpreter because at least then I can store several variables and I get a better computation history.

Calc looks like a real calculator. Because we lose the tactile input, it's harder to use and (for me) even a simple command prompt is easier to use. Replicating the design of real-world objects has some utility in software design, but there are many cases where it is misguided. How many people remember where all the keys are on a (real) calculator? If they were laid out differently (but still sensibly), would it be that much harder to use? No. While your muscle memory would be impaired, it doesn't make that big of a difference. And since computer software throws all of that muscle memory out the window, it doesn't matter.

So if you're designing your app to look like a real-world object, think again. And read the Design of Everyday Things.

03 January 2009

The Problem with the Monty Hall Problem

If you're not familiar, the Monty Hall problem is a frequently discussed (in probability) and often confusing problem (for almost everyone).

Jeff Atwood recently posed a question to his readers that involves similar reasoning. The poor phrasing of Jeff's question and the response in the comments got me thinking about old Monty again.

I think the problem is not just the wording of the boy/girl part of Jeff's question, but when you get your information. The 2/3 answer assumes that you are making a prediction. This is the same problem with the Monty Hall problem.

Exploring the Problem

Say I was going to flip a coin twice. If I flipped it once and it was heads, the second flip is not more likely a tail since the events are independent.

However, if I said I was going to flip a coin twice and I want you to bet on the result before I flip any coins. If a coin is heads, you bet what the other coin will be, and if one is tails you bet what the other will be. You should be the opposite (for heads bet tails).

If a coin is going to be heads, it's more likely that the other coin is tails. (Possibilities: HT TH HH)

Or, to make this more like Jeff's original problem, you can only bet assuming one coin is heads. If both are tails, then we throw out that round (and this action is part of what makes the result not 50%).

This explanation also demonstrates why programming a simulator and examining the results is misleading. The simulator is working on predictive probability. If you wanted your simulator to work without predictive probability, then you'd have to program it at the point the decision is made. You should assume the initial condition (that you chose the left door and the middle door was shown to have a goat). Then decide whether to switch or stay.

I'll leave the programming as an exercise for the reader : )