Yes. If you can't work out what i is used for in a 4 page method, the
use of i instead of thirdInnerLoopCounter isn't the biggest problem. It
might just be the four page method with at least three inner loops.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Friday, September 24 2004 2:57 p.m.
To: [EMAIL PROTECTED]
Subject: RE: [DUG] DiamondBack Sneak Peek (Delphi 9)


> i := Query1.Fields[j].Integer;

This type of assignment is not being disputed though.
This is bad, I agree.

Perhaps what needs also is the Extract Method refactoring for some of
those
long procedures.



-----Original Message-----
From: Traci Sumpter [mailto:[EMAIL PROTECTED]
Sent: 24 September 2004 12:53 PM
To: NZ Borland Developers Group - Delphi List
Subject: RE: [DUG] DiamondBack Sneak Peek (Delphi 9)


When it is in the middle of a long procedure it helps if you dont have
to
keep looking back in the code to see what you are meant to be doing.

//commenting can help lots too.....

As I said in my original I have a lot of work going over other peoples
code
and often months after creation.  So many times i get code like

i := Query1.Fields[j].Integer;
Table1.Fields[i].asString := s;

in the middle of many

While i < j do      loops and s is defined somewhere in the middle of
another loop.


In these situations it is impossible to understand what is trying to be
achieved and how to fix the bug that is created.

Is this a better example when more descriptive varible names become
essential????

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of James Sugrue
Sent: Friday, 24 September 2004 2:36 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: RE: [DUG] DiamondBack Sneak Peek (Delphi 9)


Sorry can't agree. How is iCountFiles better than i. i is just a place
holder in a loop. Anyone with more than an elementary level of
programming will understand what is going on at a glance.

I will concede that s could be more descriptive and possibly wasn't a
good example.

On Fri, 2004-09-24 at 14:01, Traci Sumpter wrote:
> except 5 months down the track when it would be a lot easier to
unserstand
>
> procedure DoSomethingorOther;
> var
>    sFileList : string;
>    iCountFiles : Integer;
> begin
>    for iCountFiles  := 0 to Pred(someList.Count) do
>    begin
>       sFileList  := someList.Items[iCountFiles];
>       doSomething(sFileList);
>    end;
> end;
>
>
>
> This means I can look at this short bit of code and can make
assumptions
> that I am going through a list of Files and doing something with it.
>
>
> what does the other version of code allow you to make assumtions
about..
>
> Assume  Ass out of you and me...  I know
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of James Sugrue
> Sent: Friday, 24 September 2004 1:25 p.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: RE: [DUG] DiamondBack Sneak Peek (Delphi 9)
>
>
> I would have though i and j would be fine for loops and s for strings.
> x and y for anything to do with co-ords as well.
>
>
> I think the following is fine:
>
> procedure DoSomethingorOther;
> var
>    s : string;
>    i : Integer;
> begin
>    for i := 0 to Pred(someList.Count) do
>    begin
>       s := someList.Items[i];
>       doSomething(s);
>    end;
> end;
>
>
> On Fri, 2004-09-24 at 12:41, [EMAIL PROTECTED] wrote:
> > > Good practice (not always =) VCL source
> >
> > True, the VCL also uses _with_.
> >
> > Each to there own - but globally condemned is a bit rich
> >
> > > for multitudes of good reasons.
> >
> > name some then
> >
> >
> > What did you search on in google.
> > _______________________________________________
> > Delphi mailing list
> > [EMAIL PROTECTED]
> > http://ns3.123.co.nz/mailman/listinfo/delphi
>
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to