Re: The IDS, the EDS and the DBMS

From: Lemming <thiswillbounce_at_bumblbee.demon.co.uk>
Date: Tue, 14 Sep 2004 10:09:29 +0100
Message-ID: <nvbdk015210eubjql83vdif0oim3fbv3g2_at_4ax.com>


On Mon, 13 Sep 2004 05:47:15 -0400, "Laconic2" <laconic2_at_comcast.net> wrote:

>
>"Lemming" <thiswillbounce_at_bumblbee.demon.co.uk> wrote in message
>news:pgh9k0l47q325uo930jqm3pqr7e7pc8ug2_at_4ax.com...
>> On Sun, 12 Sep 2004 16:33:18 -0400, "Laconic2" <laconic2_at_comcast.net>
>> wrote:
>>
>> >
>> >"Marshall Spight" <mspight_at_dnai.com> wrote in message
>> >news:%I_0d.30754$MQ5.23684_at_attbi_s52...
>> >> Realistically, you'd probably stick with == for equality-check,
>> >> to disambiguate it from assignment.
>> >
>> >Or use ":=" for assignment, freeing up "=" for equality-check.
>>
>> I know this is wandering even further from the froup's topic of
>> database theory, but ...
>>
>> Maybe I'm some kind of dullard, but I've never had a problem with
>> languages which use "=" for both assignment and equality checking.
>> The meaning of "=" is understood by the context:
>>
>
>Maybe you not some kind off dullard. Maybe I want a language that doesn't
>unnecessarily confuse people of normal intelligence. Maybe those people
>seem like dullards to you.

Oops! I meant no offence - my remark about being "a dullard" was intended to be self effacing, I was acknowledging that maybe I really don't "get it".

>But here's the answers:
>
>If you disambiguate:
>It's easier to write the parser.
>It's easier to learn the language.
>It's easier to read the code.
>It's easier to think about the problem when you don't have to think about
>the language.

All good things. Although if the language doesn't allow nested assignments then I'd say the use of the same operator for comparison and assignment won't have any impact on the above. It's nested assignment which is the bad apple, not the use of '='.

>It's easier to allow embedded assignments (assignments in parentheses
>inside an expression).

I feel that embedding assignments in other expressions leads to a lack of clarity in the code. I can see though that leaving aside my own preference, having different operators for assignment and comparison does confer this ability. If a and b are both booleans, then the statement:

        if (a = b) then ...

would be ambiguous whereas:

        if (a := b) then ...

would not.

I still feel though that even the second example could lead to confusion, being misread by a human as a comparison rather as an assignment. I feel it's clearer to separate the statements:

	a := b;
	if (a) then ...

>It's easier to code the compiler to generate a compile time error.
>
>Back when I was young and smart, I could cope with languages that were full
>of quirks, like FORTRAN or assembler. You just used some of your
>brainpower to deal with those quirks. Then, after years and years of
>coding in poorly constructed languages, I learned PASCAL. It was amazing
>how much easier it was to come up with correct and useful programs when the
>language wasn't a distraction.

Oh, Pascal! I'm a fan of Pascal myself although I've not had the opportunity to make my living at it all that often.

Out of interest, does "proper" Pascal allow assignment within expressions?

>It was like not having a headache after ten years of having one.
>
>Now that I'm old and dumb, I really need a language that makes sense.
>
>There are other languages that are just as sensible as PASCAL. They just
>aren't the most "popular" ones.

Lemming

-- 
Curiosity *may* have killed Schrodinger's cat.
Received on Tue Sep 14 2004 - 11:09:29 CEST

Original text of this message