Naming Conventions


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Naming Conventions

  1. #1
    Jim Pragit Guest

    Naming Conventions


    Hello,
    I'm teaching myself Java using one of Sam's 'Teach Yourself" books. Coming
    from a VB background, I normally practice a strict form of Hungarian notation.
    However, I've noticed that none of the Java code I have seen uses Hungarian.
    Do Java programmers not use Hungarian? Is there any resource explaining
    or recommending naming conventions in Java?

    - Jim

  2. #2
    Patrick Lentz Guest

    Re: Naming Conventions


    try here Jim. You'll find not just inof about naming conventions but also
    about codingstyle.

    http://java.sun.com/docs/codeconv/ht...nvTOC.doc.html

    "Jim Pragit" <James.Pragit@BakerNet.com> wrote:
    >
    >Hello,
    > I'm teaching myself Java using one of Sam's 'Teach Yourself" books. Coming
    >from a VB background, I normally practice a strict form of Hungarian notation.
    > However, I've noticed that none of the Java code I have seen uses Hungarian.
    > Do Java programmers not use Hungarian? Is there any resource explaining
    >or recommending naming conventions in Java?
    >
    >- Jim



  3. #3
    Paul Clapham Guest

    Re: Naming Conventions

    The "Hungarian" notation is the one where you prefix a variable's name with
    a code indicating the type of variable, e.g. iCounter for an integer and
    sName for a string, right? How would you extend this to cover the several
    hundred (thousands of) classes that exist in Java2? I guess you could have
    the prefix f for float and fi for File and fr for FileReader and fos for
    FileOutputStream and... you see what I mean? I have used this type of
    notation when writing in VB and I ended up using the prefix obj for any
    object that wasn't a primitive type. That's OK in VB where you don't have
    too many types of object but pointless in Java. So that's why I don't use
    the Hungarian notation in Java. Of course you can choose any notation you
    think is helpful to you and other readers of your program.

    Jim Pragit <James.Pragit@BakerNet.com> wrote in message
    news:393fc2ce$1@news.devx.com...
    >
    > Hello,
    > I'm teaching myself Java using one of Sam's 'Teach Yourself" books.

    Coming
    > from a VB background, I normally practice a strict form of Hungarian

    notation.
    > However, I've noticed that none of the Java code I have seen uses

    Hungarian.
    > Do Java programmers not use Hungarian? Is there any resource explaining
    > or recommending naming conventions in Java?
    >
    > - Jim




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center