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


Groups > comp.lang.java.programmer > #19054

Re: nomenclature

Received by 10.66.85.1 with SMTP id d1mr5559480paz.36.1349209348064; Tue, 02 Oct 2012 13:22:28 -0700 (PDT)
Received by 10.68.194.133 with SMTP id hw5mr754205pbc.17.1349209348050; Tue, 02 Oct 2012 13:22:28 -0700 (PDT)
Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!newsfeed.news.ucla.edu!usenet.stanford.edu!kr7no1975997pbb.0!news-out.google.com!t10ni23601408pbh.0!nntp.google.com!kt20no7197997pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Tue, 2 Oct 2012 13:22:27 -0700 (PDT)
In-Reply-To <h_Has.3630$w_2.159@newsfe12.iad>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.29
References <70c1d214-71ac-478d-95d7-a5984c3dc180@googlegroups.com> <h_Has.3630$w_2.159@newsfe12.iad>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <887fd0ae-c207-4298-a738-ae43fda10be1@googlegroups.com> (permalink)
Subject Re: nomenclature
From Lew <lewbloch@gmail.com>
Injection-Date Tue, 02 Oct 2012 20:22:28 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:19054

Show key headers only | View raw


Daniel Pitts wrote:
> bob smith wrote:
>> Is this sort of thing bad practice (using parameter names that are the same as
>> my field names in the constructor)?> 
> 
>> public My_Rectangle(double x, double y, double width, double height) {
>> 		this.x=x;
>> 		this.y=y;
>> 		this.width=width;
>> 		this.height=height;
>>
>> }
>>
> 
> If you are considering objecting because it requires "this.", I actually 
> find that to be a useful syntax, and my constructors (and setters) use 
> it, even if there isn't a name collision with local symbols.
> 
> Most experienced Java programmers will take more exception with the 
> class name.  Java convention would suggest MyRectangle, not My_Rectangle.

http://www.oracle.com/technetwork/java/codeconv-138413.html

> I've seen people try to avoid "name collisions", with ugly results. 
> Underscores before members, or before parameters, or other such 
> conventions.  Ugly... ugly.

-- 
Lew

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


Thread

nomenclature bob smith <bob@coolfone.comze.com> - 2012-10-02 12:51 -0700
  Re: nomenclature Arne Vajhøj <arne@vajhoej.dk> - 2012-10-02 15:58 -0400
  Re: nomenclature Patricia Shanahan <pats@acm.org> - 2012-10-02 13:05 -0700
  Re: nomenclature Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-02 13:18 -0700
    Re: nomenclature Lew <lewbloch@gmail.com> - 2012-10-02 13:22 -0700
      Re: nomenclature Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-10-02 13:47 -0700
  Re: nomenclature markspace <-@.> - 2012-10-02 14:27 -0700
  Re: nomenclature Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-10-02 17:38 -0400
    Re: nomenclature Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-10-05 16:38 +0000
      Re: nomenclature Arne Vajhøj <arne@vajhoej.dk> - 2012-10-05 20:28 -0400
  Re: nomenclature Roedy Green <see_website@mindprod.com.invalid> - 2012-10-03 16:02 -0700

csiph-web