
InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonPainter - heydenberk
http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonPainter.html
======
nostromo
Someone on StackOverflow suggested we think of ugly Java class names as
poetry; he provided an example:

    
    
      InternalFrame InternalFrame
    
      Title Pane,
    
      Internal Frame
    
      Title Pane.
      
      
      Maximize Button Window,
    
      Not Focused State.
    

[http://stackoverflow.com/questions/1697215/what-is-your-
favo...](http://stackoverflow.com/questions/1697215/what-is-your-favourite-
java-api-annoyance)

~~~
jcurbo
The link now goes to a Page Not Found page. "removed from Stack Overflow for
reasons of moderation"

~~~
Sembiance
Welcome to stack overflow! Censorship here is just as bad, if not worse, than
Wikipedia. As much as I despise this, it probably does make it a better
resource. Still, I wish they would MOVE these to meta exchange, rather than
deleting content outright.

~~~
27182818284
Wow! Could you elaborate by chance? I mean this genuinely, this is my first
ever dead link for StackExchange content. The others in this comment thread
act as if this is the norm, which is disheartening. Is this a recent
phenomenon or something that I've just been luck/naive enough to miss this
whole time?

~~~
anonymous
There isn't much to elaborate on. Anything that doesn't fit completely within
their strict no-fun-allowed guidelines gets removed. This leads to two things:

1\. Any result on google from StackOverflow is guaranteed to be of the highest
quality.

2\. I am never ever posting there.

~~~
aneth4
Sounds like a win win. There are hundreds of places for humor on the Internet.
I'm pretty happy SO sticks with business. Humor would be distracting and
irritating.

~~~
stephengillie
Why not Humor Overflow, where people can discuss what is funny and why, or why
something isn't funny. Maybe why something is no longer funny -- or is funny
in one language or culture, but not another.

------
jacquesm
I just did a quick analysis of a system with a large number of globally
exposed names written in C.

About 1000 functions in all (so that's _just_ the globals), of those a hundred
have names > 30 characters. There are some real 'gems' in there, consistency -
even if self enforced - has a price. The record holder weighs in at 53
characters, it (fortunately) drops off quickly after that.

There are only 2 things hard in programming, cache invalidation, naming things
and off by one errors.

Personally I think this name is bad because in spite of the enormous length it
_still_ doesn't tell me what it actually does. It just uses a lot of
characters to indicate its spot in a hierarchy.

Names like these are what gave rise to jokes like 'Q: What is the spelling of
bureaucracy? A: J-a-v-a'. Which of course does a dis-service to java the
language and the community behind it.

I can see why they're funny, but you have to realize that when you get out of
the trivial program length domain into projects that are 100's of thousands of
lines that this problem will sooner or later rear its ugly head. And I have
not yet seen any really good solutions.

The things that can help you to extend your runway a bit in this respect are:

    
    
       - be consistent
    
       - reduce scope wherever possible
    
       - pick short names for primary objects
    

But even with those rules you'll have a 53 letter name in there somewhere...
I'd be very wary of casting stones in situations like these without knowing
exactly how the person that picked it originally made their choice. Chances
are there were a whole pile of external factors dictating this monstrosity and
the guy or girl (or the code generator!) that did it never was happy about it
either. Laughing at others that have tackled some problem is easy. Coming up
with real solutions and doing a better job of it is a lot harder.

~~~
edwinnathaniel
Your last 2 sentences exactly describe where most programmers fall into these
days.

1) Most of us never tackle specific problem domains that are very rare

2) Most of us never come up with real world solutions

Most of us these days work on CRUD web-app with only a few who actually go
deep into specific problem domains.

Sometimes the problem domains is just that hard. I know there are optimistic
developers out there that keep saying "I can simplify this particular problem
domains" but here we are in 2012 still writing CRUD web-app.

~~~
javajosh
_> Sometimes the problem domains is just that hard._

No. That is just wrong. There is no problem domain that requires the use of
very long strings to refer to individual pieces of it. All systems, either
statically or dynamically, can be decomposed into smaller pieces who's names
are short because they are meaningful within the context of another name.

Or, to put it another way, you get names like this when you statically code a
data-structure that should be dynamic.

~~~
jacquesm
What would you call a function that is globally visible (as in: can be called
from anywhere) that serializes a construct called a router_msg_header into
xml, and that returns the generated xml as a utf8 string?

~~~
anthonyb
Why do you have to call it anything? Why isn't it a method or attribute on a
RouterMessage object?

Then it'd be something like:

    
    
      RouterMessage.utf8_xml_header
    

or shorter if you decided on utf8 across the board.

~~~
erikpukinskis
Assuming there's no relation between the xml header and any other headers you
might have, the atomic core of the noun phrase is "XML header" so I maybe utf8
should be a (optional?) parameter.

~~~
anthonyb
Probably likely to be an attribute on the RouterMessage, or a dependency
injection, or a configuration setting somewhere.

I can only imagine the chaos if you start encoding a mixture of Latin-1 and
UTF-8 headers :)

------
espinchi
Also, in the package com.sun.java.swing.plaf.nimbus, there lies the infamous
class
InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
([http://codenav.org/code.html?project=/jdk/1.6.0_22&path=...](http://codenav.org/code.html?project=/jdk/1.6.0_22&path=/Source%20Packages/com.sun.java.swing.plaf.nimbus/InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState.java)).
Quite a precise name for a class that has only 36 lines.

Talking about design patterns, the folks that develop the Spring framework
apparently tried to put as many of them together as they could: there is a
class named AbstractSingletonProxyFactoryBean
([http://static.springsource.org/spring/docs/2.5.x/api/org/spr...](http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html))
in the aop package. And, the class description is no less than "Convenient
proxy factory bean superclass for proxy factory beans that create only
singletons".

Take that, GoF.

~~~
Aardwolf
I love how it says "convenient" :)

~~~
chii
its convenient if you don't actually have to type out the whole name - this is
where IDE autocompletion comes in.

~~~
nfm
There's nothing convenient about having 78 character class names in your code,
whether you typed them in manually or not!

------
SCdF
You can find quite a few of these, and every time I see them linked I shake my
head in confusion.

I don't understand what I'm supposed to take away from this. That there exists
in the world badly named Java classes? And? Is the implication here that
because you found an example of a clumsily named Java class the entire
language is an usuable write-off? Or that it's somehow indicative of all Java
applications?

I know Java isn't cool, but I don't see what is achieved by staring, pointing
and giggling because you found an example of its use that is ungainly.

~~~
1010011010
It is data that fits the "Java is a disease" theory pretty well.

------
beambot
Almost as good as Microsoft Office's tristate enum with 5 states (three of
them not supported), where 0 is False and -1 is True:

[http://msdn.microsoft.com/en-
us/library/aa432714(office.12)....](http://msdn.microsoft.com/en-
us/library/aa432714\(office.12\).aspx)

~~~
pcwalton
This is how Visual Basic 6 and below worked; True was -1 and False was 0, so
that bitwise and logical operators could be unified.

~~~
astrodust
Presumably this is because -1 is all bits on in two's complement
(<http://en.wikipedia.org/wiki/Twos_complement>).

------
markokocic
Seems like automatically generated class name. You shouldn't ever see that as
a Java developer unless you work for Sun, since this is internal package. The
name, though long, seems pretty consistent with the rest of the names in the
package [1].

If you look at it once more I guess that it is used as a Painter for
MaximizeButton located in InternalFrameTitlePane of InternalFrameTitlePane of
InternalFrame.

How would you name such thing?

[1]
[http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/pac...](http://javadoc.bugaco.com/com/sun/java/swing/plaf/nimbus/package-
tree.html)

~~~
wtallis
Given the name, it sounds like this piece of code is drawing window
decorations despite not being part of a window manager. (Though it's unclear,
it might be doing window decorations in an MDI-like context.) This object
probably shouldn't even exist in the first place.

------
imglorp
As good or bad as the Java language may be, I think plenty of people are
turned off by the Java culture that encourages this to happen. This is a
little bit of an understatement since Sun setting the defacto coding standard
gives a very strong message to followers.

The rest of the world might simply say blah.bah.frame.paint and be done with
it.

~~~
markokocic
This one[1] from .Net comes quite close. Though, it was almost decade ago,
they might have passed Java on class name length by now.

[1][http://weblogs.asp.net/rchartier/archive/2004/02/05/68350.as...](http://weblogs.asp.net/rchartier/archive/2004/02/05/68350.aspx)

~~~
jivatmanx
System.Windows.Forms.IDataGridColumnStyleEditingNotificationService

Interesting. It's long, but it's also pretty clear on what it does, and
doesn't have any repeated words.

Reading this, I would guess that it's a notification of when the user starts
editing a column, and indeed that's what it does. "Informs the
System.Windows.Forms.DataGrid that the user has begun editing the column." is
the official description in the API.

~~~
markokocic
But .Net is not open source, so you don't have information about the internal
classes used in it.

Anyways, we are shaming Java here because of one obviously automatically
generated internal class.

------
evmar
Here's a query for [\w{60,} lang:java] on Google Code Search:

[http://code.google.com/codesearch#search/&q=%5Cw%7B60,%7...](http://code.google.com/codesearch#search/&q=%5Cw%7B60,%7D%20lang:java&type=cs)

E.g. TraversableResolverSpecifiedInValidationXmlNoDefaultConstructorGwtTest ,
DeleteContentTypeXmlDocumentResponseDeleteContentTypeXmlDocumentResult , and
so on.

~~~
robrenaud
I know these test names might seem insane. And I personally hate the Java
FactoryFactory culture of over-engineering. But, the super long test class
names are actually pretty nice. I've personally never gone quite that crazy
with the names, but I have definitely used more than 80 characters total for
the class and particular function named for a test.

These super long names not part of any client interface, no one is ever going
to have to type that monstrosity except for the guy writing the test. But when
you see the failing test output that prints the test name, you already know
what is failing.

You can have a small class name and a (comparatively) long comment, or just a
long class name. Considering there is now no need for a comment and the test
name is actually useful for debugging failed tests easily (you don't need to
"dereference" the short test failure name to get the surrounding comment),
this style is actually a win.

------
javajosh
This is not a code smell, but something larger, and much worse. Java is
fundamentally an imperative language, and these names are evidence of the
disconnect between that nature and what people _think_ Java is.

One can argue that this is the result of ignorance, that "good" Java
programmers will avoid this trap. And yet, for all it's restrictions, it
doesn't give much refactoring guidance. The proliferation of patterns (both
for creation and relation) in Java is a weakness, not a strength, and the
result is monstrosities like this. Training, experience and convention avoids
these traps, but why do we create new languages if not to reduce the amount of
training, experience and convention that a programmer needs to learn in order
to be productive with an environment?

~~~
ww520
I don't see how this name is a problem beyond giving cannon fodder for
language hipsters to rant about Java.

How many programmers have been affected by this internal class? How many
programmers have used it and complain about it?

Java allows long identifier names and gives people the freedom to name however
they like. Why is that a bad thing? You want syntax rules in the language to
force short identifier names? We had those long while back and it's a really
bad idea.

And BTW what is so wrong about imperative? It's simple to learn and simple to
follow. It has solved many problems, given whatever the real world
constraints. Just because functional is the in-thing now doesn't mean
imperative is totally bad.

~~~
javajosh
_> And BTW what is so wrong about imperative?_

Nothing! The problems occur when people think that it's not.

And I really disagree with your hipster comment. You can indeed accomplish any
task with Java, but that is damning with faint praise. The question is whether
or not the environment gives the programmer adequate refactoring pressure to
guide his decisions. Java provides almost no such pressure, resulting in a
mess.

Many problems have been solved in Java despite of this, not because of it.

~~~
ww520
> Nothing! The problems occur when people think that it's not.

I don't really understand what you are trying to get at. Is it wrong or it
isn't?

The hipster comment is spotted on. This post is evident of that attitude. The
OP has to dig up an internal class whose name is probably generated to bash
Java. And your original comment basically went further and claimed this long
class name is the evident of what is so wrong with Java in general.

If there's no pressing pressure to refactor, then it has work well for its
purpose. You want to limit class name to 8 characters to force programmers to
pick shorter name? It's an internal class, for god sake. What's the impact on
99.99% of the programmer out there?

Development is a process of compromise and trade-off. Developers don't have
infinite time and infinite budget to code. They have to pick their battle and
do the more important things.

~~~
javajosh
1\. Java programmers usually don't think of Java as imperative. This leads to
problems.

2\. The phrase you're looking for is "spot on".

3\. Generated code is a code smell. Again, you see a confusion between static
and dynamic behavior.

~~~
ww520
1\. You seem to know what most Java programmers think. What do Java
programmers think of Java as if not imperative? And what is the thing that
they assume Java to be leads to problems? Again what specific problem is the
long class name causing?

2\. Thank you for correcting my grammar. BTW the period goes inside the
quotation marks as in "spot on."

3\. While not often used, generated source code are useful as design calls for
it. Not everything revolves around static and dynamic.

~~~
ygra
2\. Both styles are valid and used (just be consistent about it in a single
body of text). Arguably the period _after_ the quotation marks more closely
matches the actual sentence structure.

------
throwaway64
My personal favourite comes from apple

    
    
        AVPlayer *player = <#A configured AVPlayer object#>;
        
        CALayer *superlayer = <#Get a CALayer#>;
    
        AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player];
        
        [superlayer addSublayer:playerLayer];
    
    

[https://developer.apple.com/library/ios/#documentation/AVFou...](https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayerLayer_Class/Reference/Reference.html)

------
jakubp
I've only touched Java a bit, but AFAIK it has quite strict package hierarchy
system that allows naming and grouping things nicely.

Why then people keep creating long class names in the first place? I get it
that this particular example might be a generated name, but still, why not
just create package hierarchy that represents the code properly?

Also wouldn't using package hierarchies automatically lead to a bit better
design (more modular, more understandable)?

~~~
columbo
I primarily do java work (consulting) for enterprise. I've always seen it as a
combination of convention and time.

There are java applications that have been around for decades. I've worked in
codebases that are over twenty years old. Some of these systems are
responsible for billions of dollars and have been heavily tested (the others
are responsible for billions of dollars and have been barely tested).

Say you are a consultant, and you're working on a shipping application that
has been around since the late 90's and is responsible for moving goods where
the sum total of all items in transport over a year is larger than the GDP of
Taiwan.

In that application there is a Warehouse interface. Simple thing, basically it
has a receive() and distribute() method that moves product from one location
to another (warehouse.receive(truck) or warehouse.distribute(200,truck)).

Around 2000 someone needed to create an edge case because specific warehouses
are only available during specific times of the year. Like black Friday to
Christmas. Usually it is too much overhead to keep all these warehouses
running so they are only open 1/2 the year (this doesn't happen, but work with
me). So someone created class TimedWarehouse that will do this calculation (on
date X no longer receive).

Now it is 2012 and you are just a contractor. The big problem with the
TimedWarehouse is at the end of the year you MUST VACATE ALL GOODS (because
the warehouse is going to shut down). For the last couple of years product has
been lingering in these warehouses keeping them open longer (costing more
money).

The best way to handle this is perhaps a batch process job that sends
emergency shipments as it gets closer to the end of the year. So something
that cleans the timed warehouses out. Now you're just a consultant, you can't
rework the entire framework but you must keep with convention... what to do

TimedWarehouseProcessor (nice... but doesn't indicate that it is only used
towards the end of the year)

TimedWarehouseYearlyCleanout (makes more sense, but is terribly specific, what
about warehouses that are open twice a year)

TimedWarehouseCleanoutManagementUtility (Bingo! More generic sounding, and it
is a 'utility')

Imagine the poor sap who might need to extend that class. The process repeats
over time. More contractors following the rules of convention, larger and
larger class names.

~~~
matwood
So true. Using your example:

AbstractTimedWarehouseCleanoutManagementUtility
TimedWarehouseCleanoutManagementUtilityFactory
TimedWarehouseCleanoutManagementUtilityConfiguration
TimedWarehouseCleanoutManagementUtilityDto etc...

~~~
eclipticplane
I feel violent tendencies just reading that!

------
twp
You've most likely already seen this, but, if not, it's a relevant, great
read: <http://discuss.joelonsoftware.com/default.asp?joel.3.219431>

~~~
LnxPrgr3
It's said that Lisp programmers often work by first building a domain-specific
language for solving their problem, then solving the problem in that new
language.

Some object-oriented programmers do something similar, where their programs
are expressed in a domain-specific language written as an object relationship
graph. Only they skip the part where that language is supposed to make it
easier to solve the problem.

What do I mean? Here's my (somewhat ancient) attempt at parody:
<http://pastebin.com/TyNrvRmB>

It has all the hallmarks of production code I've seen in this style: it's
about 20 times more than the necessary amount of code, it's subtly buggy, and
it needs explanation because what it does is completely non-obvious.

It is arguably _slightly_ easier to extend than the obvious solution, but at a
great cost, and in a silly one-off program at that.

The worst part? This doesn't scream parody in some circles. This is just how
things are done, as if anything less involved is fundamentally broken.

~~~
stcredzero
_> It's said that Lisp programmers often work by first building a domain-
specific language for solving their problem, then solving the problem in that
new language._

This is precisely how good Smalltalkers operated. It was very doable, because
even constructs like conditional logic and "looping" (really iterators) were
just ordinary calls. For example, if you wanted to implement "fuzzy logic" in
Smalltalk it would just take a mere minutes to implement some methods like:

    
    
        ifTrue:ifFalse:ifMaybe:
    

Then define a Maybe class and use it as the Maybe value and park some methods
like that on it. Then this would let you write code like:

    
    
        result
            ifTrue: [ "condition 1" ]
            ifFalse: [ "something else" ]
            ifMaybe: [
                "handle maybe"
            ].

------
anthonyb
Ah, naming things. One of the two hard problems left in Computer Science.

~~~
zainny
I heard on the grapevine that it's NP-complete.

~~~
jiggy2011
That would require knowing when you have your naming correct.

------
ww520
Some people like to document their code with long name instead of comment.
It's an internal class anyway. Why would anyone care?

JDK has a superb auto document building tool to extract all the classes in
JavaDoc and letting people to find internal classes easier.

------
orangethirty
I think Javascript also suffers from something like this: functions inside
functions inside functions inside functions. If Java is the king (queen?) of
horrible naming conventions, Javascript is the prince(ss) of horrible code
structure. It might be why both are named Java...

    
    
        var foo = function(foo, bar){ 
            var bar = function ( function (x) {
               this.something = function (z) {
                return function (y){}}}}};
        
         //or something like that. Only a fool would
           think the code above is real or even correct.

~~~
swang
There is a name for this: callback hell.

------
gkoberger
More information [2007]: [http://www.pushing-pixels.org/2007/11/07/and-the-
longest-jre...](http://www.pushing-pixels.org/2007/11/07/and-the-longest-jre-
class-name-is.html)

------
joshfraser
Or ififtpiftpmbp as I like to call it for short.

~~~
gdg92989
you know... the one that "Actually performs the painting operation."

------
1010011010
When I saw the title I thought, _that has to be java_. If it had included a
"Factory" or "Manager" in there somewhere I would not have needed to look at
the link to verify.

~~~
jrockway
I write classes that are named like "WhateverManager" in Python.

Now if you said "Module" or "Builder", then you might be right.

~~~
riffraff
do you see many classes named *Module in java? This is a sort of disease I
have not experiences yet.

~~~
jrockway
Yes. It's a Guice thing.

------
huskyr
This was obviously generated using the Enterprisify your Java Class Names
tool:

<http://projects.haykranen.nl/java/>

------
endymi0n
I think this Class looks okay, but it's definitely still lacking an
AbstractProxyInstanceFactoryDecorator.

------
bjculk
Never mind the fact that this is in the com.sun package, and as such should
never really have to be dealt with. However, I do agree that anyone who makes
a class name longer than three or four words is somewhat demented.

------
jongalloway2
I'm pretty sure this was generated by a Hidden Markov Model gone haywire.

------
abrkn

        com. sun.
        java. swing.
        plaf
    
        nimbus, Internal
        Frame? Internal Frame!
        Title. Pane...
        Internal Frame.
        Title Pane
        Maximize
        Button Painter.

------
krob
Wow, think they could make that any longer? I mean, I don't think it was long
enough. 78 characters isn't long enough, I think it should be at least 96.

~~~
Deestan
I would go all the way past 140, to prevent people from making fun of it on
Twitter.

------
drawkbox
They should have run it through the class namer: <http://www.classnamer.com/>

------
Cieplak
Reminds me of the FactoryFactoryFactory pattern.

------
dschiptsov
<http://karma-engineering.com/lab/wiki/Programming>

------
bjhoops1
Not sure whether to laugh or cry about this.

------
bbayer
creating inheritance by using name conventions is really good idea!!

------
mudumh
really long name!

------
Evbn
Yes, let's all make fun of Java because it can be used to build (and then
name) things we don't know how to make.

------
Mamady
Why? Because Java is awesome.

But seriously, this just highlights one of the downsides of following "coding
standards" religiously.

~~~
edwinnathaniel
If the upsides are plentiful as opposed to cowboy-development-methodology then
I don't feel bad about it.

~~~
Mamady
I dont have a problem with coding standards. I have a problem with following
something so strictly, even when it makes no sense at all - such as this class
name.

