Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Craig Daniels   on Oct 05 In Java Category.

  
Question Answered By: Arthur Cole   on Oct 05

The prefixing of the variable type is part of the
hungarian convention. Adding the scope to a variable name
was something put forward by microsoft. You'll see
these conventions in java  code , for the most part, by
those moving from VC++, C++ or VB to Java. <br><br>I
peronally don't find it useful. If I'm casually looking
through code I'm not going to have any more of a clue as
to what is actually going on by having types
prefixed to a varaible names. And when you look closer
it's pretty evident what datatype your working with
without any additional nomenclature. <br><br>As for
adding a scoping prefix I've personally hav not done
that but I could see some benefit. The only reason I
haven't is because I guess my general programming
practice. That being that when I'm writing, for example a
class, I'm either dealing with a stateful or a statless
object. If it's stateless everything is pretty much
method local while if it's stateful I'm dealing
primarily with memeber variables using a bare minimum of
local variables.<br><br>Other than the coding
conventions provided by sun there is a group of experienced
developers at Rogue Wave who put out conventions which are
generally accepted by the java community with open
arms:<br><br>www.ambysoft.com/...ngStandards.html<br>http://www.amazon.com/.../sr=8\
-1/ref=sr_8
_71_1/103-9033500-0132657<br><br>On a previous project a few years back the
architect
of the project purchased a copy of that book and
handed it to everyone on the team. I've been using it
ever since, and you'll find a lot of people who have
been using the language for a while will be as well.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on java threads & oracle database Or get search suggestion and latest updates.


Tagged: