[Javascript] code review

Mike Dougherty mdougherty at pbp.com
Wed Aug 4 12:35:27 CDT 2004


Tab expansion came from the paste action (i think), it looked like there was no indentation when 
it came back to me, and your email (apparently) preserved extra-wide tabs.  Strange.  I agree 
smaller tabs are better, as long as you don't mix tab and manual spaceing.

I agree 100% that our 'convention' for table names is horribly confusing, but the variable names 
come from the table names - so at least the confusion is applied linearly across the project :)

thanks for the suggestions

On Wed, 4 Aug 2004 15:32:39 +0100
  "Matt Barton" <javascript at mattbarton.org> wrote:
>Another trivial[*] comment I'd make is that, personally, I hate variable
>names like "itm200" and "loItm200" and find code much more readble (and
>hence, understandable) when using more descriptive names.  Particularly in
>situations like this where you've got lots of variable names together in
>tight loops, and very similar looking varaible names.
>
>Just my £0.02p
>
>Matt
>-----
>
>[*] One man's trivia, being another mans detail... I'd not call this
>instance trivial, but I'm aware that others, rightfully, would consider it
>to be so.  Far be it from me to say that my coding standards preference is
>"correct".  Many ways to skin a cat etc, etc.
>
>
>----- Original Message ----- 
>From: <shawn_milochik at godivachoc.com>
>To: <javascript at LaTech.edu>
>Sent: Wednesday, August 04, 2004 3:07 PM
>Subject: Re: [Javascript] code review
>
>
>> This may seem trivial, but I always set my tabs to three spaces.  It looks
>> like you're using 10 or 12, which
>> is making this much wider than it needs to be.
>>
>>
>> Here is how I would format this.  Still a big block, and depending upon
>> what font you are viewing this in, the
>> spacing may be weird.  But with a fixed-width font, I think that this is
>> reasonable.
>>
>> for (var itm200 in loMainItem.Item0200) {
>>    var loItm200 = loMainItem.Item0200[itm200]
>>    for (var itm100 in loItm200.Item0100) {
>>       var loItm100 = loItm200.Item0100[itm100]
>>       for (a100 in loItm100.Area0100) {
>>          var loA100 = loItm100.Area0100[a100]
>>          if (loA100.Customize==1) {
>>             for (a110 in loA100.Area0110) {
>>             var loA110 = loA100.Area0110[a110]
>>             if (loA110.Type==2) {
>>                if (loA110.Customize==1) {lnRtnVal+=1}
>>                } /* if (loA110.Type==2) */
>>             } /* for (a110 in loA100.Area0110) */
>>          } /* if (loA100.Customize==1) */
>>       } /* for (a100 in loItm100.Area0100) */
>>    } /* for (itm100 in loItm200.Item0100) */
>> } /* for (itm200 in loMainItem.Item0200) */
>>
>>
>>
>>
>> Shawn
>>
>>
>>
>>
>>
>>              mdougherty at pbp.co
>>              m
>>              Sent by:                                                   To
>>              javascript-bounce         javascript at LaTech.edu
>>              s at LaTech.edu                                               cc
>>
>>                                                                    Subject
>>              08/04/2004 09:23          [Javascript] code review
>>              AM
>>
>>
>>              Please respond to
>>              javascript at LaTech
>>                    .edu
>>
>>
>>
>>
>>
>>
>> Given the rather long object tree below, was there a better way to
>> structure the data/objects so
>> this kind of code could have been avoided?  (there are few objects in each
>> collection, and it
>> processes very quickly even on slow machines, but it's not pleasant to
>> read)
>>
>>
>> for (var itm200 in loMainItem.Item0200) {
>>              var loItm200 = loMainItem.Item0200[itm200]
>>              for (var itm100 in loItm200.Item0100) {
>>                          var loItm100 = loItm200.Item0100[itm100]
>>                          for (a100 in loItm100.Area0100) {
>>                                      var loA100 = loItm100.Area0100[a100]
>>                                      if (loA100.Customize==1) {
>>                                                  for (a110 in
>> loA100.Area0110) {
>>                                                              var loA110 =
>> loA100.Area0110[a110]
>>                                                              if
>> (loA110.Type==2) {
>>
>if
>> (loA110.Customize==1) {lnRtnVal+=1}
>>                                                                          }
>> /* if (loA110.Type==2) */
>>                                                              } /* for
>(a110
>> in loA100.Area0110) */
>>                                                  } /* if
>> (loA100.Customize==1) */
>>                                      } /* for (a100 in loItm100.Area0100)
>> */
>>                          } /* for (itm100 in loItm200.Item0100) */
>>              } /* for (itm200 in loMainItem.Item0200) */
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
>>
>>
>>
>>
>> **********************************************************************
>> This e-mail and any files transmitted with it may contain
>> confidential information and is intended solely for use by
>> the individual to whom it is addressed.  If you received
>> this e-mail in error, please notify the sender, do not
>> disclose its contents to others and delete it from your
>> system.
>>
>> **********************************************************************
>>
>> _______________________________________________
>> Javascript mailing list
>> Javascript at LaTech.edu
>> https://lists.LaTech.edu/mailman/listinfo/javascript
>>
>> -- 
>> This email has been verified as Virus free
>> Virus Protection and more available at http://www.plus.net
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list