Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #873

Re: Hungarian Notation and Java

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!r5g2000prf.googlegroups.com!not-for-mail
From lewbloch <lewbloch@gmail.com>
Newsgroups comp.lang.java.help
Subject Re: Hungarian Notation and Java
Date Thu, 14 Jul 2011 17:30:46 -0700 (PDT)
Organization http://groups.google.com
Lines 41
Message-ID <dd997653-1bbf-4f9c-aec1-aa1ef61b699c@r5g2000prf.googlegroups.com> (permalink)
References <b4d806bc-4f94-4655-8699-5e1c32e111ed@q1g2000vbj.googlegroups.com> <1cwmuo587hrfb.dlg@kimmeringer.de>
NNTP-Posting-Host 216.239.45.82
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1310689846 2909 127.0.0.1 (15 Jul 2011 00:30:46 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Fri, 15 Jul 2011 00:30:46 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info r5g2000prf.googlegroups.com; posting-host=216.239.45.82; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order ASELCHRU
X-HTTP-UserAgent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:873

Show key headers only | View raw


On Jul 14, 9:45 am, Lothar Kimmeringer <news200...@kimmeringer.de>
wrote:
> Steve wrote:
> > Is there any reason left to use Hungarian notation with Java?
>
> I asked that myself - 10 years ago - and the first time I changed
> the type of a variable from int to double I answered it to myself
> with a simple: no
>
> Regards, Lothar
> --
> Lothar Kimmeringer                E-Mail: spamf...@kimmeringer.de
>                PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
>
> Always remember: The answer is forty-two, there can only be wrong
>                  questions!

Same here, only Java wasn't in the marketplace yet, and I didn't wait
to try it to conceive of that scenario.

It's a fundamental mistake to name anything in terms of implementation
type rather than domain type.  For example, a bunch of invoices stored
as a 'List<String>' named 'slInvoices' is obscure, uninformative and
trenchantly stupid since the 'sl' tells nothing about the role of the
variable in the algorithm.  A much better name is 'invoices', and it
can be a 'List<String>' or 'Set<Invoice>' as the implementation
demands.  (The latter most likely is better.)  The name reflects its
purpose, not its irrelevant implementation type.

One of the core principles of object-oriented programming is to *hide*
implementation.  Hungarian notation (as commonly practiced) is the
stupid antithesis of that.

This is a very, very old debate and the winner was decided a looong
time ago.
<http://lmgtfy.com/?q=Hungarian+notation+usefulness>

--
Lew

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Hungarian Notation and Java Steve <tinker123@gmail.com> - 2011-07-13 07:46 -0700
  Re: Hungarian Notation and Java lewbloch <lewbloch@gmail.com> - 2011-07-13 08:47 -0700
  Re: Hungarian Notation and Java markspace <-@.> - 2011-07-13 09:23 -0700
  Re: Hungarian Notation and Java Roedy Green <see_website@mindprod.com.invalid> - 2011-07-13 15:33 -0700
  Re: Hungarian Notation and Java Lothar Kimmeringer <news200709@kimmeringer.de> - 2011-07-14 18:45 +0200
    Re: Hungarian Notation and Java lewbloch <lewbloch@gmail.com> - 2011-07-14 17:30 -0700
  Re: Hungarian Notation and Java Travers Naran <tnaran@gmail.com> - 2011-07-17 22:06 -0700

csiph-web