• bvs23bkv33 (unregistered)

    F extends First

  • Peter Korsten (google)

    We do have classes like AbstractClass<A, B extends SomeInterface<A>, C extends SomeClass<A, B, C> at work... but the one in the article could perhaps do with a little bit of refactoring.

  • What? I'm not giving you my name. (unregistered) in reply to bvs23bkv33

    F extends Failure

  • Rick (unregistered)

    Bull Dog changed to Dancing Ballerina.

  • Rick (unregistered)

    Batman Superman no good

  • Simon Clarkstone (unregistered)

    This seems as much like a Haskell programmer as like a C++ programmer.

    TRWTF is how AC and DU swap order between the class and the interface. That's just confusing.

  • snoofle (unregistered) in reply to Simon Clarkstone

    If the method is short enough, I've been known to be lazy enough to abbreviate long variable names to the first letter of each word. But when there are this many parameters of this level of complexity, it usually reeks of a G*d-class...

  • CrashMagnet (unregistered)

    +1 for Remy. It's not often you get to use a word like onomatopoeia in a sentence. Congratulations dude.

  • D-Coder (unregistered) in reply to CrashMagnet

    I was feeling lugubrious until I saw this comment.

  • EmptyJay (unregistered) in reply to D-Coder

    PLEASE tell me you get the daily "Make Your Point" email from Liesl Johnson.

    Lugubrious was today's word!

  • Kevin Jordan (google)

    I wonder what EAC gets used for and why it needs a secondary AssemblingContext.

  • I Am A Robot (unregistered)

    Days like this are show the need to explain the WTF to people who doing use a particular language.

  • Randal L. Schwartz (google)

    Almost got to DUCK typing!

  • (nodebb) in reply to snoofle

    reeks of a G*d-class...

    If this is reeking of a God class, it's an ancient Sumerian god that requires regular child sacrifices to keep placated.

  • Sole Purpose of Visit (unregistered) in reply to Simon Clarkstone

    Well, apart from the fact that it appears to be Java, not really. (I follow your line of thinking, however.)

    As a novice in Haskell, I would expect to see all that baffling polymorphic shit as typeclass constraints, which they obviously are not. And in fact I'd have to work very, very hard at justifying that many typeclass constraints. And vanilla Haskell doesn't have the ability to "extend" a polymorphic type signature constraint as far as I know -- mostly because, obviously, the use of extends here is one of the obvious clusterWTFs.

    As a C++ programmer, I can just about see the "thinking" behind this. Charitably, somebody explained to the loon in question what functional/class composition means, and lo and behold you get (I presume) an absurd composition of narrowed superclasses, a la the comments from Snoofle and DKF. But although I've seen a ton of type specification imbecilities in C++ (including several constructors that "grew, like Topsy" to incorporate thirty or more parameters, variously optional), I've never once seen anything this crass.

    The reduction of a parameter alias to a couple of upper case letters isn't really a WTF, though, because it has purely local effect. You see this a lot in complicated SQL statements, which might be justified in terms of differentiating the tables used ... not so much when you're dealing with composition in am imperative language, though.

    (I wish the OP had at least told us the size of the class in question. My guess would be something like 10,000 lines. If it's only fifty, then Hooray! Obscure, but not technically a WTF.)

  • A PL Researcher (unregistered)

    Let's stop dumping on C++ templates and pretending Java generics are better. Java's generics are not actually type safe (Java's type system is in fact unsound, http://dl.acm.org/citation.cfm?id=2984004) and Java generics are also turing complete (dl.acm.org/citation.cfm?id=3009871). Oh well. Language design is hard.

  • Dave, from Oz (unregistered)

    Weirdest java generic declaration I ever used in anger was for a database where most of the entities had an audit table:

    abstract class Auditable<A extends Auditable<A, L>, L extends AuditLog<A, L>> { L getLog() { … } }

    abstract class AuditLog<A extends Auditable<A, L>, L extends AuditLog<A, L>> { abstract A getMostRecent() { … } abstract A getAt(Date d) { … } }

    As with most generic declarations, ugly to write, but very neat to use:


  • Barteks2x (unregistered)

    The worst I have in my library is this (the ISomething naming is because it's minecraft-related and that's the naming used there):

    public interface IKeyIdToSectorMap< H extends IHeaderDataEntry, P extends IHeaderDataEntryProvider<H, K>, K extends IKey<K>> extends Iterable<RegionEntryLocation>

    public interface IHeaderDataEntryProvider<H extends IHeaderDataEntry, K extends IKey<K>> extends Function<K, H>

    public interface IKey<K extends IKey<K>>

    At one point in development, IIRC, there was a mess like this (later refactored):

    public interface ILocation<R extends IRegion<R, E, L>, E extends IEntry<R, E, L>, L extends IEntryLocation<R, E, L>>

Leave a comment on “Aarb!”

Log In or post as a guest

Replying to comment #:

« Return to Article