entity["myattributename"]
will throw an exception if you attempt to access an attribute that is not in the attribute collection of the entity. It will also return it as an object.
entity.GetAttributeValue<T>
will return the default value of the type if not found, and will not throw an exception if it isn't in the attributes collection of the entity.