"Do you know about Phillipe Mougin's paper on OO array programing in F-Script?" "<http://www.fscript.org/documentation/OOPAL.pdf>" integrating APL with OO sounds like it'd be good from an elegance point of view, but bad from a performance point of view. Objects are just so slow (construct / deconstruct / point to / iterate over). The authors fscript implementation is based on messages between the object itself and the array based virtual rendering of them? Did I get that right? That's got to be even slower. I'm told that objective C does some magic in this regard, but how much magic could it do?
To me there's something to be gained by throwing all of that out. Encapsulation / inheritance / etc isn't all that it is cracked up to be. These approaches are great, but they aren't great all scenarios. I found going non-OO / bordering on functional to be clarifying in many regards. I haven't thrown out OO -- merely the dogmatic application of it. -Steven On 26 January 2011 01:04, <[email protected]> wrote: > Send Programming mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://jsoftware.com/cgi-bin/mailman/listinfo/programming > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Programming digest..." > > > Today's Topics: > > 1. Re: Intro and Question (Ron Jeffries) > 2. Re: Intro and Question (Ron Jeffries) > 3. Re: Intro and Question (Raul Miller) > 4. Re: Intro and Question (Charles Turner) > 5. Re: Intro and Question (Ron Jeffries) > 6. Re: Intro and Question (Raul Miller) > 7. Re: Intro and Question (Henry Rich) > 8. Re: Intro and Question (Ron Jeffries) > 9. Re: Intro and Question (Ron Jeffries) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Jan 2011 14:32:41 -0500 > From: Ron Jeffries <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hello, Raul. On Tuesday, January 25, 2011, at 2:20:25 PM, you > wrote: > > > I will agree that maintaining perspective probably matters at least as > > much as code juggling. > > Yes. The JfC is good in some regards. I have to hope it is possible > to discuss shape and rank more clearly than that, but I am slowly > getting my head around it. > > > This is from > > http://www.jsoftware.com/help/jforc/a_first_look_at_j_programs.htm? > > The version inside the help, but yes. > > > Anyways, I think you are right: that code does not look like it > > will work. > > Good. Glad to know I may not be losing it. Or so much of it. :) > > Ron Jeffries > www.XProgramming.com <http://www.xprogramming.com/> > Agility might be said to be about encountering > all the problems so early and so often that the > effort to fix them is less than the pain of enduring them. > > > > ------------------------------ > > Message: 2 > Date: Tue, 25 Jan 2011 14:33:24 -0500 > From: Ron Jeffries <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hello, Raul. On Tuesday, January 25, 2011, at 2:22:29 PM, you > wrote: > > >> This is from > >> http://www.jsoftware.com/help/jforc/a_first_look_at_j_programs.htm? > >> > >> Anyways, I think you are right: that code does not look like it > >> will work. > > > On second thought maybe it will work: > > > nacct was initialized, in the previous block of code, to point > > at the record after the end of the previous set of loaded data. > > Yes ... but I think that the subsequent loops are looking up > accounts and trying to update them. Surely they are not ALL at the > end? > > Ron Jeffries > www.XProgramming.com <http://www.xprogramming.com/> > New and stirring things are belittled because if they are not belittled, > the humiliating question arises, "Why then are you not taking part in > them?" -- H. G. Wells > > > > ------------------------------ > > Message: 3 > Date: Tue, 25 Jan 2011 15:00:19 -0500 > From: Raul Miller <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Jan 25, 2011 at 2:33 PM, Ron Jeffries <[email protected]> wrote: > > Hello, Raul. ?On Tuesday, January 25, 2011, at 2:22:29 PM, you wrote: > >> nacct was initialized, in the previous block of code, to point > >> at the record after the end of the previous set of loaded data. > > > > Yes ... but I think that the subsequent loops are looking up > > accounts and trying to update them. Surely they are not ALL at the > > end? > > If that record represents "the current day" and the previous > journal record represents "previous days", updating only the > current day's values would seem to be the right thing to do: > Previous days' calculations should already be complete. > (Though, granted, a paranoid programmer might want to > deal with the case where those calculations had failed.) > > Note also that acct will be initialized with all 0s when the > program starts. > > -- > Raul > > > ------------------------------ > > Message: 4 > Date: Tue, 25 Jan 2011 15:33:31 -0500 > From: Charles Turner <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > On Jan 25, 2011, at 2:32 PM, Ron Jeffries wrote: > > > Yes. The JfC is good in some regards. I have to hope it is possible > > to discuss shape and rank more clearly than that, but I am slowly > > getting my head around it. > > Do you know about Phillipe Mougin's paper on OO array programing in > F-Script? > > <http://www.fscript.org/documentation/OOPAL.pdf> > > Best wishes, Charles > > > > ------------------------------ > > Message: 5 > Date: Tue, 25 Jan 2011 15:57:24 -0500 > From: Ron Jeffries <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hello, Raul. On Tuesday, January 25, 2011, at 3:00:19 PM, you > wrote: > > > On Tue, Jan 25, 2011 at 2:33 PM, Ron Jeffries <[email protected]> > wrote: > >> Hello, Raul. ?On Tuesday, January 25, 2011, at 2:22:29 PM, you wrote: > >>> nacct was initialized, in the previous block of code, to point > >>> at the record after the end of the previous set of loaded data. > >> > >> Yes ... but I think that the subsequent loops are looking up > >> accounts and trying to update them. Surely they are not ALL at the > >> end? > > > If that record represents "the current day" and the previous > > journal record represents "previous days", updating only the > > current day's values would seem to be the right thing to do: > > Previous days' calculations should already be complete. > > (Though, granted, a paranoid programmer might want to > > deal with the case where those calculations had failed.) > > > Note also that acct will be initialized with all 0s when the > > program starts. > > I believe, perhaps erroneously, that all the accounts have been read > into the array, from 0 up to and not including nacct. Then, I > believe, still perhaps erroneously, that the transactions are being > read in subsequently (and they are not guaranteed to be in account > order). Then, IBPE, that the account is being looked up (where it > says look up the account) and that we are supposed to be updating > EACH account, none of which is at location acct[nacct], because that > cell was never initialized, which we see by the fact that the final > setting of nacct is +nacct at the END of the account read loop. > > I would bet that if this program had tests, they would not run > correctly. I could be wrong, of course. > > Ron Jeffries > www.XProgramming.com <http://www.xprogramming.com/> > Resistance may or may not be futile. It is for sure not productive. > > > > ------------------------------ > > Message: 6 > Date: Tue, 25 Jan 2011 15:59:59 -0500 > From: Raul Miller <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Jan 25, 2011 at 3:57 PM, Ron Jeffries <[email protected]> wrote: > > I would bet that if this program had tests, they would not run > > correctly. I could be wrong, of course. > > I would not bet against you, here. > > -- > Raul > > > ------------------------------ > > Message: 7 > Date: Tue, 25 Jan 2011 17:10:46 -0500 > From: Henry Rich <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Yes, the program is wrong (nacct is out of the valid array area at that > point). I've fixed it, thanks. > > Henry Rich > > > On 1/25/2011 11:18 AM, Ron Jeffries wrote: > > Hi. I'm Ron Jeffries. I've been experimenting with J language with > > advice from Tracy Harms, Raul Miller, Henry Rich, and Gilles > > Kirouac. (Thanks to you all, and to anyone I've missed.) > > > > Gilles, in particular, detected that I may have dived in too deep, > > and suggested that I go back to J for C programmers and work through > > that. I had started with it but didn't really find it tasty, but on > > his advice I'm going again. > > > > I noticed in an early example, the accounts one, this patch of C code: > > > > while(3 == fscanf(fid,"%f%f%f",acctno,xactnday,xactnamt) { > > for(acctx = 0;acct[acctx].ano != acctno;++acctx); > > acct[nacct].weightbal += > > acct[nacct].currbal * (xactnday - acct[nacct].prevday); > > acct[nacct].currbal += xactnamt; > > acct[nacct].prevday = xactnday; > > } > > > > A similar patch appears at the end of the example. > > > > I'm quite rusty on C but it appears to me that the for loop finds > > the value of acctx such that we have the right account number acctno > > ... but that the subsequent code updates account number nacct, > > which, as the incremented value of nacct after the input read loop, > > is in fact an uninitialized account struct. > > > > Am I missing something? If not, maybe the example in JfC needs > > updating. If nothing else, this surely shows that J is not subject > > to this kind of error, or at least not quite so easily. > > > > I'm sure I'll be back with beginner J questions soon. Thanks! > > > > Ron Jeffries > > www.XProgramming.com <http://www.xprogramming.com/> > > If not now, when? -- The Talmud > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ------------------------------ > > Message: 8 > Date: Tue, 25 Jan 2011 17:13:53 -0500 > From: Ron Jeffries <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hello, Charles. On Tuesday, January 25, 2011, at 3:33:31 PM, you > wrote: > > > On Jan 25, 2011, at 2:32 PM, Ron Jeffries wrote: > > >> Yes. The JfC is good in some regards. I have to hope it is possible > >> to discuss shape and rank more clearly than that, but I am slowly > >> getting my head around it. > > > Do you know about Phillipe Mougin's paper on OO array programing in > F-Script? > > > <http://www.fscript.org/documentation/OOPAL.pdf> > > Thanks, I'll check it out ... > > Ron Jeffries > www.XProgramming.com <http://www.xprogramming.com/> > Keep away from people who try to belittle your ambitions. Small people > always do that, but the really great make you feel that you, too, can > become great. -- Mark Twain. > > > > ------------------------------ > > Message: 9 > Date: Tue, 25 Jan 2011 20:04:24 -0500 > From: Ron Jeffries <[email protected]> > Subject: Re: [Jprogramming] Intro and Question > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > Hello, Henry. On Tuesday, January 25, 2011, at 5:10:46 PM, you > wrote: > > > Yes, the program is wrong (nacct is out of the valid array area at that > > point). I've fixed it, thanks. > > See? I'm not a total dummy. Only in J. :) > > Ron Jeffries > www.XProgramming.com <http://www.xprogramming.com/> > Just because XP doesn't talk about how to make fire, should we assume it > requires us to use sticks? -- Richard MacDonald > > > > ------------------------------ > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > End of Programming Digest, Vol 64, Issue 26 > ******************************************* > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
