C# Enum Type Automatic-Figure-It-Out-er

I want this:

public enum MeowSound
{
  Angry = 1,
  Happy = 2
}

public class Cat
{
  public void Meow(MeowSound meowSound)
  {
    // Do stuff
  }

  public void AngryMeow()
  {
    // Meow(MeowSound.Angry) // I don't want this.
    Meow(Angry);  // I want this.
  }
}

That is all.

Coding on ADD

Pennies by Beige Alert. A shiny penny can distract me and totally derail my productivity for tens of minutes. Shiny pennies come most commonly in the form of a tweet.

I take a lot of steps to reduce the shiny pennies I’m exposed to.

  • I set my IM clients to not beep and flash and explode on every new message.
  • Email clients are forbidden from actively notifying me of new messages (I use Gmail anyway, so really it’s a factor of not installing those popup email notification things)
  • Twhirl, my current twitter client of choice, only notifies me on direct messages or replies, not Every. Single. Tweet.
  • I tend to put my phone on vibrate when coding.

After making that list I already forgot why I was writing this blog post, I had to go and look at FireFox to remember.

Even with all those measures, I am still going to get distracted by things, especially since I work from home. It’s important that I am able to get back on topic just as easily as I get distracted. When I get distracted, I tend to forget everything I was working on. After I clear the distraction, I switch back to visual studio and it’s like looking at a blank wall. I generally have no idea what I was working on.

There are a few things I do to combat this.  Firstly, I keep a sheet of paper next to my mouse that I use to write down what I’m currently doing at quasi-regular intervals. Nothing high level, just enough to jog my memory as to what I’m working on. “Add Submit Button to UI”, “Create IFoo Interface”, no details, just something I can glance over, find out where I am, and I can check off as I work. It’s not a list of what I need to do, it’s a list of what I’m doing.

Second, I installed TabMixPlus. It allows you to mark a tab as “Protected” so that you can’t close it, you can also lock a tab so that it can’t navigate away from a URL. I just installed it, but I intend to protect and lock the tab of the current ticket/story/bug/whatever I’m working on, so I can always have that point of reference in addition to my little page.

I’m going to get distracted, that’s a given, but having a set of techniques to let me get back to work as quickly as possible helps alleviate some of the productivity drain.