views:

91

answers:

3

To me, reading long camel cased words can sometimes be a bit frustrating. For example:

aReallyLongCamelCasedMethodNameWhichIsTooSelfDescribing

Now, look at this version:

a_Really_Long_Camel_Cased_Method_Name_Which_Is_Too_Self_Describing

Which version is easier on your eyes? The second one is for mine.

While using Emacs, I stumbled upon a nice minor mode called glasses mode.

Since I'm working primarily with Java, I'm an Eclipse user and I wonder if there is some way to display camel cased words with underscores?

Note that I'm not asking for a way to actually convert camel cased words as described, I'm just looking for a mechanism that works like Emacs' glasses mode in Eclipse.

A regexp to actually do the conversion can be found by googling "Convert camelCase to underscores".

A: 

try to keep your method names descriptive "and" short. If you have really such method names, i would think about it twice before i code it and maybe it is better to use refactoring "extract method" to tile the functionallity, which you can not describe shortly, into more than one method for a better design ;-) "increasing cohesion"

Erhan Bagdemir
I tend to use short and descriptive method names. I asked the question because other peoples' code can contain such overlong method names that are a pain to read even with IDE autocomplete.
darioo
A: 

If you can't find any existing Eclipse plugins, then I would consider writing your own editor extension.

javamonkey79
It's obvious, but it seems to be the only way.
darioo
+1  A: 

Have you considered using Emacs as your Java IDE? I really like Eclipse and the move sounds painful to me too. However, I bump into more and more people that are actually doing it. Just type "emacs ide java" into google.

It's definitely not a move for everyone, but if you know Emacs fairly well it might be a better option than trying to convert emacs features into Eclipse.

User1
I've tried JDEE, but it still lacks the polish of "dedicated" Java IDEs. Since I'm working primarily in enterprisey Java with tons of frameworks and Eclipse plugins for them, I'm afraid productivity would suffer in Emacs. But I'll try it one day and see how it goes.
darioo