Re: ? 1={}, is there really any other interpretation?
- Posted by Andy Serpa <ac at oneho?seshy.?om> Jul 18, 2007
- 683 views
Derek Parnell wrote: > > > I'm not a big fan of brevity for the sake of brevity. Sometimes extra lines > can give more understanding to the code reader. > Are you a fan of performance for the sake of performance? Much of the time any extra performance is simply not relevant. The time I take typing those extra lines may very well take longer than the cumulative time savings in performance I'll see over the entire life of the program. And if the only "code reader" that is ever going to see the stuff is me, and I can understand it fine (in fact easier than digesting an entire block of code), then I certainly wouldn't want to lose that ease of programming. What a "code reader" can or cannot understand easily is not objective, but depends entirely upon his/her programming background and is different for everybody. If I expected people to be reading it, my code would be well-commented anyway. To me, the brevity isn't just for the sake of brevity -- it is for the sake of elegance and ease in programming. It is a huge time-saver in the programming stage -- that matters too. > Or you simply have always done it another way? > >Apparently I do. I tend to use the 'iterator' pattern instead. > > FOR EACH ITEM IN LIST > { > IF ITEM SATIFIES CONDITION > { > PROCESS ITEM > } > } Progress, my friend, progress.