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

B

Beth

Attila said:
Beth. Please stop bringing this thread up. Thank you.

Attila, please attempt to at least be polite...especially considering
that I was _exactly right_ about the Sage and what would happen if my
advice was not heeded...that your arrogance here has appropriately
lead to egg running down your face...

Beth :)
 
D

David White

The_Sage said:
You aren't answering the question, you are doding and avoiding it. Please show
us where any of those organizations mentioned claim that their compilers are
less than 100% conforming OR that "conforming" now has been redefined by Merriam
Webster to mean "almost conforming".

It hardly matters. I'm surprised that this compiler argument of yours has
got this far. It should have been dismissed as irrelevant from the start.
What matters is what the standard says, regardless of what any compiler
allows. The standard says that 'main' must return int.

You have successfully bogged everyone down with your diversion about
compilers after being down for the count while trying to argue that the
standard actually allows void main().

DW
 
B

Beth

Attila said:
mid-thread

Please stop bringing this thread up.

How ironic it is, then, that you're one of the most persistent
responders to the Sage that's actually helped extend this post on and
on and on...

And, anyway, you're just being a show off here...I'm just as good at
spotting what reasonable posters are like as I am the Sage...there was
_absolutely no need_ to reply with "stop bringing this thread up" to
each and every instance...you could have placed it as a response to
one and then stopped...

But, no, you repeated your arrogance and rudeness to me over and
over...trying to "pull rank", are we? Well, you have my pity that you
think such behaviour is "clever"...and you also have my pity because
you did not have the sense to actually _listen_ to me and are helping
to prolong this thread with each and every response you make to the
Sage, who simply will not stop until he grows tired...you _won't_ run
him out of town, he'll walk out of his own accord, laughing at you all
for falling for all of his stupid tricks...

And I pity the fact that I actually was getting to like you with your
replies, right up until you thought you were so much better than
everyone else that you could arrogantly dismiss me in whatever rude
way that you thought you're "pulling rank" afforded you...think I'd
shy away and bow to your "holy authority" or something? Let me guess,
"go back to your knitting and cooking and cleaning" or something along
those lines? As I say, you have my pity...

Beth :|
 
B

Beth

Karl said:
I see your point and I agree: it's not that big of a deal.
But I also see Beth's point and she has a point there:
Why have a special rule for something which really is not
a problem and just brings up confusion?

You're actually not totally getting my point exactly...these
"exceptions to the rule" are _cumulative_ because of "backwards
compatibility"...what is "not a big deal" now will come back as a
right royal pain in the arse later...just ask Intel with their
ludicrously horrible and ugly layout for the instruction set encodings
of the x86 chips...that's what happens when you insist on being
"backwards compatible" for going on three decades...where you can't
remove...where you can't redefine...where you can't do much of
anything but _add_ on yet more "exceptions" to cover
"exceptions"..."patches" over "patches"...blah-blah-blah...

With all due respect to our Microsoft representative, Windows 9x also
demonstrates the eventually absurdity of this mode of thinking...yes,
it _is_ "tolerable" now...but you're not giving a thought for
later...and that's when it really, really starts hurting..."backwards
compatibility" _will_ eventually come back to haunt you, if you're not
_incredibly careful_ not to set up future problems for yourself...
If somebody would bring up a vote, if this rule should be
dropped, I would vote with a loud and clear: YES!

There's no point in doing so...and it's dubious as to whether all such
"exceptions" are capable of being dropped...

When you make a commitment to "backwards compatibility", you're
signing a contract to only _add_ new things...never remove, never
change (in any radical way), never redefine...if you do any of these
things, then your "backwards compatibility" is highly likely to become
broken...

Even if there were a vote and somehow a means to drop this (or some
similar construction) were to happen, it would have no practical
effect...Microsoft, GNU, Borland, etc. will still keep these things
because of the contracts they have implicitly signed to be "backwards
compatible"...

Just like Sage's "void main"...it _has_ been dropped and it's _NOT_ in
the standard...but Sage is right that they'll all accept it, anyway...

This is the message I was trying to deliver..."backwards
compatibility" is a _contract_ to follow a policy of never changing or
redefining or dropping any of the past in any way...the notion and the
words "backwards compatibility" are often almost worshipped as
gods...but, in this world, there is always a price...and making a
guarantee to people is an implicit _contract_ to them, which you
cannot break in good Faith...
Compilers get changed, millions of programmers spend 30 seconds
on adding the missing return 0; and can turn to more important
things afterward. The standard gets corrected and gets shortened
(IMHO a good thing) and compiler writes don't have to spend a thought
about a special case in the data flow analysis for checking if a function
actually returns something in all cases except main(). But other then
that: the earth still revolves the same way.

But I agree: It is certainly not a topic to make a big fuzz about.

I'll see you all in three decades' time (presuming C++ survives that
long...though I see no reason why it shouldn't, looking at other
things for comparison) and see if you're still carrying that same
opinion...

I guess that Intel and Microsoft probably also thought "oh, this is
only a minor thing, it's not worth making a fuss over" every time they
added yet another ugly patch over an ugly patch...they no longer think
that way, in general...Intel are going for "lateral compatibility"
rather than "backwards" for their 64-bit chips (that is, the 64-bit
core is NOT x86 compatible...instead, they include both a x86 and a
64-bit core)...and Microsoft take a lot more care in defining their
standards and such correct the first time around rather than their old
style of "oh, just patch the patch"...recently announcing that they'd
like to crop the tens of thousands of API down to 8,000, if
possible...

You _still_ pay with "backwards compatibilty"...it's just a "pay
later" scheme, is all...again, feel free to ignore me - I'm used to
it - but I'm supremely confident in the basic message here...it's
self-evident if you only think it over fully...

Beth :)
 
B

Beth

Andrew Koenig wrote:
[ snip ]
was now broken (because of the lack of an explicit return type),
there was no further need for the implicit "return 0;"
I think there was even a proposal to remove it. However, the
committee decided to leave it alone because there might already
be programs out there relying on it.

Isn't compatibility wonderful?

Yup, it was this sort of disaster that I was basically trying to send
a warning about...because, yeah, it's so easy to think "nope, doesn't
matter greatly" at the time...until it comes back to haunt three
decades later...okay, in this case, it probably won't do anything
greatly serious because of its nature here...but the warning is a
general warning about "backwards compatibility"...as this example
shows, they add something but, once added, you can't risk removal as
"some program somewhere could be depending on it"...sometimes, you
might be able to get away with some partial redefinition of
semantics...but that serves to greatly complicate things...

Anyway, in short, it must always be remembered what "backwards
compatibility" is...it's an implicit contract to never break past
code...removal will break past code that depends on a feature...a
radical incompatible change in semantics will break past code that
depends on specific semantics and specific side-effects...what's left?
Oh, yeah, you can _add_ on new stuff as much as you like...thus, the
contract you implicitly sign when you guarantee "backwards
compatibility" is effectively "we will only _add_ new things,
everything else remains (mostly) untouched"...

There is not anything necessarily wrong with this, of course...that's
not the message...the message, though, is "be very careful about what
you do, lest it return to haunt you"...what seems "trivial" now can be
a major headache later...Intel allocated 3 bits to specify
registers...this granted 8 registers that could be accessed...and this
has meant they've not been able to increase this amount (which really
is needed often, as they run out far too fast) right up until the
present day...the number of bits allocated? "Trivial!", they said...

It's like one of those TV adverts: "Buy now, pay later!!" ;)

Beth :)
 
B

Beth

WW said:
I CALL for *Godwin's law* to be applied!

Ah, sorry...I posted my comments without seeing this post first...

I sincerely apologise for the duplication (especially when you seem to
think me "unclean" or something, that you were in an immense hurry to
rudely tell me to piss off before)...

Beth :)
 
B

Beth

Karl said:
Don't get me wrong.
It seems to work fine in your case :)

Don't get me wrong...

But I return to the thread a week later - after contributing nothing
to it while I was "away" (ooh, some great "troll" I'd make, I don't
think) - and Attila is _still_ debating what the English language
means with the Sage...who clearly is just doing it to bait you all
(because there's no way Sage could be this stupid about the English
language and yet produce, perhaps not the best but perfectly
reasonable Englishs sentences for his postings...he only seems to be
ignorant of the English language when it comes to wrongly interpreting
standards...coincidence?)...

Exactly as I'd predicted would happen...whereas you lot simply _jumped
the gun_ at me writing a lot of _WARNING_ posts - purely on your
behalf in completely good Faith - before this "troll" then left the
thread completely alone for over a week...

As, in fact, that was _ALL_ I wanted to say here on the matter (I got
dragged into the "backwards compatibility" branch, just because - as
my passion in talking about it may betray - it's a pet Love / hate of
mine, the whole issue of different types of "compatibility" and
"portability")...

Your combined lack of patience, understanding and simple civility does
you no credit...yes, there were a lot of posts from me at that
particular time but I was merely trying to stem off what has now
actually happened, that the Sage has masterfully roped you all along
for over a week...a few more days and my "weeks" prediction will be
_exactly on the money_...

Again, this is _ONLY_ what I'm posting to say...that you've (Attila
mostly - who decides to tell me not to duplicate my posts, by
responding every single instance with am exact duplication of the same
text (want to look up hypocrisy in a dictionary?) - but this comment
counts into it) been quite impatient and rude in dealing with me, when
you hardly know me...and I was merely offering a warning for _your_
benefit in completely _good Faith_ at Hopefully _assisting_ you, where
I could from my unfortunately intimate knowledge of how the Sage
operates (from his continual posting to the ASM group)...again, that's
_ALL_ I was going to say...so, this time, don't jump the gun to queue
up to condemn me prior to any crime actually being committed...

Don't get me wrong but I find this conduct immensely rude...as it was
unwarranted in the first place...and events have transpired to prove
my warning comments to be _exactly right_ that the arrogance of
jumping the gun to condemn has been duely rewarded...you now look
rightfully a little silly...

Beth :)
 
B

Beth

WW said:
Post what Chapter 28 of the standard says about the main function or shut
up.

Ah, Attila...still fighting with a brick wall, over a week after I
first warned you it was entirely pointless to do so?

Beth :)
 
B

Beth

Randy said:
The C++ newsgroup is beginning to catch on.

If they'd listened, they could have gleaned our knowledge of the Sage
and put this matter to rest over a week ago...

And, yup, I _am_ ramming this point home, Attila, for all to see...I
wouldn't ordinarily be so unkind (just ask Randy)...but you were so
rude to me in all those duplicated posts (about not making duplicated
posts, of all things), that I'm just _returning in kind_...if you'd
have been civil, then I would have continued to be civil...well,
actually, no...because I only actually wanted to make my warning about
Sage and then leave...but your rude responses that jumped the gun on
this have gotten me angry and upset...

Beth :)
 
B

Beth

Attila said:
Well, he did go away. And possibly it had more to do with "send his abusive
posts in full source to his NSP and ask kindly to cut them off the net"
strategy than the one you have mentioned. But of course it might only be
that he is away abusing cats and he will be back. :-(

He _came back_..._you_ responded to him _repeatedly_ (fighting a brick
wall and doing so _more than anyone else on the entire thread_) for
_over a week_ afterward...I was _entirely right_ in what I said...so,
_apologise_ for your repeated _unwarranted rudeness_ to me, when all I
was doing was warning you exactly that he would return for _your_
benefit made in completely _good Faith_, please...

Thank you...

Beth :)
 
T

The_Sage

Reply to article by: "WW said:
Date written: Sat, 27 Sep 2003 23:40:16 +0300
MsgID:<[email protected]>
Post what Chapter 28 of the standard says about the main function or shut
up.

You still didn't answer the question. That is strike three and you are out. I'm
not wasting any more of my time with your cowardly dodging and evading.

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
=============================================================
 
B

Beth

Frank said:
No, sadly the standard committee don't even have *that* excuse - implicit
'return 0;' at the end of main was introduced with the 98 C++ standard,
AFAIK.

Well, Andrew Koenig gives a slightly different history elsewhere in
the thread...but I'm no C / C++ standards expert so I'll leave you
two - if you can be bothered - to fight over the details of where it
might have come from...
IMHO, the C++ standard committee did a good job overall, but this
extension is just braindead.

Oh, yes...no complaints about the standard, really...as it's one of
the more careful examples I've seen...this "exception" really does
seem innocent and unlikely to "bite back" in the future...nothing like
the Intel and Microsoft stuff which literally is getting / has gotten
so bad that it ground things to a halt (the "ad-hoc" Win9x stuff being
dumped completely to go with the properly planned WinNT stuff
instead...they couldn't really have kept going with patching over
Win9x repeatedly and repeatedly for much longer)...and Intel are also
changing things completely for 64-bit rather than trying to keep alive
the three decade old design for another three decades...

Basically, it's just a general warning comment not to make these same
sorts of mistakes all over again...you're right that there's not much
danger of it in this instance compared to others...but it's always
something to forever keep in the back of your mind whenever you
contemplate making revisions and changes...always think: "now, if even
more exceptions and features and stuff are piled on top of what we're
proposing, will it turn into a nightmare of a design?"...

Beth :)
 
T

The_Sage

Reply to article by: "David B. Held said:
Date written: Sat, 27 Sep 2003 16:29:24 -0500
MsgID:<[email protected]>
Actually, I gave you a response which you could judge for yourself.

Actually, you didn't answer the question until now...but it sure took you long
enough.
Since you are too lazy or too incompetent to do so, I will do some work for you:

Wrong again, jerk. I asked you for the info because you claimed you had some, so
you are doing your own work. But it is good to see that you aren't lazy -- when
prodded long enough to not be lazy that is!

Good try but still no cigar! It doesn't say they failed section 3.6.1, in fact
they have never failed that section...you know the section I'm talking about --
the one where it was supposed to say you can't use void main() like Borland
does? I will give you a C+ on that one, but you had still better go back and do
your homework over again, since it still doesn't say that void main() is
"illegal".

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 White said:
Date written: Mon, 29 Sep 2003 09:42:20 +1000
MsgID:<[email protected]>
It hardly matters.

What a lie. If it didn't matter you wouldn't care enough to speak out against
it, even though you have absolutely no facts to back up your belief.

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
=============================================================
 
D

David B. Held

Beth said:
Attila, please attempt to at least be polite...especially considering
that I was _exactly right_ about the Sage and what would happen if
my advice was not heeded...that your arrogance here has
appropriately lead to egg running down your face...

Am I the only one that gets the impression that Atilla is a younger
poster?

Dave
 
T

The_Sage

Reply to article by: "David B. Held said:
Date written: Sat, 27 Sep 2003 17:16:58 -0500
MsgID:<[email protected]>
You haven't shown any places where the standard *is* ambiguous.

You must be either deaf, dumb, or blind...or all of the above. If you aren't
going to pay attention, I'm not wasting my time writing. The sentence in
question still is...

3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

That's what we've been discussing the last two or three weeks now...where have
you been all that time? Now unless you can't understand simple english, which
suprizingly many people in these NGs can't, it is clearly ambigious (Hehe!). It
says you shall return an int BUT -- there are some additions to that "shall" --
you can otherwise return another type, if you so choose to implement/define it.

Case closed.

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
=============================================================
 
D

David B. Held

The_Sage said:
[...]
You must be either deaf,

I must be deaf, because I haven't heard you speak once yet.

You wouldn't know if I'm dumb or not, because it's not possible
to prove that someone doesn't have a capability.
or blind...

If I'm blind, then you must be telepathetic (pun intended), because
I'm somehow able to respond to your posts.
or all of the above.

How about a 3 choose 2 combination?
If you aren't going to pay attention, I'm not wasting my time writing.

Wouldn't that be a treat? How do I emphatically indicate my
inattention?
The sentence in question still is...

You're the only one that still has questions about it.
3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

That's what we've been discussing the last two or three weeks
now...

No, that's what *WE'VE* been discussing for the last two or
three weeks. YOU'VE been discussion why "void main()" is
legal, which is an entirely different thing altogether.
where have you been all that time?

With the sane people. It's fun. You should try it some time.
Now unless you can't understand simple english, which
suprizingly many people in these NGs can't, it is clearly
ambigious (Hehe!).

Besides the weak pun, you made two spelling errors and a
capitalization error in a sentence which implies my sub-standard
English skills. Those who live in glass houses should not throw
stones.
It says you shall return an int BUT -- there are some additions
to that "shall" -- you can otherwise return another type, if you
so choose to implement/define it.

Wrong. It does not say "but". It says "...but otherwise..." I thought
you would have realized how unprofitable it is to take words out
of context with my little illustration. Do I need to give the
demonstration again? I can make it look like you said all sorts of
funny things with a minimal amount of effort.

Everyone else can see that "but otherwise" is referring to the
*return type of main*. Meaning that, other than the return type,
the rest of the type is implementation-defined. Namely, the part
inside parentheses (also known as the argument list).
Case closed.

It was closed a long time ago.

Dave
 
D

David B. Held

The_Sage said:
[...]
Actually, you didn't answer the question until now...but it sure
took you long enough.

Only a simpleton would consider your question unanswered.
[...]
Wrong again, jerk. I asked you for the info because you claimed
you had some, so you are doing your own work.

I see you have never tried to falsify your own claims. That's a result
of always assuming you are right. Unfortunately, while that is a
convenient strategy, it isn't very successful.
But it is good to see that you aren't lazy -- when prodded long
enough to not be lazy that is!

How could you possibly call me lazy? Look how many times I've
explained how you're wrong! It's practically a full-time job for me!
[...]
Good try but still no cigar! It doesn't say they failed section 3.6.1,
in fact they have never failed that section...you know the section I'm
talking about -- the one where it was supposed to say you can't use
void main() like Borland does?

You're right. They didn't fail that section. That's because when used
in ANSI mode, it properly emits a diagnostic for "void main()". Which
means that a program containing "void main()" is ill-formed, regardless
of whether it is accepted as an extension. However, bcc does not
enable ANSI mode by default, because it's pretty much worthless.
To write any interesting programs, you need the Windows headers,
which pretty much cause an overwhelming cascade of diagnostics in
ANSI mode. But obviously, you haven't used bcc for serious work,
or you'd know all this. On the other hand, I have.
I will give you a C+ on that one, but you had still better go back
and do your homework over again, since it still doesn't say that
void main() is "illegal".

Actually, I'm going to give you a homework assignment. Go back
and read the post where someone shows the output of your "well-
formed C++ program" on bcc using the /a option (which enables
ANSI mode). Then come back here and argue that Borland and
bcc consider "void main()" to be well-formed. Better yet, compile
the code for yourself, so you don't have any excuse.

I'm not even going to give you a grade, because that would imply that
you've been admitted to a school. But the only place you could get
admitted has nice padded walls and funny jackets with straps on
the arms.

Dave
 
G

Greg Comeau

You're right. They didn't fail that section. That's because when used
in ANSI mode, it properly emits a diagnostic for "void main()". Which
means that a program containing "void main()" is ill-formed, regardless
of whether it is accepted as an extension. However, bcc does not
enable ANSI mode by default, because it's pretty much worthless.
To write any interesting programs, you need the Windows headers,
which pretty much cause an overwhelming cascade of diagnostics in
ANSI mode. But obviously, you haven't used bcc for serious work,
or you'd know all this. On the other hand, I have.


Actually, I'm going to give you a homework assignment. Go back
and read the post where someone shows the output of your "well-
formed C++ program" on bcc using the /a option (which enables
ANSI mode). Then come back here and argue that Borland and
bcc consider "void main()" to be well-formed. Better yet, compile
the code for yourself, so you don't have any excuse.

I'm not even going to give you a grade, because that would imply that
you've been admitted to a school. But the only place you could get
admitted has nice padded walls and funny jackets with straps on
the arms.

Just a nitpick, but I think it's /A which has Borland reject
void main, not /a
 
A

Alexander Terekhov

Greg Comeau wrote:
[...]
Or something like: if used, the implemention defined equivalent of
exit(EXIT_SUCCESS), whether it actually calls exit or not.

Rather: pthread_exit(0) (thread::exit()). main() shall be deprecated.

regards,
alexander. <PRO "T main_thread::run(/*...*/)" (as main() replacement)>
 

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

Similar Threads


Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,241
Latest member
Lisa1997

Latest Threads

Top