From: Jay C. <jch...@ou...> - 2001-01-30 17:40:08
|
IMHO: Using side effects to implement the core logic challenges the readability of the code. (The present example has provided evidence of that.) Yet, readability is of primary importance in a large group effort. The opinion of many is that one should choose readability over economy/cleverness/performance unless the specific tradeoffs in the case at hand are compelling. One of those "many" is quoted below. "The main idea is to regard a program as a communication to human beings rather than as a set of instructions to a computer. " - Donald Knuth (http://www-cs-faculty.stanford.edu/~knuth/cweb.html) -J -----Original Message----- From: Doug Melvin [mailto:do...@cr...] Sent: Tuesday, January 30, 2001 10:51 AM To: dyn...@li... Subject: Re: Re[2]: [Dynapi-Dev] [Bug #130357] small typo in list.js I've just had that conversation with a co-worker. Can anyone tell me why this is not proper? The best my co-worker could come up with was 'it doesn't feel right' .... > Either way, we shouldn't be using if (this.selected=b). That's not > very proper. > > -- > // Robert Rainwater > > On 1/30/2001, 8:47:21 AM EST, Raides wrote about "[Dynapi-Dev] [Bug #130357] small typo in list.js": > > > Michael Pemberton wrote: > >> > >> please put the "typo" back. What is does is set the value of this.selected to > >> b and then evaluates the returned value (the new value of this.selected). It > >> is needed to change the selected state of the item. > >> > > >> > if (this.selected=b) { > >> > > >> > should be > >> > > >> > if (this.selected==b) { > >> > > >> > right? > > > I will answer both for NS6's sake: > > > This is indeed a bug in NS6 and prevents normal execution of the rest of the > > code. It should read: > > > this.selected=b > > if(this.selected){ > > ... > > }else{ > > ... > > } > > > I have done this kind of changes all around my local dynapi distribution and > > those pesky errors that NS6 throwed at me and their side effect of code not > > executing in that function anymore disappeared. Other special perso-NS6-ality of > > this browser is that if you want to dynamically resize an image, you have to do > > it TWICE, using a setTimeout to delay appropiately (30 millisecs are enough) the > > effect. The code I use to test NS6 comes with this mail. It is spanish code and > > HTML, poorly documented but that can be executed in IE4.0 and above with no > > changes at all and some errors due to their different underlying model. > > > Raides J. > > > ---------------------- > DynAPI Snapshots: http://dynapi.sourceforge.net/snapshot/ > DynAPI Homepage: http://dynapi.sourceforge.net/ > > > > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/lists/listinfo/dynapi-dev _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://lists.sourceforge.net/lists/listinfo/dynapi-dev |