Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Solution for verbosity of JAVA - have SQL like ALIAS for Java ?

 
Andy Jack
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I often use verbose names for sake of clarity. Looks like we should have alias for java.
int whatsMyAge = 10;
whatsMyAge AS wma;

what do you think ?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like self explaining names (be it for methods, variables or classes). I don't consider it a problem which demands a solution.

As for:

int whatsMyAge = 10;
whatsMyAge AS wma;


Are you bothered about "whatsMyAge" because it takes longer to type or because it appears verbose while reading code? If it's the former then with the current IDEs, you get auto-completion feature which makes it a non-issue.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12122
30
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I were doing a code review and someone used a variable name "wma", I'd tell them to go back and expand it so I don't have to hunt around to figure out what it means.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic