help-octave
[Top][All Lists]
Advanced

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

Re: Octave and cargo cult programmingHello


From: Sergei Steshenko
Subject: Re: Octave and cargo cult programmingHello
Date: Thu, 13 Sep 2012 14:54:01 -0700 (PDT)

>________________________________
> From: Judd Storrs <address@hidden>
>To: Sergei Steshenko <address@hidden> 
>Cc: Octave users list <address@hidden> 
>Sent: Friday, September 14, 2012 12:27 AM
>Subject: Re: Octave and cargo cult programmingHello
> 
>
>On Thu, Sep 13, 2012 at 4:57 PM, Sergei Steshenko <address@hidden> wrote:
>
>Hello,
>>
>>after learning how and why broadcasting was introduced into Octave I stumbled 
>>upon the following article:
>>
>>https://en.wikipedia.org/wiki/Cargo_cult_programming
>>.
>>
>>The proper way of introducing broadcasting should have been through compiler 
>>pragma or explicit user controllable (and off by default) operator 
>>overloading.
>>
>>Now into each of my scripts I insert
>>
>>warning ("error", "Octave:broadcast");
>>
>>- I don't like startup files - because of their global nature.
>>
>
>
>It's funny because I finally gave up and just put
>
>
>    warning ( "off", "Octave:broadcast" ) ;
>
>
>in my global .octaverc because I've grown so tired of typing it in each and 
>every one of my scripts. I find my code is much denser and more direct now 
>that it's not littered with obnoxious bsxfun() calls everywhere.
>
>
>Have you run into a situation where you *rely* on the error? Can you elaborate?
>
>
>
>
>--judd
>


This whole broadcast thing is a _great_ nuisance for me.

_Nowhere_ in my scripts I care about row <-> column vector, but with 
broadcasting ON by default Octave starts issuing warnings in case I confuse row 
<-> column vector.


The warning is utterly _stupid_ - it doesn't tell me what the line number is; 
instead, Octave starts doing all this broadcasting bullshit often causing 
memory overflow.


A much more useful thing would be to implement universal vector and compatible 
operations, i.e. a vector which is neither row nor column - a 1d array in 
simple programming English.



So, because the warning does not tell me what the line number, but error 
luckily does, I rely fundamentally everywhere on this error.



Regards,
  Sergei.







>


reply via email to

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