× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Sun, May 3, 2020 at 2:07 PM Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:

USING does the same thing += does: it makes it harder to make a mistake.

I guess you *could* think of `+=` as a way to avoid repeating yourself
syntactically, but in many languages, there's actually a semantic
difference (the left-hand term is not re-evaluated for augmented
assignment). Moreover, in the cases where there is no semantic
difference, then you can switch between the two forms freely. Neither
one is "more applicable" than the other.

MyLongFieldNameA = MyLongFieldNameAA + 1
vs
MyLongFieldNameA += 1

Was the misspelling deliberate? Modern editors have autocompletion
which helps with this anyway.

MYTABLE A join MYTABLE B
on (A.KEY1, A.KEY2, A.KEY3) = (B.KEY2, B.KEY1, A.KEY3)
vs
MYTABLE A join MYTABLE B using (KEY1, KEY2, LEY3)

Second syntax avoid two popular errors, and by popular, I mean ones I do
all the time :). Wrong key name (or just simple transposition) and
wrong table qualifier.

Is `LEY3` another deliberate misspelling?

So, if you're right, and this is the whole story, you've confirmed my
own conclusion that USING is very minor (for me) syntactic sugar. It
only helps when the joins are (by my standards) very simple, and
*cannot even be used* if you need qualification of field names, which
could easily happen well before things get (what I consider)
complicated. Plenty of folks use the convention that EVERY field must
be qualified. I get it - no need to think about whether or not you
need it, just put it in from the beginning. And if you add a table
later, you don't have to go back and fix what you've already got. I
don't personally use that convention, but similar reasoning applies to
USING. I'm not going to waste my time thinking about whether I can use
it or not, and then change it anyway if I have to add another table.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.