lørdag 30. juli 2011

YAGNI Alarms

I'm sure you've all heard it, yagni alarms. "Wouldn't it be cool if we implemented <feature>?". Or how about "If we add <feature>, then we can do <very cool thing> later!".

I recently had a discussion with a colleague about a simple task. It was about doing simple logging of our web app. The log data was only meant for doing initial analysis of the login experience. He wanted to use some messaging queue api for sending the log entries. "We can then scale this horizontally later." he said. It might be that he misinterpreted the requirement, but it would add unnecessary complexity to the project. A plain db insert was enough for this case.

Watch out for these words in requirements:

  • Maybe
  • Could
  • Would
  • Cool
  • Future/Later

What's your favorite YAGNI Alarm?

søndag 10. juli 2011

Excellent Tips for Code Comments

Commenting on how a piece of code works is a workaround for proper refactor and a sign of missing unit tests.

It's insightful to read John Fuex comparing code comments with signs/messages on everyday objects. You know something is wrong when you read this on an object: "For drinking liquids". Read his 5 best practices for commenting your code.