This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

java's method name length and obfuscation  RSS feed

 
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?
 
(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?
 
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
 
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).
 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!