DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links