I do think that pushing more metadata into the header file is probably a good thing. For example in ObjC, which gives more information about the expected behavior of an interface?
This:
or this:
I hesitate to overload the property metadata syntax further, but I can imagine all sorts of other metadata I'd like to attach to things (some of it currently available using GCC's __attribute__(()) syntax); non-nil, persistent, undoable, nonblocking, legal value ranges or predicates, pre/post conditions, etc...
Having the compiler enforce your API contract when possible is a pretty appealing idea.
This:
Code:
- (id) foo;
- (void) setFoo:(id)newFoo;
or this:
Code:
@property (readwrite, copy, nonatomic) Foo *foo;
I hesitate to overload the property metadata syntax further, but I can imagine all sorts of other metadata I'd like to attach to things (some of it currently available using GCC's __attribute__(()) syntax); non-nil, persistent, undoable, nonblocking, legal value ranges or predicates, pre/post conditions, etc...
Having the compiler enforce your API contract when possible is a pretty appealing idea.