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


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

Re: problems with editable JList

Newsgroups comp.lang.java.programmer
Date 2014-02-18 16:07 -0800
References <bmepjbFoa1fU1@mid.individual.net> <bmf86bFrgs5U1@mid.individual.net> <ldtqtd$8e1$1@dont-email.me> <e1bf45fa-b802-4cf5-a16a-37cfd1c76696@googlegroups.com> <bmh31oF8i0qU2@mid.individual.net>
Message-ID <b6b3f228-9be0-43e7-8715-5964b6189b79@googlegroups.com> (permalink)
Subject Re: problems with editable JList
From Lew <lewbloch@gmail.com>

Show all headers | View raw


blmblm @ myrealbox. com wrote:
> Lew wrote:
>> Also, 'DEBUG' does not follow the Java naming conventions. 
> 
> Wouldn't this comment make more sense if you quoted the single
> line that declares the variable in question?  my first thought was

I'm sorry, it's your code. You didn't know to look where you declared the variable in question?

Where else would you look, then?

No, it wouldn't make more sense if I quoted the code that you already have in front of you.
I expect you to be able to follow that elementary trail without difficulty. Especially in your case,
as you have a history in this newsgroup of knowing what you're about.

> "and why not?  isn't the relevent [sic] convention that constants have
> all-caps names?"
> 
> But then if I look at the code, um, well, that may have been my
> intent, but it's not what I wrote, is it?  I should have also
> have declared it final, yes?  Well, my only defense (such as it is)

'final' by itself is not enough to make something a constant, or even immutable.

A 'final' reference to a mutable object should be spelled not with all-caps but in the 
normal camel case.

> is that lately I've been writing a lot more Scala than Java, and
> it's surprising (to me anyway) how quickly one adopts new habits.

The Java Coding Conventions suggest spelling constant variables in all caps. 
I extend that to 'final' references to immutable objects, even though they are not 
semantically equivalent to constant variables. Most people do this. However it is 
misleading when they go a step further and spell all 'final' variables with all caps.

-- 
Lew

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


Thread

problems with editable JList blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2014-02-17 15:53 +0000
  Re: problems with editable JList markspace <markspace@nospam.nospam> - 2014-02-17 10:33 -0800
    Re: problems with editable JList blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2014-02-17 20:02 +0000
      Re: problems with editable JList markspace <markspace@nospam.nospam> - 2014-02-17 12:19 -0800
        Re: problems with editable JList Lew <lewbloch@gmail.com> - 2014-02-18 02:31 -0800
          Re: problems with editable JList blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2014-02-18 12:46 +0000
            Re: problems with editable JList Lew <lewbloch@gmail.com> - 2014-02-18 16:07 -0800
              Re: problems with editable JList blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2014-02-19 14:10 +0000
        Re: problems with editable JList blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2014-02-18 12:39 +0000

csiph-web