What Are The Biggest SharePoint API Mistakes?

The most prevalent SharePoint API mistake that I see is the lack of freaking Exist properties on proxy objects.

What do I mean?

One can’t do this in order to test, for example, whether a SPList object exists:

[csharp]
public static void DoesMyListExistIDunno()
{
SPWeb web = SPContext.Current.Web;
SPList list = web.Lists[“Heres My List”];

bool areYouThere = list.{An Exists Property Would Be Sweet Wouldn’t It?};
}
[/csharp]

As opposed to this, a developer is forced to do this (or a mild variation of this, I am just using the LINQ because it looks fancy) which is lame:
[csharp]

public static bool InspectForList(string listName)
{
var results = SPContext.Current.Web.Lists.Cast().Where(item => Equals(string.Compare(item.Title, listName, true), 0));
return results.Count()> 0;
}

[/csharp]
What do you think is the most rampant and cumbersome? I am interested in what other people see as being a pain in the butt.

Share