From: Seebs on
On 2010-03-04, John Gordon <gordon(a)panix.com> wrote:
> No, it does actually do something: it will throw a compile error if you
> mistype == as =.

But gcc gives a warning for it, anyway. And "x == 7" is much more readable
than "7 == x".

At least, for English speakers it is. I don't know; maybe there are languages
in which saying "if x is equal to y" implies that x is the constant and y
is the variable.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: Richard on
John Gordon <gordon(a)panix.com> writes:

> In <oct467-nu6.ln1(a)news.eternal-september.org> Richard <rgrdev_(a)gmail.com> writes:
>
>> When discussing vars in computing it is normal to discuss the variables
>> b name.
>
>> You dont say "if pi is larger than p".You say "if p is larger than
>> pi". You're style is nothing more than fancy for fancy's sake IMO.
>
> No, it does actually do something: it will throw a compile error if you
> mistype == as =.

I know. I program C.

Its a silly little style. Sorry.

The same "error" can happen if "p=q()".

The ugliness and "non naturalness" as well as the inconsistency it
brings in outweigh any advantage.
From: Edgardo Portal on
On 2010-03-04, Nicolas George <nicolas$george(a)salle-s.org> wrote:
> John Gordon wrote in message <hmokvi$53g$1(a)reader1.panix.com>:
>> No, it does actually do something: it will throw a compile error if you
>> mistype == as =.
>
> Any half-decent compiler can throw a warning for that.

But warnings can be missed, ignored, etc., while the
compilation error must be attended to (to succesfully
compile, at least).
From: Nicolas George on
Edgardo Portal wrote in message
<hmor5u$8r2$1(a)news.eternal-september.org>:
> But warnings can be missed, ignored, etc., while the
> compilation error must be attended to (to succesfully
> compile, at least).

And people can also purposefully edit the source to add bugs.

If the programmer is trying to make a good, working program, it enables most
warnings and tries to correct them all.
From: Rainer Weikusat on
Edgardo Portal <egportal2002(a)yahoo.com> writes:
> On 2010-03-04, Nicolas George <nicolas$george(a)salle-s.org> wrote:
>> John Gordon wrote in message <hmokvi$53g$1(a)reader1.panix.com>:
>>> No, it does actually do something: it will throw a compile error if you
>>> mistype == as =.
>>
>> Any half-decent compiler can throw a warning for that.
>
> But warnings can be missed, ignored, etc., while the
> compilation error must be attended to (to succesfully
> compile, at least).

Social problem #2: People who desire to avoid any work they can expect
to be able to avoid now with reasonable safety will make a bad job of
everything.
First  |  Prev  |  Next  |  Last
Pages: 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Prev: integer
Next: shared memory question