- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
F extends First
Admin
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.
Admin
F extends Failure
Admin
Bull Dog changed to Dancing Ballerina.
Admin
Batman Superman no good
Admin
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.
Admin
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...
Admin
+1 for Remy. It's not often you get to use a word like onomatopoeia in a sentence. Congratulations dude.
Admin
I was feeling lugubrious until I saw this comment.
Admin
PLEASE tell me you get the daily "Make Your Point" email from Liesl Johnson.
Lugubrious was today's word!
Admin
I wonder what EAC gets used for and why it needs a secondary AssemblingContext.
Admin
Days like this are show the need to explain the WTF to people who doing use a particular language.
Admin
Almost got to DUCK typing!
Admin
If this is reeking of a God class, it's an ancient Sumerian god that requires regular child sacrifices to keep placated.
Admin
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.)
Admin
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.
Admin
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:
person.getLog().getAsAt(someDate)
Admin
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>>