Re: The worst 'hello world' example ever written...

T

The_Sage

Reply to article by: "Gary Labowitz said:
Date written: Sun, 21 Sep 2003 12:50:54 -0400
MsgID:<[email protected]>

Okay, here is an example of an idiot of without a clue that I was talking
about...
[Meeting at MS, Borland, IBM...design group for compilers:]

<Snipped make believe BS>

Like most people in this NG, this person can't cite any facts so he makes them
up out of thin air.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Sun, 21 Sep 2003 11:15:56 -0700
MsgID:<[email protected]>
That statement does not support your accertation.

It isn't an assertion, it is a quote. You are asserting because you aren't
quoting anyone but yourself.
Once again you have
misunderstood the text you are quoting. "It shall have a return of type
int" leaves no room for a but.

Obviously english isn't your first language. The ISO standard uses the "but" in
a proper form, as in "You are required to attend but you are allowed to bring
someone else if you like".
The second part, "otherwise its type is
implementation-defined", speaks of other parts of main's signature and
NOT the return type which has been explicitly required to be of type
int. You have already been told this.

It is one sentence with one subject. You haven't been told this but now you
have. It is elementary english grammer.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Mitch Crane said:
Date written: Mon, 22 Sep 2003 05:38:12 -0500
MsgID:<[email protected]>
"return type" ... "otherwise its type"
You seem to have confused yourself. Note that it doesn't say "otherwise
its return type..."

You are the only one confused here. It clearly says, "otherwise its type" where
"type" is refering to the subject of the sentence which is "a return type".
Remember english grammer? You know, the subject and predicate? The subject of
the sentence is obviously the return type. The conjunction "but" adds to the
subject by offering an addtional alternative.
I guess that might make sense if it could return have both at the same
time. You live in an interesting world where mandatory things are not
required.

You live in an ignorant world where optional things are prohibited.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: "Attila Feher said:
Date written: Mon, 22 Sep 2003 14:25:31 +0300
MsgID:<[email protected]>
The ISO standard says it is forbidden to use void as the return type of
main.

Quotes then please.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: "Duane Hebert said:
Date written: Sun, 21 Sep 2003 13:44:31 -0400
MsgID:<[email protected]>
Note also that neither ISO C++ nor C99 allows you to leave the type out of a
declaration.

So what? No one made the claim that it could. Get with the program please.

And you still haven't proved anything. I quoted where ISO standard says it is
okay to use "void main()" but even if you want to blindly and ignorantly deny
that fact, then explain why MS, Borland, and IBM all agree with my
interpretation of the ISO standard? If you can't answer that question with
something other than a blatent make believe assertion, ie -- something other
than your meresay or hearsay, say a real life quote from one of those
organizations to the effect of "Opps! We thought we were ISO complaint but I
guess we really aren't," then I'm not wasting my time with your religiously
fueled ignorance.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Sun, 21 Sep 2003 11:02:35 -0700
MsgID:<[email protected]>
I see what the misunderstanding is. "Sage" thinks that the above means
that all implementations must have at least one main that returns an
int. The problem is caused by a misunderstanding of the sentance:

There is no "misunderstanding", that is your wishful thinking. Like I said, it
isn't just me that interprets the standard that way, it is also MS, Borland, and
IBM. If you want to pretend that only you and your little religious group got
the interpretation right and everybody else in the world got it wrong, you are
going to have to do better than blindly assert you are right and everybody else
is wrong if you want them to join your C++ religion.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: "David B. Held said:
Date written: Sun, 21 Sep 2003 15:03:14 -0500
MsgID:<[email protected]>
By definition, truth is fact. Calling something true, like "void
main() is legal C++" does not make it truth, or a fact.

By definition, truth is what people believe is (or accept as) a fact, not what
actually is a fact. You stand corrected.
So you concede the point. At last.

I never said otherwise. Obviously you haven't been paying attention to anything
that was said over the last 10 posts. My claim is, and always has been, int has
to be one of the return types included in an ISO compliant C++ compiler, but
viod is optionally allowed as return type, if the manufacturer so chooses to do
so.
Prove it.

Done. I provided the quotes from the ISO standard...can't you read?
And which part of the standard says "just so long as one of
those types is an int"?

The part that says, " "It shall have a return type of type int..."

Can't you read or pay attention to the last 10 posts? Why should I waste my time
with your ignorance? You aren't going to be reasonable or honor us with an
intelligent dialog. Heck, I gave the paragraph and sub-heading where the
standard states what main() can return or not, and you either cannot understand
simple english sentences, don't want to understand simple english sentences, or
you pretend to not understand simple english sentences. Case in point: I asked
for facts and all you gave in your rebuttal just now was your opinion. No logic.
No quotes from the standard. No links to legitimate references. Just you playing
ignorant of all that preceded your post. Go back and read all those posts you
obviously didn't look at, then come back and see if you can hold an intelligent,
fact-filled, standard quoting post, because apparently you don't want to be
serious about this issue, which makes you a joke.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: "Buster said:
Date written: Sun, 21 Sep 2003 18:43:20 +0100
MsgID:<[email protected]>

Good comeback!

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Sun, 21 Sep 2003 11:11:19 -0700
MsgID:<[email protected]>
Bug in the parser? Who knows why it accepts bad code...

In other words, you don't know for a fact so you just make up excuses as you go
along. Hence the reason I snipped the rest of your nonsense post. That and the
fact that you are now doing the shuffle, by attempting to take back all the
things you claimed were wrong but all of sudden aren't. Haha! Thanks for the
laugh anyway. You are very entertaining!

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: James Lothian said:
Date written: Sun, 21 Sep 2003 20:34:08 +0100
MsgID:<[email protected]>
In particular, the MS compiler that you had just confidently asserted
would accept this. Please run this example through whatever compiler
you have access to and show us the compiler's diagnostic output.

It says the compile was successful.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
A

Andrey Tarasevich

The_Sage said:
...
"3.6.1 Main function paragraph 2:
It shall have a return type of type int..."

Which all ISO compilers like MS, Borland, and IBM do.

"...but otherwise..."

See that word? It means that the standard allows breathing room for other return
types other than int. Duh!

"its type is implementation-defined"
...

Wrong. The type of any function is affected by several different
factors, including its return type, types of its parameters, function's
cv-qualifiers (for non-static member functions), its linkage specification.

The above words "...but otherwise its type is implementation-defined"
mean that while the return type of function 'main' must always be 'int',
other characteristics of this function's type are
implementation-defined, i.e. they may wary from one implementation to
another.

This is not discussible. Just try to remember it.
 
T

The_Sage

Reply to article by: Mitch Crane said:
Date written: Mon, 22 Sep 2003 05:45:04 -0500
MsgID:<[email protected]>
Because yours is allows non-standard code. Is that really so hard to
understand? Are you under the impression that non-standard code never works
on any compiler?

Wrong again. The compiler is ISO compliant.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
R

Randall Hyde

The_Sage said:
It says the compile was successful.
So you say.
You have to forgive people around here for not believing you.
I believe the poster asked you to post the output from the compilation.
Of course, *I* wouldn't put it past you to edit the output...
Cheers,
Randy Hyde
 
A

Andrey Tarasevich

The_Sage said:
...
Glad to see you finally got it right. Now if you could read the next sentence
which says other return types may be implemented, ie -- the return type of void
may be implemented.
...

Strictly speaking, implementations are allowed to do anything they
please as long as any compliant C++ code is interpreted correctly. As an
extension, a compliant C++ compiler is allowed to accept and compile
Pascal and Fortran code and enhance you compiling experience with canned
jokes about your coding style, if its creators decided to implement this
weird functionality. Nevertheless, any code that requires such
functionality from the compiler cannot be referred to as "C++ code".
 
D

David White

The_Sage said:
Obviously english isn't your first language. The ISO standard uses the "but" in
a proper form, as in "You are required to attend but you are allowed to bring
someone else if you like".

Bringing someone else doesn't alter the fact that you must still attend,
just as an implementation's defining the type of 'main' doesn't alter the
fact that it still must return int. You seem to be agreeing that 'main' must
return int.

DW
 
A

Andrey Tarasevich

The_Sage said:
...

Wrong again. The compiler is ISO compliant.
...

Wrong. The fact that the code is accepted by an ISO compliant compiler
doesn't mean that the code is standard.

ISO compliant C++ compiler is a compiler that accepts and translates
correctly any standard C++ code. However, it is still allowed to accept
and translate any junk that you feed into it. This doesn't mean that the
aforementioned junk is standard C++ code.
 
A

Andrey Tarasevich

The_Sage said:
And you still haven't proved anything. I quoted where ISO standard says it is
okay to use "void main()" but even if you want to blindly and ignorantly deny
that fact, then explain why MS, Borland, and IBM all agree with my
interpretation of the ISO standard?

Even if there is such thing as "your interpretation of the standard", it
isn't really relevant in any way and it doesn't make any difference. The
standard did not fall from the sky in a meteorite. It was written by
people here on Earth. If you think that some part of the document is
open to interpretations, you simply ask these people about their intent
with this portion of the document (and, maybe, submit a defect report).

The question about the meaning of the word "otherwise" in the
aforementioned sentence that deals with the return type of function
'main' has been asked and answered many times already. It is no longer a
matter of discussion. It is simply a fact that one has to remember: in
C++ return type of 'main' is always 'int'.
 
B

Buster

It clearly says, "otherwise its type" where
"type" is refering to the subject of the sentence which is "a return type".
Remember english grammer? You know, the subject and predicate? The subject of
the sentence is obviously the return type. The conjunction "but" adds to the
subject by offering an addtional alternative.

Tripe. The sentence has two clauses, linked by a conjunction. The
subject of the first clause is "A conforming implementation" and that
of the second clause is the pronoun "they". "They" is plural and
does not refer to the conforming implementation (singular), so the
other possibility, that "they" refers to the versions (plural) of main, is
the only correct interpretation. It is the "conforming implementation"
which "may provide more versions of main". It is the "versions of main"
which "must all have return type int".

Here it is again expressed without using the grammatical terms you
seem to be unwilling to use correctly.

"A conforming implementation may provide more versions of main(), but
they must all have return type int."

means:

(1) 'A conforming implementation may provide more versions of main (),
but all the versions of main must have return type int.',

not:

(2) 'A conforming implementation may provide more versions of main (),
but all the implementations must have (a version of main with) return type
int.'.

Buster.
 
N

Noah Roberts

The_Sage said:
You are the only one confused here.

Actually, and here is something you should think about, if you are right
then everyone else is confused including the people that wrote the
standard. If that doesn't even make you rethink your position then you
are way to arrogant for civilized converse.

NR
 
N

Noah Roberts

The_Sage said:
In other words, you don't know for a fact so you just make up excuses as you go
along. Hence the reason I snipped the rest of your nonsense post.

Actually you are right, I have no idea why your compiler compiles
syntatically incorrect code. My best guess is that you are exploiting a
bug in the parser, but yes - I don't actually know as I don't even know
what compiler you are using.

As to the rest of my post, those where facts as I know them through
experience with g++ and gcc.

That and the
fact that you are now doing the shuffle, by attempting to take back all the
things you claimed were wrong but all of sudden aren't.

I think you should read this thread through in its entirety before you
point THAT finger :p

Haha! Thanks for the
laugh anyway. You are very entertaining!

Glad you think so.

NR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top