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


Groups > comp.lang.java.programmer > #11201 > unrolled thread

Curious compiler warning

Started byNovice <novice@example..com>
First post2012-01-11 01:51 +0000
Last post2012-01-11 21:10 +0000
Articles 17 on this page of 57 — 17 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Curious compiler warning Novice <novice@example..com> - 2012-01-11 01:51 +0000
    Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-10 18:10 -0800
      Re: Curious compiler warning glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 02:36 +0000
        Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-10 19:03 -0800
          Re: Curious compiler warning glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 07:50 +0000
            Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-10 23:57 -0800
          Re: Curious compiler warning Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-11 05:47 -0400
            Re: Curious compiler warning glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 13:25 +0000
              Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-11 06:58 -0800
                Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-11 07:01 -0800
                Re: Curious compiler warning Patricia Shanahan <pats@acm.org> - 2012-01-11 10:03 -0800
                  Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-11 23:30 -0800
                Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-11 18:10 -0800
                  Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-11 23:32 -0800
                    Re: Curious compiler warning Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-01-12 01:44 -0600
                      Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 07:42 -0800
                        Re: Curious compiler warning Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-01-12 10:51 -0600
                      Re: Curious compiler warning Patricia Shanahan <pats@acm.org> - 2012-01-12 07:50 -0800
                        Re: Curious compiler warning Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-01-12 10:54 -0600
                        Re: Curious compiler warning Wanja Gayk <brixomatic@yahoo.com> - 2012-01-21 12:52 +0100
                    Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-12 11:51 -0800
                      Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 20:58 -0800
          Re: Curious compiler warning "Gavino" <invalid@invalid.invalid> - 2012-01-11 20:05 +0100
            Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 07:47 -0800
          Re: Curious compiler warning Wanja Gayk <brixomatic@yahoo.com> - 2012-01-21 12:52 +0100
            Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-21 12:13 -0800
      Re: Curious compiler warning Novice <novice@example..com> - 2012-01-11 04:55 +0000
        Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-10 21:46 -0800
        Re: Curious compiler warning glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 07:55 +0000
        Re: Curious compiler warning Roedy Green <see_website@mindprod.com.invalid> - 2012-01-11 01:35 -0800
          Re: Curious compiler warning "Gavino" <invalid@invalid.invalid> - 2012-01-11 20:05 +0100
            Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-11 18:18 -0800
              Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 07:55 -0800
                Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-12 11:59 -0800
              Re: Curious compiler warning Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-13 00:02 +0000
                Re: Curious compiler warning Patricia Shanahan <pats@acm.org> - 2012-01-12 16:11 -0800
                  Re: Curious compiler warning Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-13 01:31 +0000
            Re: Curious compiler warning Roedy Green <see_website@mindprod.com.invalid> - 2012-01-11 18:26 -0800
              Re: Curious compiler warning Patricia Shanahan <pats@acm.org> - 2012-01-11 19:01 -0800
                Re: Curious compiler warning Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-11 23:23 -0500
                  Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 08:00 -0800
              Re: Curious compiler warning Wanja Gayk <brixomatic@yahoo.com> - 2012-01-21 12:52 +0100
            Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 07:50 -0800
          Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-11 18:14 -0800
            Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 08:05 -0800
              Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-12 12:02 -0800
    Re: Curious compiler warning Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-10 21:11 -0500
      Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-10 18:17 -0800
      Re: Curious compiler warning bugbear <bugbear@trim_papermule.co.uk_trim> - 2012-01-11 16:10 +0000
      Re: Curious compiler warning Lars Enderin <lars.enderin@telia.com> - 2012-01-11 20:45 +0100
        Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 08:09 -0800
        Re: Curious compiler warning Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2012-01-12 18:14 +0200
        Re: Curious compiler warning Wanja Gayk <brixomatic@yahoo.com> - 2012-01-21 12:52 +0100
        Re: Curious compiler warning David Lamb <dalamb@cs.queensu.ca> - 2012-01-21 09:12 -0500
      Re: Curious compiler warning Gene Wirchenko <genew@ocis.net> - 2012-01-11 18:21 -0800
      Re: Curious compiler warning Lew <noone@lewscanon.com> - 2012-01-12 08:08 -0800
    Re: Eclipse 3.7.1 compiler warning v_borchert@despammed.com (Volker Borchert) - 2012-01-11 21:10 +0000

Page 3 of 3 — ← Prev page 1 2 [3]


#11270

FromLew <noone@lewscanon.com>
Date2012-01-12 08:00 -0800
Message-ID<jen036$3mf$1@news.albasani.net>
In reply to#11258
Eric Sosman wrote:
> On 1/11/2012 10:01 PM, Patricia Shanahan wrote:
>> Roedy Green wrote:
>>> Gavino wrote, quoted or indirectly quoted someone who said :
>>>
>>>> It's nothing to do with not using the result - in the original
>>>> example, the
>>>> result *was* used. It's simply that assigning to a method parameter
>>>> value is
>>>> considered 'bad style', that's all.
>>>
>>> Normally I mark my parms final, but have modified them. I don't
>>> recall ever seeing that warning. I guess it does not show up in
>>> IntelliJ.
>>
>> I believe the warning originally came from Eclipse. The Eclipse style
>> rules are not carved in stone. A programmer who does not agree with the
>> default settings should change them.

Correct.  This point does bear repeating.

> To my way of thinking, a method (or constructor) parameter is
> nothing more nor less than a local variable, taking its initial
> value from the caller's argument. One characteristic of a variable
> is that it can vary; that's why we don't call them invariables. I
> can see no reason to preserve a parameter's initial value in bronze
> like Baby's first shoes, and Eclipse's assertion that failing to
> bronze a parameter "is generally considered poor style" is merely
> noise, Proof By Iterated Assertion. (In the passive voice, which
> is generally considered poor style.)
>
> If anyone, anywhere, anyhow, has evidence that bronzing the
> parameters improves them, let the evidence (and not just the PBIA)
> be produced. Until then, I'll leave my parameters unbronzed and
> still wearable.

+1

I don't often change parameter variables, but when I do there's a need to. 
Certain algorithms can benefit from doing so, and I personally am so steeped 
in Java's call-by-value world that I don't acknowledge the risk feared by 
those who favor the rule.  OTOH, it's almost never needed.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11562

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-01-21 12:52 +0100
Message-ID<MPG.2984bfff2970e619896e4@202.177.16.121>
In reply to#11256
In article <p4hsg7p6ugh8qaqph826pc7spv47mott0a@4ax.com>, 
see_website@mindprod.com.invalid says...
> 
> On Wed, 11 Jan 2012 20:05:25 +0100, "Gavino" <invalid@invalid.invalid>
> wrote, quoted or indirectly quoted someone who said :
> 
> >It's nothing to do with not using the result - in the original example, the
> >result *was* used. It's simply that assigning to a method parameter value is
> >considered 'bad style', that's all.
> 
> Normally I mark my parms final, but have modified them.  I don't
> recall ever seeing that warning.  I guess it does not show up in
> IntelliJ.

I use to mark all my parameters final (except perhapt for usenet 
postings, but that's an 80 char limit issue, we have wide screen 
displays for god's sake) and if I think that in one particular case it's 
clearer to just modify the parameter and go with that than to introduce 
a new variable, it will directly show because there's a parameter 
without a "final" raising my attention.
This hybrid approach has, so far, served me best.

Kind regards,
Wanja



-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#11267

FromLew <noone@lewscanon.com>
Date2012-01-12 07:50 -0800
Message-ID<jemvff$1nl$2@news.albasani.net>
In reply to#11236
Gavino wrote:
> "Roedy Green" spewed ...
>> Novice wrote, quoted or indirectly quoted someone who said :
>>
>>> I'm just wondering why the compiler is so offended by "start--"....
>>
>> The compiler worries when you compute something and don't use the
>> result.  If you had said    bar( --start )    it would be happy since
>> the incremented start is passed to bar.
>
> No. This would produce the same warning.

As earlier mentioned.

> It's nothing to do with not using the result - in the original example, the
> result *was* used. It's simply that assigning to a method parameter value is
> considered 'bad style', that's all.

In the original example, the result was not used.  The side effect was used, 
but superfluously because it didn't need to be stored to be used.  The problem 
wasn't that the target was a method parameter, in that particular instance, 
but that an assignment was performed at all.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11253

FromGene Wirchenko <genew@ocis.net>
Date2012-01-11 18:14 -0800
Message-ID<segsg7dvn42d648rjij22ln0ugisbudult@4ax.com>
In reply to#11222
On Wed, 11 Jan 2012 01:35:28 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote:

>On Wed, 11 Jan 2012 04:55:00 +0000 (UTC), Novice <novice@example..com>
>wrote, quoted or indirectly quoted someone who said :
>
>>I'm just wondering why the compiler is so offended by "start--".... 
>
>The compiler worries when you compute something and don't use the
>result.  If you had said    bar( --start )    it would be happy since
>the incremented start is passed to bar.

     So why does it not just suppress the corresponding object?

>It thinks perhaps you forgot to use the result, on made a typo and
>used the wrong variable.  It figures you are addled in some way or you
>would not be computing values you did not need.  If you meant it fine,
>that's why it is just a warning. There is no rule in  Java you MUST
>use every result.

     But the compiler message is pushing it that way.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#11271

FromLew <noone@lewscanon.com>
Date2012-01-12 08:05 -0800
Message-ID<jen0ci$4eh$1@news.albasani.net>
In reply to#11253
Gene Wirchenko wrote:
> Roedy Green wrote:
>> Novice wrote, quoted or indirectly quoted someone who said :
>>> I'm just wondering why the compiler is so offended by "start--"....
[where 'start' is a method parameter]
>>
>> The compiler worries when you compute something and don't use the
>> result.  If you had said    bar( --start )    it would be happy since
>> the incremented start is passed to bar.

No, that's not true.  The Eclipse warning about modifying a parameter has 
nothing to do with use of the result.  Please do not confuse the newbies.

>       So why does it not just suppress the corresponding object?
>
>> It thinks perhaps you forgot to use the result, on made a typo and
>> used the wrong variable.  It figures you are addled in some way or you
>> would not be computing values you did not need.  If you meant it fine,
>> that's why it is just a warning. There is no rule in  Java you MUST
>> use every result.

Red herring.  The message is simply about assignment to a method parameter, in 
this case, and has absolutely nothing at all whatsoever to do with forgetting 
to use the result, or making a typo, or using the wrong variable.  It is no 
more useful to provide this kind of misinformation that it was for Lucy van 
Pelt (in the /Peanuts/ cartoon strip) to tell her younger brother that 
telephone poles were specially bred trees with short, stubby little branches.

>       But the compiler message is pushing it that way.

No, it isn't.  The compiler message in this case is not "pushing" for 
anything, least of all for using the results of an assignment.  It is simply a 
checkmark the OP set to warn (or error) if there is an assignment to a method 
parameter.  That's it.  Period.  Drop the myths, personifications and 
superstitions.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11288

FromGene Wirchenko <genew@ocis.net>
Date2012-01-12 12:02 -0800
Message-ID<cveug7h735i5a82h8vqfs22qhm30ok26ro@4ax.com>
In reply to#11271
On Thu, 12 Jan 2012 08:05:41 -0800, Lew <noone@lewscanon.com> wrote:

>Gene Wirchenko wrote:

[snip]

>>       But the compiler message is pushing it that way.
>
>No, it isn't.  The compiler message in this case is not "pushing" for 
>anything, least of all for using the results of an assignment.  It is simply a 
>checkmark the OP set to warn (or error) if there is an assignment to a method 
>parameter.  That's it.  Period.  Drop the myths, personifications and 
>superstitions.

     How often have you read that compiler warnings should all be
looked at?

     We have personification in English.  It is useful to avoid
verbiage.  I could have written the "pushing" statement without it,
but then the statement would have been much longer.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#11207

FromEric Sosman <esosman@ieee-dot-org.invalid>
Date2012-01-10 21:11 -0500
Message-ID<jeir4m$qma$1@dont-email.me>
In reply to#11201
On 1/10/2012 8:51 PM, Novice wrote:
> I'm getting an odd compiler warning that I don't really understand. I
> wonder if anyone can enlighten me on the meaning of this message.
> Basically, I'm not sure what the compiler's problem is with what I'm doing
> or the best way to make it happy.
>
> I've got a fairly simply method name foo() that takes two parameters, ints
> called start and finish. During this method, I decrement start and finish
> and then calls another method, bar(),

     Pretty stupid method names.

     Knew a guy once (this sounds crazy, but it's a true story) who
had a hard time inventing variable names.  So he wrote himself a
little program to generate random names and printed out a sheet of
a few hundred such.  Thereafter, any time he needed a variable name
and was stuck for a good idea he'd just grab his printout and take
the next random name -- crossing it off so as not to re-use it and
create confusion.  Result: No one could read his code, not even he.

> passing the decremented versions of
> start and finish. For some reason, the compiler objects to the statements
> where I decrement start and finish and says "the parameter should not be
> assigned". I'm running Eclipse 3.7.1 with a 1.6.18 JDK.
>
> So here's what the code looks like:
>
> public static int foo(int start, int finish) {
>
> /* Other stuff */
>
>    start--;
>    finish--;
>
>    bar(start, finish);
> }
>
> It's the start--; and finish--; lines that are raising the warnings.
>
> What exactly is wrong with doing that? And what is the best way to make the
> compiler happy about that code?

     There's absolutely nothing wrong with it; Eclipse is acting
like a nervous maiden aunt, as usual.

     Somewhere in Eclipse's configuration menus there might be a way
to tell it to stop worrying about monsters under the bed.  (It'll
probably be on a menu whose color scheme is dark blue on jet black.)
All I can suggest is that you search for that menu, and hope against
hope that it actually exists.

     If you can't find anti-anxiety medicine for Eclipse, consider
NetBeans.

-- 
esosman@ieee-dot-org.invalid

[toc] | [prev] | [next] | [standalone]


#11208

FromLew <noone@lewscanon.com>
Date2012-01-10 18:17 -0800
Message-ID<jeirev$9ou$1@news.albasani.net>
In reply to#11207
On 01/10/2012 06:11 PM, Eric Sosman wrote:
> On 1/10/2012 8:51 PM, Novice wrote:
>> I'm getting an odd compiler warning that I don't really understand. I
>> wonder if anyone can enlighten me on the meaning of this message.
>> Basically, I'm not sure what the compiler's problem is with what I'm doing
>> or the best way to make it happy.
>>
>> I've got a fairly simply method name foo() that takes two parameters, ints
>> called start and finish. During this method, I decrement start and finish
>> and then calls another method, bar(),
>
> Pretty stupid method names.
>
> Knew a guy once (this sounds crazy, but it's a true story) who
> had a hard time inventing variable names. So he wrote himself a
> little program to generate random names and printed out a sheet of
> a few hundred such. Thereafter, any time he needed a variable name
> and was stuck for a good idea he'd just grab his printout and take
> the next random name -- crossing it off so as not to re-use it and
> create confusion. Result: No one could read his code, not even he.
>
>> passing the decremented versions of
>> start and finish. For some reason, the compiler objects to the statements
>> where I decrement start and finish and says "the parameter should not be
>> assigned". I'm running Eclipse 3.7.1 with a 1.6.18 JDK.
>>
>> So here's what the code looks like:
>>
>> public static int foo(int start, int finish) {
>>
>> /* Other stuff */
>>
>> start--;
>> finish--;
>>
>> bar(start, finish);
>> }
>>
>> It's the start--; and finish--; lines that are raising the warnings.
>>
>> What exactly is wrong with doing that? And what is the best way to make the
>> compiler happy about that code?
>
> There's absolutely nothing wrong with it; Eclipse is acting
> like a nervous maiden aunt, as usual.

No, there is something wrong with it.  It's a wasted assignment

> Somewhere in Eclipse's configuration menus there might be a way
> to tell it to stop worrying about monsters under the bed. (It'll
> probably be on a menu whose color scheme is dark blue on jet black.)
> All I can suggest is that you search for that menu, and hope against
> hope that it actually exists.
>
> If you can't find anti-anxiety medicine for Eclipse, consider
> NetBeans.

You can tune the warning levels in Eclipse, including telling it not to fret 
over assignments to parameters.  Here, though, the question is what the heck 
assigning to the variables accomplishes.  The answer is "nothing useful" and 
the OP should heed Eclipse's advice.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11228

Frombugbear <bugbear@trim_papermule.co.uk_trim>
Date2012-01-11 16:10 +0000
Message-ID<R-udnVqWZ6zsKZDSnZ2dnUVZ7radnZ2d@brightview.co.uk>
In reply to#11207
Eric Sosman wrote:

>
> Pretty stupid method names.
>
> Knew a guy once (this sounds crazy, but it's a true story) who
> had a hard time inventing variable names. So he wrote himself a
> little program to generate random names and printed out a sheet of
> a few hundred such. Thereafter, any time he needed a variable name
> and was stuck for a good idea he'd just grab his printout and take
> the next random name -- crossing it off so as not to re-use it and
> create confusion. Result: No one could read his code, not even he.

Did you ever encounter 'C shroud" from Gimpel?

  BugBear

[toc] | [prev] | [next] | [standalone]


#11239

FromLars Enderin <lars.enderin@telia.com>
Date2012-01-11 20:45 +0100
Message-ID<4F0DE6C0.7060403@telia.com>
In reply to#11207
2012-01-11 17:11, Stefan Ram skrev:
> Eric Sosman <esosman@ieee-dot-org.invalid> writes:
>>> and then calls another method, bar(),
>> Pretty stupid method names.
> 
>   They are not only stupid. But »*oo« possible was
>   derived directly from indecent wording. 
>   So, I consider usage of such names to be substandard
>   and rude when writing for an unknown audience.

Prissy. Foo, bar, baz are time-honoured dummy names.

>   When I have to use meaningless place holder names, 
>   I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
>   and so on.
> 

Could you please stop using German quotes (»...«)?

-- 
Lars Enderin

[toc] | [prev] | [next] | [standalone]


#11273

FromLew <noone@lewscanon.com>
Date2012-01-12 08:09 -0800
Message-ID<jen0jt$4eh$3@news.albasani.net>
In reply to#11239
Lars Enderin wrote:
> Stefan Ram skrev:
>>    When I have to use meaningless place holder names,
>>    I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
>>    and so on.
>>
>
> Could you please stop using German quotes (»...«)?

That seems petty.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11274

FromJussi Piitulainen <jpiitula@ling.helsinki.fi>
Date2012-01-12 18:14 +0200
Message-ID<qotpqeoyk22.fsf@ruuvi.it.helsinki.fi>
In reply to#11239
Lars Enderin writes:

> 2012-01-11 17:11, Stefan Ram skrev:
> 
> >   When I have to use meaningless place holder names, 
> >   I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
> >   and so on.
> > 
> 
> Could you please stop using German quotes (»...«)?

They are a smart thing to use to talk about Java code
because they do not look like Java code.

[toc] | [prev] | [next] | [standalone]


#11563

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-01-21 12:52 +0100
Message-ID<MPG.2984c0db6a15eaa69896e5@202.177.16.121>
In reply to#11239
In article <4F0DE6C0.7060403@telia.com>, lars.enderin@telia.com says...

> >   When I have to use meaningless place holder names, 
> >   I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
> >   and so on.
> > 
> 
> Could you please stop using German quotes (»...«)?

I wonder why these are called "German", because you hardly see them in 
the German language, as opposed to the French one.

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#11565

FromDavid Lamb <dalamb@cs.queensu.ca>
Date2012-01-21 09:12 -0500
Message-ID<jfeh4m$t9v$1@dont-email.me>
In reply to#11239
On 11/01/2012 2:45 PM, Lars Enderin wrote:
> 2012-01-11 17:11, Stefan Ram skrev:
>>    When I have to use meaningless place holder names,
>>    I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
>>    and so on.
>
> Could you please stop using German quotes (»...«)?

It's an international newsgroup; seems to me that those of us following 
the "xxx" quote convention should learn a little flexibility.

[toc] | [prev] | [next] | [standalone]


#11255

FromGene Wirchenko <genew@ocis.net>
Date2012-01-11 18:21 -0800
Message-ID<dpgsg7l6834gir96923p2qs1n10rvcggsv@4ax.com>
In reply to#11207
On 11 Jan 2012 16:11:03 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
wrote:

>Eric Sosman <esosman@ieee-dot-org.invalid> writes:
>>>and then calls another method, bar(),
>>Pretty stupid method names.
>
>  They are not only stupid. But »*oo« possible was
>  derived directly from indecent wording. 

     No, "foo" was not.  Read "The New Hacker's Dictionary" (or
possibly, the jargon) for a discussion of this.

>  So, I consider usage of such names to be substandard
>  and rude when writing for an unknown audience.
>
>  When I have to use meaningless place holder names, 
>  I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
>  and so on.

     All five terms have meanings.  Alpha, beta, and gamma are types
of radiation.  Delta and epsilon are terms used in mathematics.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#11272

FromLew <noone@lewscanon.com>
Date2012-01-12 08:08 -0800
Message-ID<jen0in$4eh$2@news.albasani.net>
In reply to#11207
On 01/11/2012 08:11 AM, Stefan Ram wrote:
> Eric Sosman<esosman@ieee-dot-org.invalid>  writes:
>>> and then calls another method, bar(),
>> Pretty stupid method names.
>
>    They are not only stupid. But »*oo« possible was
>    derived directly from indecent wording.
>    So, I consider usage of such names to be substandard
>    and rude when writing for an unknown audience.

Wow, that carries prudishness to a whole new level.

>    When I have to use meaningless place holder names,
>    I use »alpha«, »beta«, »gamma«, »delta«, »epsilon«,
>    and so on.

That is reasonable, uncontroversial, and traditional.  Good policy.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11245 — Re: Eclipse 3.7.1 compiler warning

Fromv_borchert@despammed.com (Volker Borchert)
Date2012-01-11 21:10 +0000
SubjectRe: Eclipse 3.7.1 compiler warning
Message-ID<jektrp$qt0$1@Gaia.teknon.de>
In reply to#11201
Novice wrote:
> [ ... ] "the parameter should not be assigned". [ ... ]
> 
> So here's what the code looks like:
> 
> public static int foo(int start, int finish) {
> 
> /* Other stuff */
> 
>   start--;
>   finish--;
> 
>   bar(start, finish);  
> }
> 
> It's the start--; and finish--; lines that are raising the warnings.
> 
> What exactly is wrong with doing that?

The casual reader might miss that bar() is being passed values different
from those having been passed to foo().

> And what is the best way to make the 
> compiler happy about that code?

public static int foo(int start, int finish) {

/* Other stuff */

  bar(start - 1, finish - 1);  
}

-- 

"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy@ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert  <v_borchert@despammed.com>

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.java.programmer


csiph-web