octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning "Octave:broadcast" warning off by default


From: Carnë Draug
Subject: Re: turning "Octave:broadcast" warning off by default
Date: Sat, 21 Feb 2015 00:07:36 +0000

On 20 February 2015 at 23:45, Juan Pablo Carbajal <address@hidden> wrote:
> On Sat, Feb 21, 2015 at 12:36 AM, Carnë Draug <address@hidden> wrote:
>>>
>>
>> The problem is not the trouble of adding 'warning("off","Octave:broadcast")'
>> to my own octaverc.
>>
>> The problem is requiring every developer to add it to all the function he
>> writes.  We are not talking about something questionable such as converting
>> numbers to string, or add/minus 32 to change case (which by the way, does
>> not issue warning by default)
>>
>>     octave-cli-3.8.2> char ("word" - 32)
>>     ans = WORD
>>
>> we are talking about a very valid Octave syntax and it's ridiculous having
>> to declare its use beforehand.  It either is a valid and recommended syntax,
>> in which case we can use it and does not print warnings, or it is not, in
>> which case we just go back to calling bsxfun.
>>
> I do not understand what you try to explain here. No developer needs
> to add the warning off command in their functions, that is up top the
> user!
> The developer chooses what to use broadcast or bsxfun and then is the
> user who decides whether they want to see the warnings or not.

So we should accept that by default, our code will print warnings for
valid input?

Let's imagine you write a function that makes use of automatic
broadcasting.  You also write demos and documentation with examples.
Now imagine someone who just started Octave for the very first time,
tries to run your demos and examples and instead gets a warning.

Why does this happen?  The user gave valid input and the function
worked as expected (performing automatic broadcasting), why are
warnings being printed?

What I didn't even consider before asking here, was that some users
were actually raising them to errors.  That's scary because those users
who would not even be able to use your function at all.

Consider this.  Replace all the calls to bsxfun in octave core (there's
not that many) with automatic broadcasting.  Do not turn off warnings
locally.  Should we release something that by default prints a warning to
plot an histogram?

Carnë



reply via email to

[Prev in Thread] Current Thread [Next in Thread]