From: David Brennan [mailto:[EMAIL PROTECTED]]
> I can just hear Carl saying "... yes but look at all those unnecessary
> words...". However who are we (as Delphi programmers) to complain about
> unnecessary words? How about Begin, End, Then etc. If it was all so
> important to us then we should be using C so we could have curly braces,
> single line for loops etc.

The issue is not number of words but clarity and readability.  Sometimes
more words increase readability.  But not always.

  MyListBox DOT
    Items OPENSQUARE MyIndex CLOSESQUARE DOT
    AddString OPENROUND 'ack' CLOSEROUND ENDSTMT

might be an improvement, but not everything will end up quite so readable.
:-)

My issue with ansi join syntax isn't really the word JOIN, or even LEFT,
RIGHT and INNER - more having to have the join clauses thrown into the from
statement.  IMO, it breaks up both the list of tables and the list of join
clauses to have them there.  But the keyword JOIN can mislead.  If I write
"from A join B on ... join C on ... join D on ...", there is an implied
hierarchy, A to B to C to D.  But what if B, C and D are logically detail
tables off A, and that is their only relation?  How do you write a statement
that doesn't mislead?

from
  a JOIN
     b ON a... = b... JOIN
     c ON a... = c... JOIN
     d ON a... = d...
where
  <other clauses>

does it, with careful indenting, but the second and third JOIN keywords are
still misleading.  IMO

from a, b, c, d
where a... = b...
   and a... = c...
   and a... = d...
   and <other clauses>

is better because there is no suggestion of improper table relations - you
look at the group of conditions to determine the relations between tables.
It's up to you to generate the joins correctly - there is no "slot" to
remind you to provide a one-to-one join between each table you add and the
rest of the statement, but then you don't always have a join of exactly one
column between tables anyway.

Incidently, I just realised I don't know how to do a cross product between
tables using ansi join syntax.  Somehow I don't think it's just "ON ".
Anyone?

Cheers,
Carl
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to