Redundant type in RingBuffer

13 views
Skip to first unread message

Fil Mackay

unread,
Aug 11, 2011, 10:31:21 AM8/11/11
to Disruptor-net
The type "TU" seems redundant in RingBuffer.. since the type T is
provided by the parent type (RingBuffer<T>)...?

Tim Gebhardt

unread,
Aug 12, 2011, 12:40:18 AM8/12/11
to disrup...@googlegroups.com
Doing so produces a compiler warning.  It's bad practice to use the same generic identifier in a subclass because it's unclear as to which you're referring to. 

With greenfield projects (which Disruptor-net was only a short while ago), I argue it's good to strive for a warnings-as-errors policy to keep the code ultra-clean.


Tim

Fil Mackay

unread,
Aug 12, 2011, 12:54:51 AM8/12/11
to disrup...@googlegroups.com
Tim, there is no use of an identical generic identifier in a subclass. The parent (RingBuffer) uses 'T' and the subclass uses 'TU' (?)

By question was: why use 'TU' at all, when 'T' is already available to the subclass. T is always the same as TU.

Regards, Fil.
Reply all
Reply to author
Forward
0 new messages