In Objective-C, I usually see methods that return a dynamically typed object defined as follows:
- (id)someMethod:(id)someParameter;
I know that I can do this, though, as well:
- someMethod:someParameter;
Interestingly, I see the latter convention in more core-level foundation classes, but everyone else seems to use the first. Since the Objective-C runtime infers that an untyped method or parameter will return id
, why should I include it? Doesn't it break the flow of reading?
I would like not only to know that devs think about possible problems with using this convention, but also whether you guys think it is just plain weird?