emboss/krypt-core — comment on commit 9c1565bc3b78536e4c9889fa2ea4f566e0e925eb
File:  line 0
By emboss:

No, it's not that I don't like it - that kind of design was actually my first attempt at the interface. It's also what the original XML Pull interface looked like. But then I read some criticism that this kind of interface wouldn't be very OO-ish, because the user needs to be aware of the current state of the parser. We have the same problem with ASN.1: the next token is not deterministic, it's the user's choice whether they want to parse the value of a sequence either entirely or if they want to "decode" the value by parsing subsequent headers and values of the underlying sequence.

That's why I put the #value and #value_io methods into Header - this clarifies at least the fact that you can only parse a value after having successfully parsed a Header first. But I, too, still don't think it's ideal the way it is now. Maybe we can find something better after the milestone.