Archive for the ‘Opinion’ Category

Interfaces and Implementations

Consider a Java interface and class: Dog and DefaultDog. Which of these two conventions is best?

Option 1 : Dog

Name the interface Dog and call the implementation something like DefaultDog or DogImpl.

Option 2 : IDog

Name the interface IDog and call the implementation Dog, DefaultDog, or whatever else you can come up with.

The Answer

I prefer option 1 for these reasons:

  • A vast majority of your code will utilize the interface, rather than the implementation. Thus, it’s best to keep the interface name clean, and reserve the weird names for the implementation classes, which you hardly ever see.
  • Prefixing names with “I” feels like Hungarian notation. The name redundantly specifies what the interface keyword already specifies. Should we also adopt notations for things that are static, final, abstract, etc? I think not.
  • Many interfaces will have multiple implementations. Thus, each implementation will need a different name. I see no need to also put some name discriminator on the interface.

Regarding names like “Impl” and “Default”, I prefer to avoid those when possible. For example, ArrayList and LinkedList are far better names than DefaultList or ListImpl.

Aidan Prefers Chrome

Teaching my boys right from wrong…

Aidan Prefers Chrome from Eric Burke on Vimeo.

Android Storage

The new DROID phone only offers 256 MB for app storage, as Taylor Wimberly points out:

The Motorola Droid will be the most powerful Android phone to date when it launches on November 6, 2009. However, the device still features the same shortcomings of all other Android phones. The Droid ships with a 512 MB ROM which contains only 256 MB available for app storage.

Fair enough. From this starting point, the article quickly devolves into speculation and FUD:

Google does not support installing apps to the SD card (and likely never will), so developers are limited in what they can create.

I question the “and likely never will” claim. Google knows about the issue and I believe they will eventually resolve it. It’s been discussed in public Google forums, and I think people on the outside are assuming the worst. I think it is far more plausible that the Android team has limited resources and this is a very hard problem to solve correctly.

Limited In What We Can Create?

I also question the “…so developers are limited in what they can create.” portion of the above claim. He goes on:

Have you seen all the awesome iPhone and iPod Touch games? Hardly any of them would fit on an Android phone. It is not uncommon for popular titles to easily exceed 100 MB. For example, the game Myst takes up a whopping 727MB.

The solution is easy. Make your app small and download textures and graphics separately to the SD card.

In Summary…

  1. We all want the ability to download apps to the SD card
  2. Google knows about the issue and understands its importance
  3. Google has not officially committed to fixing the issue, or declared a timeline
  4. Without an official Google statement, many members of the Android community assume the worst

U.S. Music Royalty Fee

I haven’t studied my XM Satellite Radio bill for a few months. Starting a few months ago, they added a “U.S. Music Royalty Fee” to my bill, adding $1.98 per month.

They explain it here:

Music royalty rights were established by Congress and are the product of the Copyright Act. Unlike terrestrial radio, both SIRIUS and XM are required to pay copyright music royalties to recording artists, musicians and recording companies who hold copyrights in sound recordings (the actual recording of a work). These royalties have risen dramatically as a result of a decision of the Copyright Royalty Board.

So terrestrial radio gets to skip the fee. I’m guessing they have more lobbyists and political influence. This reminds me of additional state taxes levied on satellite TV providers.

News Lets us Down Again

Arianna Huffington sums it up:

After a commercial break, Ed asked me about the story. I told him that, for me, once the boy had been found, there was no story — just tele-voyeurism. Why continue the wall-to-wall coverage of a story that had turned into a non-story — on a political show — during a week when health care, financial reform, and Afghanistan are all at the tipping point?

No More Word

A Texas Judge just decided Microsoft cannot sell Word in the US because it saves data as XML. They are expected to pay $200 million dollars.

That just happened.

  1. Every successful software company will eventually be sued for infringing some patent.
  2. Thus, every successful product “violates a patent”, i.e. builds on ideas from some earlier work.
  3. Since every software product builds on ideas from previous generations (or as lawyers say, violates a patent), no software is patentable.

I believe we should eliminate all software patents. Judges, lawyers, and juries lack the technical expertise to understand why patents like this are so silly.

Update

In addition to being fined $200 million dollars for allegedly violating someone else’s word processing XML patent, Microsoft was recently granted patent 7571169 for…saving Word docs as XML.