Tuesday, July 26, 2011

Constructors Are Methods, too!


Yes, if your constructor does something meaningful. This is just like another method and should be treated equally for unit testsing purpose. Here's an example that should need unit test:

It looks simple, so testing it should be simple, too. I would only skip the default constuctors, as long as they don't do anything interesting.

Friday, July 22, 2011

How to Annoy Your Customers? Learn from GoDaddy Account Status Email

Just looking at this screenshot alone, what do you think it is?
I have a few domains registered with GoDaddy. I went with them, because at that time, I didn't know of another renowned provider. But they have always been the best of producing the most confusing ever user interface. The account status email is one step ahead in that same direction.

This is how it starts:

At the top right corner, it says July 2011, in grayed out font! A deliberate attempt to de-emphasize the statement period!

Just below the date, there is a fake input box and a button labeled Go. This is an image and if you click it, it will actually open a new page instead of asking for user input right inside the search box. This is just following the theory of most surprise (as opposed to principle of least surprise)!

Next, in red background, they welcome me by saying, Welcome, S. M. Sohan! Customer Number: ### wtf? Customer Number? Do I give a shit what my customer number is? Why is the welcome grouped together with search and contact? How are these related?

Then it says, Log in to your account on our secure website to view your most recent account statement. What does this mean? Does it mean, this statement is not recent? Is this not secure?

Then it says, Summary of your account as of 7/21/2011**. That f'ing footnote will tell you that, the information may not reflect recent changes! What? Is this good enough till 7/21? If not, why do you even send this bullshit to me?

Then it has 4 boxes side by side. The first one, Messages has Alerts: No, Notification(s): Yes. View now is a button to their site. How stupid is this? Why bother saying alerts "No"? If you know I have notifications, why not put it right here? Why are you confused about notification"(s)" - you should know if its just one (notification) or more (notifications). How lazy is that?

Items Expiring is the other funny one. It says, Domain names: No. Then it says renew now. What? You're saying nothing is expiring. Why on earth I would renew something?

Then it takes almost 50% of the screen for asking me to contact with them through a number of channels including Facebook. Really? Facebook fan of GoDaddy? Crazy people!

In the end, they don't care putting a note of thanks, let alone personalize it with the name of an actual person. Isn't it rude to end an email this way?

Now, with all these hammerings - as if it fell short of creating enough fun, it says, More for You: followed by tens of fine print links to things that don't matter at all to me. Oh boy! you are awesome!

I am not a designer by any means. However, I think, even I can design a better version than this crap. Here's my version in a screen mockup.






Monday, July 11, 2011

Avoid Duplication in Config Files

Any kind of configuration file, be it an ugly xml file or a prettier yml or properties file, its been a source of frustration to me. Here's a list of few such pain points:

  1. There are two config keys that point to the same value. e.g. db_username=master, data_source_user=master
  2. There are two config keys for urls that point to the same domain, but different paths. e.g. market.com/cameras and market.com/undies
  3. Config entries with placeholders. e.g. weather_url= weather.com/%s or weather_url= weather.com/%s/hourly
  4. Config entries with default values that should not default to anything.
  5. Config entries that are required but don't fail the application deployment when not set.

Are you having to deal with similar pain points? Some more?