1. request for change

with/without warning should be reversed.

The major use of 'with warning' is to look for unused variables/constants
when writing a program.

It seems that everyone that posts a program in the archives places
'without warning' at the top of their final program.

That does not make sense to me; Why isn't 'without warning' the default ?
 
Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » topic index » view message » categorize

2. Re: request for change

Bernie Ryan wrote:
> 
> with/without warning should be reversed.
> 
> That does not make sense to me; Why isn't 'without warning' the default ?

Good point.

new topic     » goto parent     » topic index » view message » categorize

3. Re: request for change

Bernie Ryan wrote:
> 
> 
> with/without warning should be reversed.
> 
> The major use of 'with warning' is to look for unused variables/constants
> when writing a program.
> 
> It seems that everyone that posts a program in the archives places
> 'without warning' at the top of their final program.
> 
> That does not make sense to me; Why isn't 'without warning' the default ?

Because the warnings are there for a reason.  Some are more useful than
others.  It's reasonable for released code to have "without warning" 
at the top.  It's presumably been tested by the author.  One would hope
that he'd fixed any dangerous warnings before releasing his code.

The defaults are correct.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: request for change

Matt Lewis wrote:
> Bernie Ryan wrote:
> > with/without warning should be reversed.
> Because the warnings are there for a reason.  Some are more useful than
> others.  It's reasonable for released code to have "without warning" 
> at the top.  It's presumably been tested by the author.  One would hope
> that he'd fixed any dangerous warnings before releasing his code.

Good point.

new topic     » goto parent     » topic index » view message » categorize

5. Re: request for change

Matt Lewis wrote:
> 
> Bernie Ryan wrote:
> > 
> > 
> > with/without warning should be reversed.
> > 
> > The major use of 'with warning' is to look for unused variables/constants
> > when writing a program.
> > 
> > It seems that everyone that posts a program in the archives places
> > 'without warning' at the top of their final program.
> > 
> > That does not make sense to me; Why isn't 'without warning' the default ?
> 
> Because the warnings are there for a reason.  Some are more useful than
> others.  It's reasonable for released code to have "without warning" 
> at the top.  It's presumably been tested by the author.  One would hope
> that he'd fixed any dangerous warnings before releasing his code.
> 
> The defaults are correct.
> 

Matt:

   'without warning' is used by lazy programmers that don't
   want to be bothered with cleaning up their programs by
   removing unused variables.
   
Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

6. Re: request for change

Bernie Ryan wrote:
> 
>    'without warning' is used by lazy programmers that don't
>    want to be bothered with cleaning up their programs by
>    removing unused variables.

Yes, that happens, but not always because the programmer is lazy.  There
are many times that unused variables can't be removed, like when they
are part of an event handler callback, and the processing doesn't need
to use all of the parameters.

Or it could be that the warning is about a possible short circuit in an
if statement, where that is exactly what the programmer wants.  There's
also the case of unused global constants that are part of a library,
and so might be used by clients (or not, but that's not a good reason to
eliminate them).  Of course, the better solution for that is to put
without warning at the bottom of the file.

In any case, your argument doesn't support changing the defaults.  It's
the equivalent of, "Some people abuse this, so let's just give up and
stop issuing warnings at all."  I think it's better to require affirmative 
action from the programmer to turn off the warnings.  If we had multiple
levels of warning, then we could debate about the proper default warning 
level, but since we only have one, I think it's obvious that the default 
should be to have warnings on.

Matt

new topic     » goto parent     » topic index » view message » categorize

7. Re: request for change

Matt Lewis wrote:
> 
> also the case of unused global constants that are part of a library,
(Minor correction: unused global constants, variables, and routines do not
generate warnings, for sound reason, nor in fact and to my dislike do unused
local routines, it is only unused local constants and variables that trigger such
messages.)

> I think it's better to require affirmative 
> action from the programmer to turn off the warnings.

I agree, and would even support a ridiculously extreme method of *forcing* every
individual warning to be explicitly counteracted, eg:
without warning "parameter self in myhandler is not used"
procedure myhandler(integer self, integer msg...

whereby the without warning directive pushes entries onto a stack that are
filtered by and popped off by matching warning messages, and generate errors when
[any] eof is reached for any left unpopped.

Somehow doubt many would want to go that far though smile

Fwiw, Edita does not need any "without warning" statements (though ppp.e has
one, I just killed one in pFinet.ew, and not counting arwen).

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

8. Re: request for change

Bernie Ryan wrote:

> Matt Lewis wrote:
> > 
> > Bernie Ryan wrote:
> > > 
> > > 
> > > with/without warning should be reversed.
> > > 
> > > The major use of 'with warning' is to look for unused variables/constants
> > > when writing a program.
> > > 
> > > It seems that everyone that posts a program in the archives places
> > > 'without warning' at the top of their final program.
> > > 
> > > That does not make sense to me; Why isn't 'without warning' the default ?
> > 
> > Because the warnings are there for a reason.  Some are more useful than
> > others.  It's reasonable for released code to have "without warning" 
> > at the top.  It's presumably been tested by the author.  One would hope
> > that he'd fixed any dangerous warnings before releasing his code.
> > 
> > The defaults are correct.
> > 
> 
> Matt:
> 
>    'without warning' is used by lazy programmers that don't
>    want to be bothered with cleaning up their programs by
>    removing unused variables.

So you want to make this the default setting in order to support their
lazyness?? Sorry, that's above me.

Also, 'without warning' is used by other kinds of programmers as well.
Those who appreciate warnings during developement time, and just before
releasing the code, they switch warnings off for speed gain. I absolutely agree
with Matt, that it's obvious that the default should be to have
warnings on.

Regards,
   Juergen

-- 
There are two ways of constructing a software design:
One way is to make it so simple that there are /obviously/ no deficiencies
and the other is to make it so complicated that there are no /obvious/
deficiencies.         [C.A.R. Hoare (1987), The Emperor's Old Clothes]

new topic     » goto parent     » topic index » view message » categorize

9. Re: request for change

Juergen Luethje wrote:
> 
> Bernie Ryan wrote:
> 
> > Matt Lewis wrote:
> > > 
> > > Bernie Ryan wrote:
> > > > 
> > > > 
> > > > with/without warning should be reversed.
> > > > 
> > > > The major use of 'with warning' is to look for unused
> > > > variables/constants
> > > > when writing a program.
> > > > 
> > > > It seems that everyone that posts a program in the archives places
> > > > 'without warning' at the top of their final program.
> > > > 
> > > > That does not make sense to me; Why isn't 'without warning' the default
> > > > ?
> > > 
> > > Because the warnings are there for a reason.  Some are more useful than
> > > others.  It's reasonable for released code to have "without warning" 
> > > at the top.  It's presumably been tested by the author.  One would hope
> > > that he'd fixed any dangerous warnings before releasing his code.
> > > 
> > > The defaults are correct.
> > > 
> > 
> > Matt:
> > 
> >    'without warning' is used by lazy programmers that don't
> >    want to be bothered with cleaning up their programs by
> >    removing unused variables.
> 
> So you want to make this the default setting in order to support their
> lazyness??
> Sorry, that's above me.
> 
> Also, 'without warning' is used by other kinds of programmers as well.
> Those who appreciate warnings during developement time, and just before
> releasing the code, they switch warnings off for speed gain. I absolutely
> agree
> with Matt, that it's obvious that the default should be to have
> warnings on.
> 
> Regards,
>    Juergen
> 
> -- 
> There are two ways of constructing a software design:
> One way is to make it so simple that there are /obviously/ no deficiencies
> and the other is to make it so complicated that there are no /obvious/
> deficiencies.         [C.A.R. Hoare (1987), The Emperor's Old Clothes]

My default code template in ConText starts any source file by "without warning",
because 95% of those which are emitted are simply useless, when not obnoxious.
Ok, perhaps as little as 80%, that's well enough. Hence use the defaults you
like.

CChris

new topic     » goto parent     » topic index » view message » categorize

10. Re: request for change

Pete Lomax wrote:
> I agree, and would even support a ridiculously extreme method of *forcing*
> every
> individual warning to be explicitly counteracted, eg:
> }}}
<eucode>
> without warning "parameter self in myhandler is not used"
> procedure myhandler(integer self, integer msg...
> </eucode>
{{{

> whereby the without warning directive pushes entries onto a stack that are
> filtered
> by and popped off by matching warning messages, and generate errors when [any]
> eof is reached for any left unpopped.
> 
> Somehow doubt many would want to go that far though smile

I still kind of like the idea of:

   without warning "string"

where any warning containing the string "string"
would be suppressed. i.e. match(string, message) could be used.
The usual nested file scope rules
for with/without warning would apply for these strings. 

e.g.
  without warning "parameter self in myhandler is not used"

or to kill a bunch of warnings ...

  without warning "not used"

or 

  without warning "short-circuit"

etc.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu