Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Void Main?

Reply
Thread Tools

Void Main?

 
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 3:08*am, Keith Thompson <(E-Mail Removed)> wrote:
> spinoza1111 <(E-Mail Removed)> writes:
> > On Dec 26, 7:03*pm, Seebs <(E-Mail Removed)> wrote:
> >> On 2009-12-26,WangYip<(E-Mail Removed)> wrote:
> >> > Hi Buddy look I work in very advanced C project, all very difficult
> >> > features as templates, override virtual methods, overload....

>
> >> That would be C++, not C.

>
> > C constitutes a subset of C++.

>
> [...]
>
> "spinoza1111" is mistaken. *C is *nearly* a subset of C++, andWangYiphas found one of the areas of inconsistency, namely the meaning
> of empty parentheses in a function declaration.


C is a subset of C++ not mathematically (it is a vicious illusion that
something so subject to vendor greed is a mathematical object) as a
matter of understanding. A "fuzzy" subset. One of these days, Kiki,
you might get up to my more nuanced understanding. But I won't bet on
it.
>
> --
> Keith Thompson (The_Other_Keith) (E-Mail Removed) *<http://www.ghoti.net/~kst>
> Nokia
> "We must do something. *This is something. *Therefore, we must do this."
> * * -- Antony Jay and Jonathan Lynn, "Yes Minister"


 
Reply With Quote
 
 
 
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 2:44*am, Flash Gordon <(E-Mail Removed)> wrote:
> Seebs wrote:
> > On 2009-12-26,WangYip<(E-Mail Removed)> wrote:
> >> Hi Buddy look I work in very advanced C project, all very difficult
> >> features as templates, override virtual methods, overload....

>
> > That would be C++, not C.

>
> I really do find it amazing that people can consider themselves experts
> when they don't even know the name of the language they are programming in.


Wang Yip does know the name. The problem is that C as an artifact is
yapped about by people in a self-interested way so as to destroy
reputations. You people don't write code, in all probability.
>
> >> and I never see (void) parameter.

>
> > This makes it hard to believe you've worked on significant C.

>
> Not knowing the difference between the two languages makes it impossible
> to believe he's worked on any significant C project. If he tried he
> would just end up wondering why his code did not compile.


He uses both languages, probably more intensely than anyone else
here.
>
> >> You will oppose my experience but US
> >> imperialist only....... Then **** you buddy..

>
> > Congratulations! *You've ensured that people will not try to help you
> > even though you're clearly a newbie who desperately needs help.

>
> Yes, he's even got the wrong country. I'm one of the British Imperialists....


....who started the brutalization of China by stealing territory and
destroying an ancient cultural monument, the Summer Palace...
>
> > So you might (if you think about it, and drop the feeling of
> > entitlement...) actually get a valuable lesson from this all -- if
> > you're asking people to spend their time and effort helping you
> > for free, maybe insulting them and claiming to be a super expert
> > when you're obviously a complete newbie isn't the best path.

>
> He also needs to learn which language is which. Without that knowledge
> he won't get very far. Without improving his English he will also find
> it hard to deal with requirement specifications written in English (or
> American) which will also limit him (if you can't understand the


Understanding English is a separate skill from writing, and he writes
reasonable Chinglish. As the manager of a Chinese/English translation
group in the mainland I didn't have to master Chinese because the
technicians produced reasonable Chinglish documents which I was able
to transform to contemporary business English.


> requirement spec, you can't design, and requirements often use the
> language in fairly sophisticated ways). Mind you, I would stand no
> chance of getting a job in a non-English speaking country (or where
> documentation was primarily written in another language) because I would
> not sand a chance of getting any proficiency in another language.


Yes, and before you try that, you need to improve your English:

(1) "sand" a chance

(2) Not "getting any proficiency": "becoming proficient"


> --
> Flash Gordon


 
Reply With Quote
 
 
 
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 5:02*am, Seebs <(E-Mail Removed)> wrote:
> On 2009-12-26, Keith Thompson <(E-Mail Removed)> wrote:
>
> > spinoza1111 <(E-Mail Removed)> writes:
> >> C constitutes a subset of C++.

> > [...]
> > "spinoza1111" is mistaken. *C is *nearly* a subset of C++, andWang
> >Yiphas found one of the areas of inconsistency, namely the meaning
> > of empty parentheses in a function declaration.

>
> I believe you'll find that, since this difference has actually affected a
> poster to the newsgroup, that it is part of a global conspiracy against
> Herbert Schildt. *Clearly, a dire circumstance, when language features
> are designed in the late 80s precisely to make naive readers think Spinny
> doesn't know what he's talking about, when in fact, he understood both
> languages quite well until time-travelling anti-Schildt conspiracy
> theorists went back to the 1980s and introduced the incompatibility.
>

To the ignorant, "conspiracy theory" and knowledge are easily
confused. You attacked Herbert Schildt, saying among other things that
"the 'heap' is a DOS term" without academic training in computer
science. It wasn't a conspiracy, just a fact.
> -s
> --
> Copyright 2009, all wrongs reversed. *Peter Seebach / (E-Mail Removed)://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!


 
Reply With Quote
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 3:08*am, Keith Thompson <(E-Mail Removed)> wrote:
> spinoza1111<(E-Mail Removed)> writes:
> > On Dec 26, 7:03*pm, Seebs <(E-Mail Removed)> wrote:
> >> On 2009-12-26,WangYip<(E-Mail Removed)> wrote:
> >> > Hi Buddy look I work in very advanced C project, all very difficult
> >> > features as templates, override virtual methods, overload....

>
> >> That would be C++, not C.

>
> > C constitutes a subset of C++.

>
> [...]
>
> "spinoza1111" is mistaken. *


You keep saying you'll ignore me. Why do you continue to break your
committments?


C is *nearly* a subset of C++, and Wang
> Yip has found one of the areas of inconsistency, namely the meaning
> of empty parentheses in a function declaration.


By saying emphatically using "differently" unnecessarily, you imply
that C and C++ are not dialects with respect to each other such that
some C programs can be compiled by C++ compilers (in fact, most C
programs can be compiled by C++ compilers).

But since most C++ compilers can compile C, C is as a practical matter
a subset of C++.

You seem unaware that while it may seem scientific to treat "C" and "C+
+" as simple objects without parts and as part of nature, they are
complex objects with many moving parts and a social construct. This
means as a practical matter that Wang Yip is probably using, and
expert in, both languages as a real programmer, as opposed let us say
to a person (Seebs) who's never taken a computer science class and
apparently mostly writes shell scripts, or a Nokia manager-programmer
who's probably too "valuable" to code in the sense that he's overpaid.

Microsoft C supports almost all forms of C within C++, and because
Windows is competently written, you can return from main without
fearing you'll break anything; the void main nonsense was probably the
result of greedy vendors who've laid off competent compiler people in
favor of script kiddies without formal training in CS, and the script
kiddies would run home to Mommy's basement if they had to modify the
vendor OS to not break when returned something strange. But that's
just speculation, of course.

It's very hard in my direct experience in mainland China and Fiji for
developers to get their hands on a range of computer books including
books that clarify the mess that was made of C99. Instead, they work
24/7 reverse engineering their compilers and of necessity they treat
their compilers as definitive.

This means that they are more and not less competent for the same
reason Dave Hanson told me at Princeton that he felt that Cobol
programmers, who also must make a silk purse out of a sow's ear, are
competent.

Wang Yip, in short, doesn't sit around with the guys at the office
sniggering about Nilges or Schildt. He should be treated with respect.
>
> --
> Keith Thompson (The_Other_Keith) (E-Mail Removed) *<http://www.ghoti.net/~kst>
> Nokia
> "We must do something. *This is something. *Therefore, we must do this."
> * * -- Antony Jay and Jonathan Lynn, "Yes Minister"


 
Reply With Quote
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 5:31*pm, Richard Heathfield <(E-Mail Removed)> wrote:

Welcome back. Hope you had a nice holiday (mean that: "keep your
friends close, keep your enemies closer" - Sun Tzu)

> In <(E-Mail Removed)>,
>
> spinoza1111wrote:
> > On Dec 27, 3:08 am, Keith Thompson <(E-Mail Removed)> wrote:
> >>spinoza1111<(E-Mail Removed)> writes:

>
> <snip>
>
> >> > C constitutes a subset of C++.

>
> >> [...]

>
> >> "spinoza1111" is mistaken.

>
> > You keep saying you'll ignore me. Why do you continue to break your
> > committments?

>
> What commitment? He replies to whom he will. So do I. So do you.


Which means his committments to bind himself, like those of your
Parliament, cannot be trusted, whereas I am more like our Congress,
able to bind myself under a written Constitution.

>
> >> C is *nearly* a subset of C++, and Wang
> >> Yip has found one of the areas of inconsistency, namely the meaning
> >> of empty parentheses in a function declaration.

>
> > By saying emphatically *using "differently" unnecessarily, you imply
> > that C and C++ are not dialects with respect to each other such that
> > some C programs can be compiled by C++ compilers (in fact, most C
> > programs can be compiled by C++ compilers).

>
> Not always with identical semantics. This is trivial to demonstrate.
> It is even more trivial to demonstrate an example of a legal C
> program that is not a legal C++ program. For your claim about C being
> a subset of C++ to be true, *all* legal C code would have to be legal
> C++ code, and it isn't, so it isn't.


No, not "all". C and C++ are dialects with respect to each other
because there is C code that isn't C++, C++ code that isn't C, and
code that's both (trivial example: "i = 0;"). But one language (C++)
is larger therefore may be considered a fuzzy superset.

Furthermore, and from a standpoint of formal language theory, there
exists the union of C and C++, trivially, the set of all possible
valid programs in C and C++. Wang Yip appears to have mastered this
nameless superset on the job, which is more than I can say for some
people here.

The problem is mastering the nameless union, for all platforms, and I
have yet to see someone with sufficient intelligence, vendor
independence, and maturity to write a book about C/C++ that doesn't
whine about the "proper" way to return to the OS or promote his
favorite (Microsoft or the complement set) vendor's interests. If such
a book exists, lemme know.


>
> > But since most C++ compilers can compile C, C is as a practical
> > matter a subset of C++.

>
> C++ compilers compile C++. If a program offers compilation under C
> rules, it is a C compiler. If it offers compilation under C++ rules,
> it is a C++ compiler. If it offers compilation under both languages,
> it is a compiler for both languages. The fact that GCC can compile
> Fortran does not make C++ a subset of Fortran.


No, it means that GCC supports a union of C++ and Fortran. For what
earthly reason I do not know. The relationship between C and C++ is
much closer, because as a general law, all competent programmers take
one look at C and say "gee, I could do better than that", and develop C
++, awk, grep, shep, blarg...anything not to have to program in C.


>
> <nonsense snipped>


Don't cut yourself.

>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www. +rjh@
> "Usenet is a strange place" - dmr 29 July 1999
> Sig line vacant - apply within


 
Reply With Quote
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 7:05*pm, Richard Heathfield <(E-Mail Removed)> wrote:
> spinoza1111wrote:
> > On Dec 27, 5:31 pm, Richard Heathfield <(E-Mail Removed)> wrote:

>
> <snip>
>
> >> In <(E-Mail Removed)>,
> >> spinoza1111wrote:

>
> <snip>
>
> >>> You keep saying you'll ignore me. Why do you continue to break your
> >>> committments?
> >> What commitment? He replies to whom he will. So do I. So do you.

>
> > Which means his committments to bind himself [...] *cannot be trusted,

>
> No, it doesn't. It means that he replies to whom he will. He can
> voluntarily refrain from replying for a time without giving up the right
> * to reply later on.


Yes, and it means that he has no self-discipline.
>
> <snip>
>
> >>> [...] some C programs can be compiled by C++ compilers (in fact, most C
> >>> programs can be compiled by C++ compilers).
> >> Not always with identical semantics. This is trivial to demonstrate.
> >> It is even more trivial to demonstrate an example of a legal C
> >> program that is not a legal C++ program. For your claim about C being
> >> a subset of C++ to be true, *all* legal C code would have to be legal
> >> C++ code, and it isn't, so it isn't.

>
> > No, not "all". C and C++ are dialects with respect to each other
> > because there is C code that isn't C++, C++ code that isn't C, and
> > code that's both (trivial example: "i = 0;").

>
> And therefore neither is a subset of the other.


Not in the literal sense, no. But part of being smart dear boy is
latitudinarianism as opposed to fundamentalism, neither of which
should be confused with antidisestablishmentarianism.

When you say "C is NOT C++" you're not an educator, but a sort of
ranting preacher who's no friend of knowledge.
>
> > But one language (C++)
> > is larger therefore may be considered a fuzzy superset.

>
> With the added qualifier (but not without it) the statement is correct.


Good show.
>
> > Furthermore, and from a standpoint of formal language theory, there
> > exists the union of C and C++, trivially, the set of all possible
> > valid programs in C and C++.

>
> Wrong. That is the intersection of C and C++. The union of C and C++ is
> the set of all programs that are valid in either C or C++ or both.


Oh dear. You misunderstand, or I misspoke. "And" was not used to mean
formal logical intersection. The statement was shorthand for "the set
of all possible programs in C AND the set of all possible programs in C
++.
>
> *> Wang Yip appears to have mastered this
>
> > nameless superset on the job, which is more than I can say for some
> > people here.

>
> It is evident from his articles that he has mastered neither language.
> That is not a criticism of him, however; very few people have mastered
> C, and fewer still have mastered C++.


The type of "mastery" of which you speak is a sort of Scholasticism
which good programmers ignore. As I have pointed out, the usual
reaction of a good programmer to C is to use it to replace having to
actually code in C.
>
> <snip>
>
> >>> But since most C++ compilers can compile C, C is as a practical
> >>> matter a subset of C++.
> >> C++ compilers compile C++. If a program offers compilation under C
> >> rules, it is a C compiler. If it offers compilation under C++ rules,
> >> it is a C++ compiler. If it offers compilation under both languages,
> >> it is a compiler for both languages. The fact that GCC can compile
> >> Fortran does not make C++ a subset of Fortran.

>
> > No, it means that GCC supports a union of C++ and Fortran.

>
> That, at least, is true.
>
> > For what earthly reason I do not know.

>
> Presumably so that people can use GCC to write Fortran programs as well
> as C and C++ programs.


Wow, some people are gluttons for punishment.
>
> <snip>
>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www. +rjh@
> "Usenet is a strange place" - dmr 29 July 1999
> Sig line vacant - apply within


 
Reply With Quote
 
spinoza1111
Guest
Posts: n/a
 
      12-27-2009
On Dec 27, 7:29*pm, Richard Heathfield <(E-Mail Removed)> wrote:

Hey, you forgot to apologize for lying about my presence on
comp.risks. Just thought I'd remind you.

> spinoza1111wrote:
> > On Dec 27, 7:05 pm, Richard Heathfield <(E-Mail Removed)> wrote:
> >> spinoza1111wrote:

>
> <personal attack snipped>


I guess a person who only knows how to damage people online doesn't
recognize how everything he posts is a personal attack.

>
> <snip>
>
> >>> [...] because there is C code that isn't C++, C++ code that isn't C, and
> >>> code that's both (trivial example: "i = 0;").
> >> And therefore neither is a subset of the other.

>
> > Not in the literal sense, no.

>
> Precisely.
>
> <nonsense snipped>
>
> > When you say "C is NOT C++" you're not an educator, but a sort of
> > ranting preacher who's no friend of knowledge.

>
> Rubbish. The distinction is vital in the real world.


Actually, that's not true. You can use the compiler either way and if
your solution works it doesn't matter whether or not you use C++ or C.
Either way, owing to the common deficiencies of both languages, you've
created something that's significantly less reliable than C Sharp or
Java INDEPENDENT of your "good style", because under software
maintenance it becomes something different, something which you cannot
control.


>
> >>> But one language (C++)
> >>> is larger therefore may be considered a fuzzy superset.
> >> With the added qualifier (but not without it) the statement is correct..

>
> > Good show.

>
> Had you got it right in the first place, there would have been no cause
> to correct you. Still, at least we have reached *one* point of agreement.


If it pleases you to fantasize you're teaching me a goddamn thing,
knock yourself out.

>
> >>> Furthermore, and from a standpoint of formal language theory, there
> >>> exists the union of C and C++, trivially, the set of all possible
> >>> valid programs in C and C++.
> >> Wrong. That is the intersection of C and C++. The union of C and C++ is
> >> the set of all programs that are valid in either C or C++ or both.

>
> > Oh dear. You misunderstand, or I misspoke. "And" was not used to mean
> > formal logical intersection. The statement was shorthand for "the set
> > of all possible programs in C AND the set of all possible programs in C
> > ++.

>
> Actually, I can accept that you meant that.


My goodness, we are full of good cheer. Next thing, you will apologize
for lying about my presence on comp.risks. I look forward to reading
your retraction.

> It is surprisingly difficult
> to ensure that one's text is always so unambiguous as to yield no
> reasonable interpretations except the intended one. I am occasionally
> surprised by the meanings people ascribe to my own writings, that are
> completely different to what I actually intended.


Wow. The light dawns. Praise Jesus!

>
> >> *> Wang Yip appears to have mastered this

>
> >>> nameless superset on the job, which is more than I can say for some
> >>> people here.
> >> It is evident from his articles that he has mastered neither language.
> >> That is not a criticism of him, however; very few people have mastered
> >> C, and fewer still have mastered C++.

>
> > The type of "mastery" of which you speak is a sort of Scholasticism
> > which good programmers ignore.

>
> No, the type of mastery of which I speak includes (but is by no means
> limited to) basic knowledge of the language. A programmer who has never
> encountered the void type in a prototype has not yet had sufficient
> experience of the C language to justify a claim to mastery of that language.


Not so. He may exist in a disciplined development environment where
the type isn't used. The question is whether he can crank code in a
reliable way, and based on my experience with developers in mainland
China leads me to believe that Wang Yip can. As I have said,
programming skill is independent of knowledge of minutiae and
shibboleths.

Indeed, in a competent development environment, you'd never see the
need for "sequence points" since people would think through the
implications of expressions. Therefore, these developers would be
innocent of evil, like Adam and Eve, but would be more productive &
skilled.


>
> *> As I have pointed out, the usual
>
> > reaction of a good programmer to C is to use it to replace having to
> > actually code in C.

>
> This is not an advocacy group. If you don't like C, nobody is forcing
> you to use it.


Opinions on C are on-topic here. If I can prevent one newbie from
being turned into the sort of programmers I see here, I am doin' good.

>
> <snip>
>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www. +rjh@
> "Usenet is a strange place" - dmr 29 July 1999
> Sig line vacant - apply within


 
Reply With Quote
 
Tim Rentsch
Guest
Posts: n/a
 
      01-13-2010
http://www.velocityreviews.com/forums/(E-Mail Removed) (Kenny McCormack) writes:

> In article <(E-Mail Removed)>,
> Keith Thompson <(E-Mail Removed)> wrote:
> ...
>>C is case-sensitive. "Main" and "main" are two distinct identifiers,
>>as are "Void" and "void".

>
> Strictly speaking, void is not an identifier. Main, main, and Void
> are, though.


Strictly speaking, void is an identifier. In phases 7 and
8, it is (either also, or instead) a keyword.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      01-13-2010
Tim Rentsch <(E-Mail Removed)> writes:
[...]
> Strictly speaking, void is an identifier. In phases 7 and
> 8, it is (either also, or instead) a keyword.


My reading is that void is an identifier (a kind of
preprocessing-token) in translation phases 3 through 6. In phase 7,
it's converted from a preprocessing token to a token; at this point,
it is a keyword and *not* and identifier.

void certainly meets the syntax of an identifier, but not the
semantics. See C99 6.4.2.1p2:

An identifier is a sequence of nondigit characters (including the
underscore _, the lowercase and uppercase Latin letters, and other
characters) and digits, which designates one or more entities as
described in 6.2.1.

void does not designate any of the entities described in 6.2.1. See also
6.4.2p4:

When preprocessing tokens are converted to tokens during
translation phase 7, if a preprocessing token could be converted
to either a keyword or an identifier, it is converted to a
keyword.

Not that it matters a great deal. The standard could have made
keywords a subset of identifiers, even in phase 8, while still
describing the same language (though some reference to identifiers
would have to be changed to "identifiers other than keywords").

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Antoninus Twink
Guest
Posts: n/a
 
      01-16-2010
On 13 Jan 2010 at 3:11, Keith Thompson wrote:
> My reading is that void is an identifier (a kind of
> preprocessing-token) in translation phases 3 through 6. In phase 7,
> it's converted from a preprocessing token to a token; at this point,
> it is a keyword and *not* and identifier.
>
> void certainly meets the syntax of an identifier, but not the
> semantics. See C99 6.4.2.1p2:

[snip]
> void does not designate any of the entities described in 6.2.1. See also
> 6.4.2p4:


Thanks so much for clearing that up, Keith.

This important question has been gnawing away at my peace of mind for
some months now, but at long last I'll be able to sleep easy tonight
knowing that it's been resolved.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between void proba(); and void proba(void); ??? PencoOdStip@gmail.com C++ 1 05-23-2007 07:12 PM
what is the difference, void func(void) and void fucn() noblesantosh@yahoo.com C Programming 5 07-22-2005 04:38 PM
"void Method()" vs "void Method(void)" Ollej Reemt C++ 7 04-22-2005 03:47 AM
returning a void (*)(void) Sergio C++ 6 01-05-2005 08:30 PM
`void **' revisited: void *pop(void **root) Stig Brautaset C Programming 15 10-28-2003 09:03 AM



Advertisments