Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.lang.java.programmer Subject: Re: problems with editable JList Date: 19 Feb 2014 14:10:37 GMT Organization: None Lines: 81 Message-ID: References: X-Trace: individual.net Vqsrd5pZXMXc9ZSfT+KFlQZNWYeF7ReqH4UqUwZMhxEN9Uzhb0 X-Orig-Path: not-for-mail Cancel-Lock: sha1:kyd/GYvYRghH4NugSs7vVL5Et8Q= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: csiph.com comp.lang.java.programmer:27554 In article , Lew wrote: > 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? *I* knew. What about other readers? C'mon, you're the stickler for following conventions, and isn't it a convention that Usenet posts should be, as much as feasible, self-contained? (I begin to believe that the people who chide you for being overly argumentative have a point. But then there's the bit of flattery later. Hm.) > 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. *But I don't* (have it in front of me): If you check headers, you'll notice that I'm using the very old trn, which as far as I know does not provide any easy way to display two posts at the same time, and while I do usually have saved copies of previous posts in some other window-or-the-like .... Well, no, no one needs to hear details of my old-school-to-a-fault tools setup. The point is that you could save all readers some trouble by quoting *one line*. > Especially in your case, > as you have a history in this newsgroup of knowing what you're about. Flattery will .... something. > > "and why not? isn't the relevent [sic] convention that constants have > > all-caps names?" Good (if irritating) catch on the spelling mistake. I know better. > > 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. The variable I named "DEBUG" is a boolean, so I don't quite get how a convention for naming references to mutable objects applies. > > 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. (I don't really know why I brought that up, since all-caps variable names are not idiomatic in Scala. Just sayin', maybe.) > 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. > Okay. How is that relevant .... -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.