Re: Newb Naming Convention Question



Frank Stallone wrote:
On Mon, 07 Apr 2008 15:35:15 -0400, JB wrote:

In the couple of languages I've been using the most, it has been
standard practice to use some type of Hungarian Notation.

This does not seem to be the case with most of the java I've seen so far
as I've been trying to learn. Is there any "standard" hungarian for
Java - I like using it.

Hope this helps.

http://jdj.sys-con.com/read/36533.htm (see the bottom with the prefix suggestions)

Also, here is some advice as to why it's not ideal to use:
http://forum.java.sun.com/thread.jspa?threadID=657725&messageID=3864893

Java differs from many languages because it has more or less standard code conventions, created by SUN and used, as far as I know, more or less by everybody. Look here:
http://java.sun.com/docs/codeconv/
These conventions doesn't use Hungarian notation, and so very few Java programmers use them.

It is very different from C++, where there are many competing standards, some of which (Microsoft) use Hungarian notation. I think, in Microsoft case there was sense in Hungarian notation - because in early Windows (and in current Windows also) most types were the same (integers or handlers) - and it was impossible for compiler to distinguish them. So Hungarian notation helped to ensure type safety.

In Java case type safety is insured by language (most variables have clearly defined types), and type errors are very quickly shown by compiler or in run time, so you can free variable names from easily obtained information.
.



Relevant Pages

  • Re: Newb Naming Convention Question
    ... standard practice to use some type of Hungarian Notation. ... Java - I like using it. ... here is some advice as to why it's not ideal to use: ...
    (comp.lang.java)
  • Re: Mixed case?
    ... brained enthusiasts. ... My previous job required Hungarian notation for all code, not just C, ... but Java as well--which is even more ridiculous as Java is strongly ...
    (comp.lang.c)
  • Newb Naming Convention Question
    ... In the couple of languages I've been using the most, it has been standard practice to use some type of Hungarian Notation. ... This does not seem to be the case with most of the java I've seen so far as I've been trying to learn. ...
    (comp.lang.java)
  • Re: These are identical, right? char const* and const char*
    ... > embedded systems and many of the systems it runs on don't have things like ... Java was originally an embedded systems programming language, ... > aware that the omission of many things from the standard is inconvenient ...
    (comp.lang.cpp)
  • Re: Differences between C++ and Java
    ... > are *implementation* defined and the standard also specifies the ... > "In Java, garbage collection of unreferenced objects is automatic. ... > C++, you manually manage memory. ... > provide third party libraries that work just as well, ...
    (comp.lang.java.programmer)