swieton
Joined: 05 May 2004 Posts: 1
|
Posted: Wed May 05, 2004 5:09 pm Post subject: Type-safety versus easy use |
|
|
First off, I noticed I had some inconsistancies in argument order in the new API, so that will definitely change.
Anyway, the advantage of templates is type-safety. The disadvantage of templates is that the code should support variables with value semantics (primitives, etc), which means no more 'just return null'-style reporting, which is why I moved to returning booleans and using out parameters.
I'm not sure I like the change, because it makes it hard to use. Now, I *do* like the idea of using templates to restrict the types. I am somewhat tempted to have a templated version that only allows reference types that follows Doug's API more faithfully, and maybe keeping a second version that's more generic.
An alias could be made to Channel!(Object) for a Java-style channel.
Thoughts? |
|