• Post Reply Bookmark Topic Watch Topic
  • New Topic

java's method name length and obfuscation  RSS feed

 
partho mukherjee
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me is there any harm in giving long method names in java classes in order to make them more understandable? somebody has told me that a problem of 'obfuscation' affects the performance of the code with long method names(more than 15 characters)? Now what the hell does 'obfuscation' mean?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would not hesitate to write for human readers first, optimization somewhere way down the list. I'm not aware of any performance hit with long names. Maybe someone imagined something around dynamic lookup and class sizes?
 
partho mukherjee
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the code i am talking about would be of huge bulk, written at one place and deployed somewhere else.. so does that have something to do with keeping down the method name lengths to 15 characters?
 
Ardnivar Rutnug
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obfuscation I never heard in this context. Obfuscator we have used to encrypt the class files so that our applets cannot be jad completely.

I never heard any performance issue with length of method names, I hope you can use happily.

Ard
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obfuscation is a useless passtime of people who think their code is so brilliant that other will want to steal it who are themselves not smart enough to find ways around obfuscators.

IOW, don't bother with it.

Any halfway decent obfuscator won't give a gnat's ass about what method or field names you use though, it'll just replace them all with something nonsensical of its own devising.
Most likely it will mean disaster for your maintenance programmers (who may be you).
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard of obfuscation being used to reduce the size of class files, replacing many unnecessarilyLongMethodVariableAndClassNames with much shorter, cryptic names. I don't know how common this actually is - it probably only matters in J2ME applications. I suspect the effect is usually minor at best.
 
Ardnivar Rutnug
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question here is not about Obfuscation useful or not or a creates difficulties to unwise or not.......

"Can the method names be long ? somebody told long names have Obfuscator issues, is it true?"



Wenting may be true, I am not supporter for Obfuscator, I dont mind anybody to take my code, but my company minds.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!