468,490 Members | 2,568 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,490 developers. It's quick & easy.

Making C better (by borrowing from C++)

I know that this topic may inflame the "C language Taleban", but is
there any prospect of some of the neat features of C++ getting
incorporated in C? No I am not talking out the OO stuff. I am talking
about the non-OO stuff, that seems to be handled much more elegantly in
C++, as compared to C. For example new & delete, references, consts,
declaring variables just before use etc.

I am asking this question with a vested interest. I would really like
to use these features in my C programs.

Masood
Dec 23 '07
204 4114
ym******@gmail.com writes:
On Dec 25, 1:57 pm, Mark McIntyre <markmcint...@spamcop.netwrote:
>On Mon, 24 Dec 2007 20:25:47 -0800, ymuntyan wrote:
>And you're apparently the sort of person who will ignore the will of
the majority.
"Vote", huh? Now that was a vote.

Yup. People were invited to offer an opinion. Those who had an opinion
voted.
>Democracy, huh? If you want to call it
a vote, then call it what it is: a made up vote.

False. Every reader of CLC had a chance to vote. Many did so. The votes
of those people were counted and assigned.

Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.
You got to either have a very thick skin or be mad to
express your opinion if it in any (*any*) way conflicts
with the opinion of self-appointed majority. I must be
mad now, so am writing this letter to Santa.
You had a golden opportunity to expression your opinion in a thread
that people were actually paying attention to. It's hardly anybody
else's fault if you failed to do so.

I wouldn't necessarily call that thread a "vote"; it was more of an
informal survey.

You're expressing your opinion now. I don't expect that you'll be met
with anything more serious than disagreement.

[snip]
I even don't like JN pushing his compiler here and there,
but I believe he causes MUCH less troubles here than those
"defending" comp.lang.c and the future of C programming
and all other important things in life. And if I got to
join a club here (or "majority-minority", or what you call
that), then I better be with Kenny, because he's way
more honest than you and some other so-called regulars[*].
Kenny? You have *got* to be kidding. He deliberately disrupts this
group and contributes practically nothing.

[...]
[*] Keith, it wasn't about you. You are honest.
Well, thank you for that.
You are just
either blind or a robot.
Nope.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Dec 25 '07 #51
Paul Hsieh wrote:
On Dec 25, 5:13 am, James Kuyper <jameskuy...@verizon.netwrote:
....
>I normally try to define each variable so that it has as small a
scope as possible (without gratuitous use of {} to create a smaller
scope just for the variable).

That's great for some minimalist sense while you are *writing* the
code, but it then becomes impossible to *read* the code afterwards.
My experience does not match your assertion.
If you know variable declarations are always at the top of a scope,
you can always find your local variables in a fast, deterministic
way. ...
Only if you know which scope it is defined in. Since scopes nest in C,
there's no way to be certain unless declarations are restricted not
merely to the top of the scope, but to the top of the function. I would
argue against the "top of the function" solution, but since you don't
seem to be advocating it, I won't bother.

Since a large fraction of the code I've ever worked on was written by
other people, there's no guarantee that any given variable is declared
in any particular scope, no matter what I might prefer. I have to do
the same kind of backwards search to find the top of the right scope
that I would have to perform to find a declaration that's not at the top
of a scope, so I don't see how it saves me any trouble.
... The "gratuitous" {} 's give you the required indication to find
these declaration points easily.
They also make the program harder to read and comprehend, in my experience.
>I've personally found that this greatly reduces my
search times, because I don't have to search as far to find it.

If you are using a tool, maybe. But if you are scanning by eye?
There's simply no comparison. You have to linearly search the entire
sequence of lines, unless you already know how and where the variable
is used. You are, in other words, giving up on the natural
expressiveness of the language, in favor of burning neurons on this
kind of information or just being slower in reading code.
In my experience, the search is easier whether I use my eyes or other
tools to perform it.
>Mixing declarations and statements allows me to shorten the scope
even more, which reduces it further.

This just seems like a drive to a purpose that is wrong headed to
begin with. With C you have the opportunity to be optimally clear
about every variable in your program. They went and just messed that
up in C99 for no good purpose.
In my experience, code is clearer when definitions are closer to first
use, than it is when they're artificially constrained to be declared
somewhere prior to first use.
Dec 25 '07 #52
jacob navia <ja***@nospam.comwrites:
Keith Thompson wrote:
[...]
What bothers you is that lcc-win tries (and implements) an
effort to make C advance, by incorporating many things that
are necessary in a modern software development environment.
No, that's not what bothers me.

One thing that really bothers me is someone presuming to tell me what
bothers me, and getting it wrong again and again. You obviously don't
understand what I and others really think. I suggest you either stop
guessing, or read what people are really writing.
The regulars here (and all C++ people) agree that the only
advance for C is to go to C++ and leave C to disappear.
Wrong.

[...]
You (and the regulars) agree with all the compiler vendors that
consider C a dead language with no customers and will not
do anything for it, not even implement the C99 standard.
Wrong.

As an end user, there's no much I can do to encourage vendors to
implement C99.

Actually, there is one thing I can do (though it doesn't seem to do
much good).

jacob, you're a compiler vendor. Please finish implementing the full
C99 standard. Thank you.
Microsoft and GNU agree with you. C++ is the only alternative,
C will never change. Your friend Heathfield wants to come back
even to C 1989.
Wrong again; try reading what he actually writes.

[...]
I sign my messages and my name is in the download page of lcc-win.
The fact that downloads are free, and that I am financing this free
service for C programmers since 10 years from my own money doesn't
give you a hint that lcc-win is not just a commercial affair.
Speaking only for myself, it doesn't matter much to me whether it's
commercial or not. What's relevant is that it's *your* work, and you
often recommending it without explicitly disclosing that fact.

Merry Christmas.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
[...]
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Dec 25 '07 #53
ym******@gmail.com wrote:
On Dec 25, 1:57 pm, Mark McIntyre <markmcint...@spamcop.netwrote:
....
Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.
When you care about something, but don't care enough to bother to vote
about it, you forfeit any claim you might otherwise have had on the
sympathies of your listeners when you complain about the results of the
vote. That's a characteristic of democracy in general, it's not specific
to c.l.c.
>The part where its relevant. All societies are run by vocal minorities.
And they're all self-selecting. In most cases their views are
representative of the wider population.

And this.
I have to agree with you on this point. The vocal minorities are not in
general representative of the wider population. In a true representative
democracy, they represent a kind of weighted average of the wider
population, with those who care enough to vote getting a weight of 1,
and those who don't getting a weight of 0. That strikes me as fairer
than an unweighted representation, not less fair.
Dec 25 '07 #54
jacob navia wrote:
....
The regulars here (and all C++ people) agree that the only
advance for C is to go to C++ and leave C to disappear.
I think it would be a mistake for C to adopt changes that make it more
similar to C++ at the cost of significantly reducing C's simplicity
advantage over C++; that course will certainly lead to C's disappearance.

However, I think it would be wonderful thing for C99 to advance in it's
own direction, to stake out a territory for itself that doesn't overlap
that of C++. Sticking to simplicity as a key distinction points to a
logical target for future expansion: systems so small that the
simplicity of C makes it a better choice than the power of C++.

....
Well, I mention lcc-win when is on topic.
True. You seize every opportunity to mention lcc-win, I wouldn't expect
you to break that pattern by not mentioning it on those rare occasions
when it is on-topic.
Dec 25 '07 #55
Ian Collins wrote:
ym******@gmail.com wrote:
>Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

You had your chance, now you have to put up with the result. That's the
way democracy tends to work.
We have east-block democracy here now???
Dec 26 '07 #56
Sjouke Burry wrote:
Ian Collins wrote:
>ym******@gmail.com wrote:
>>Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

You had your chance, now you have to put up with the result.
We have east-block democracy here now???
Doesn't that remove the first part of my statement?

--
Ian Collins.
Dec 26 '07 #57
James Kuyper wrote:
jacob navia wrote:
...
>The regulars here (and all C++ people) agree that the only
advance for C is to go to C++ and leave C to disappear.

I think it would be a mistake for C to adopt changes that make it more
similar to C++ at the cost of significantly reducing C's simplicity
advantage over C++; that course will certainly lead to C's disappearance.

However, I think it would be wonderful thing for C99 to advance in it's
own direction, to stake out a territory for itself that doesn't overlap
that of C++. Sticking to simplicity as a key distinction points to a
logical target for future expansion: systems so small that the
simplicity of C makes it a better choice than the power of C++.
Operator overloading is a very simple addition, shared by many
languages from fortran to C#. It is a very simple addition to
the compiler but a boon to the language since it would be impossible
to accommodate the plethora of new numeric types EACH time by
making the compiler a bit more complex.

We have 15+ numeric types in C. We can't extend that to include the
proposed decimal numbers implementation (that has been published in a
TR in the standards discussion) or to accommodate the fixed point
numbers (essential for many embedded systems), and many others.

This small extension would allow to make complex numbers, decimal
floating point numbers, fixed point numbers, extended precision numbers,
and MANY others coexist without making a language BLOAT.

Many people have objected to complex numbers being in the language.
This is comprehensible for people using embedded systems where complex
numbers wouldn't make much sense.

For numeric applications however, complex numbers are important. By
allowing operator overloading we make the language SIMPLER and more
COMPACT. We give users the power to develop new numeric types
AS THEY FIND USEFUL, without waiting 10 years for a change in the
language itself.

Otherwise how you would do it? How would you incorporate decimal floating
point and fixed point within C?
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #58
In article <fogcj.3442$nh7.2410@trnddc01>,
James Kuyper <ja*********@verizon.netwrote:
>ym******@gmail.com wrote:
>On Dec 25, 1:57 pm, Mark McIntyre <markmcint...@spamcop.netwrote:
...
>Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

When you care about something, but don't care enough to bother to vote
about it, you forfeit any claim you might otherwise have had on the
sympathies of your listeners when you complain about the results of the
vote. That's a characteristic of democracy in general, it's not specific
to c.l.c.
This is, to use Marky Mark McIntyre's word du jour, horseshit.

First of all, as ymuntyan made very clear, it was abundantly clear that
anyone who expressed an opinion at odds with the reigning dogma, was
going to get flamed mercilessly (as they always do), so there simply
wasn't any point in expressing any contrary view. Clearly, the only
purpose of the item was for the sycophants to earn sycophant points.

Second, in any voting situation, once it becomes clear which way it is
going, there's never any point in any individual bothering to vote.
That's always been true. But it doesn't mean that said people give up
any rights to complain about how things turned out. That's (thinking
this way) just silly.

Dec 26 '07 #59
On Dec 25, 4:58 pm, Ian Collins <ian-n...@hotmail.comwrote:
ymunt...@gmail.com wrote:
Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

You had your chance, now you have to put up with the result. That's the
way democracy tends to work.
I have my chance for what exactly? When did I have it? Was
I notified about it? Should I have read two hundred posts
in the thread I had no interest in after reading first ten
posts? Should I have known that it was going to be some kind
of some democracy thing? The fact that Richard Heathfiled
asks some question doesn't mean that it's going to be some
vote which I should respect all of the sudden. At least
I didn't know it should mean that.

Next, what result? Could you show me the result? How many
people have voted? What was on the ballot? You've got no
idea, don't you? You simply know that "there was a vote"
(did you learn about it from Marc's post? I learned about
it from Marc's post, though Keith elsewhere says it wasn't
a vote), and you agree with what you think the results were,
and now you're teaching me democracy?

BS. Absurd. "Vote" man, that was a vote!

By the way, now I don't know if there really was a vote,
because I thought there were, but Keith says there wasn't.
I tried to check, and failed. But I learned another thing:
that mentioning that thread is actually cheating. It's so
huge that it's useless for getting any information about
what people in comp.lang.c think. (Unless you want to know
an opinion of certain person, or you like to read that
kind of stuff)

Yevgen
Dec 26 '07 #60
In article <5t*************@mid.individual.net>,
Ian Collins <ia******@hotmail.comwrote:
>Martin Ambuhl begged for attention by posting a bunch of crap which is
snipped:
....
>And that, silly boy, is either a flat lie or shows that you are
completely out of touch with the world.

I see the Grinch uses Usenet...
Ole Marty is another excellent example of someone who did not earn his
mother's love.

Dec 26 '07 #61
Sjouke Burry said:
Ian Collins wrote:
>ym******@gmail.com wrote:
>>Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

You had your chance, now you have to put up with the result. That's the
way democracy tends to work.
We have east-block democracy here now???
Not at all. If you want to open up the topicality discussion again, feel
free, but don't be surprised if lots of people respond "we just dealt with
this a few months ago, didn't we?"

Incidentally, I was in the minority (as I suspected I would be). If I can
abide by the majority decision despite not being totally happy with it, I
see no reason why others can't.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #62
Keith Thompson wrote:
I don't agree with jacob's point, though. Just adding operator
overloading isn't enough to accomodate arbitrary new numeric types.
For example, you need literals (lcc-win uses a 'q' suffix for qfloat).
This problem exists in C++ also and there no solution has been found.

I use a solution (that isn't published as a solution in my proposal)
of loading a dll and executing a function from it.
You also need to define rules for implicit conversions to and from
other numeric types. There are probably other complications I haven't
thought of.
The operator cast will do that.

output_type operator ()(input_type);

will transform input_type into output_type.
I wouldn't mind seeing a mechanism for adding new numeric types
without having to make changes to the language, but I don't believe
operator overloading alone will do the job.
It does. I have implemented the complex numbers with it, and
the qfloat extension.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #63
Keith Thompson said:

<snip>
In any case, Chuck is of course correct that operator overloading is
not part of C
If he means user-defined operator overloading (which he has not made
clear), he is correct. But operators are overloaded routinely within C.
Even the humble + operator has many meanings; not only does it have a
variable number of operands, but the types of those operands are by no
means fixed, so we have "+ that adds two int types; + that adds an int to
a double; + that adds two doubles; + that adds a pointer and an int", and
so on. And don't get me started on * ! :-)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #64

"Ben Bacarisse" <be********@bsb.me.ukwrote in message
Do you have a plan to implement C99? A full C99 implementation would
be more useful to many than extensions that lock programmers in to
your compiler.
The best situation is a good standard that is accepted. We can have a
sensible argument about whether it is better to have an inadequate standard
that is accepted or no accepted standard at all. The worst situation is an
inadequate standard which is largely rejected, but kept alive by a few
implementations.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #65

"Ian Collins" <ia******@hotmail.comwrote in message
>
>A compiler can always determine if a variable has const semantics
without programmer assistance.
Only a psychic compiler can determine the programmer's intent and they
are rare indeed.
A compiler can pretty easily determine wheter a variable is written to or
not, excluding perhaps extremely silly games with saving pointers to disk
and the like.
It cannot determine whether that variable "ought" to be written to or not.
What you are saying with const is that the programmer who writes the word
"const" does know, whilst the programmer who writes *ptr = x does not. Which
will be true at least some of the time, but not always.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #66
"Richard Heathfield" <rj*@see.sig.invalidwrote in message
>
Incidentally, I was in the minority (as I suspected I would be). If I can
abide by the majority decision despite not being totally happy with it, I
see no reason why others can't.
I've got very strong views on car use.
However I may not set up my own referendum, and on the basis of that start
organising "car smashes", going into supermarket car parks and burning all
the cars, because my referees have decided that the supermarket business
model is an exercise in almost criminal futility.
(Of course if the supermarkets themselves claim to be above the law it would
be a different story. :-) )

Gordon Brown, however, can call a referendum, because he is man in charge of
the government. If it came out against supermarkets with car parks, the case
for closing them down would be overwhelming.

The point is you have to have legitimate authority to make laws.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
Dec 26 '07 #67
"James Kuyper" <ja*********@verizon.netwrote in message
>
This is more important for C++, where the fact that it's const can
determine which function override is used,
Eek.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #68
jacob navia <ja***@nospam.comwrites:
Keith Thompson wrote:
>I don't agree with jacob's point, though. Just adding operator
overloading isn't enough to accomodate arbitrary new numeric types.
For example, you need literals (lcc-win uses a 'q' suffix for qfloat).

This problem exists in C++ also and there no solution has been found.

I use a solution (that isn't published as a solution in my proposal)
of loading a dll and executing a function from it.
Huh? How does that address the issue of numeric literals?
>You also need to define rules for implicit conversions to and from
other numeric types. There are probably other complications I haven't
thought of.

The operator cast will do that.

output_type operator ()(input_type);

will transform input_type into output_type.
A cast is an explicit operator. I was talking about implicit
conversions. For example, if ``i'' is of type int and ``d'' is of
type double, then in the expression (i + d) the value of i is
implicitly converted from int to double before the addition.
Determining how to specify that kind of thing for new numeric types
without extending the language itself is non-trivial.
>I wouldn't mind seeing a mechanism for adding new numeric types
without having to make changes to the language, but I don't believe
operator overloading alone will do the job.

It does. I have implemented the complex numbers with it, and
the qfloat extension.
You had to make changes to the language both for complex (_Complex is
a keyword that has to be recognized by the compiler) and for qfloat
(the compiler has to recognize ``1.2Q'' as a qfloat literal).

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Dec 26 '07 #69
Keith Thompson wrote:
jacob navia <ja***@nospam.comwrites:
>Keith Thompson wrote:
>>I don't agree with jacob's point, though. Just adding operator
overloading isn't enough to accomodate arbitrary new numeric types.
For example, you need literals (lcc-win uses a 'q' suffix for qfloat).
This problem exists in C++ also and there no solution has been found.

I use a solution (that isn't published as a solution in my proposal)
of loading a dll and executing a function from it.

Huh? How does that address the issue of numeric literals?
When I see a literal ending with q or Q I call a function from a dll.
like
#pragma numeric('q',qfloat.dll,AsciiToQfloat)
#pragma numeric('Q',qfloat.dll,AsciiToQfloat)
>>You also need to define rules for implicit conversions to and from
other numeric types. There are probably other complications I haven't
thought of.
The operator cast will do that.

output_type operator ()(input_type);

will transform input_type into output_type.

A cast is an explicit operator. I was talking about implicit
conversions. For example, if ``i'' is of type int and ``d'' is of
type double, then in the expression (i + d) the value of i is
implicitly converted from int to double before the addition.
Determining how to specify that kind of thing for new numeric types
without extending the language itself is non-trivial.
You define an operator plus that takes the left hand side
of type1 and the right hand side of type2. Easy.
>>I wouldn't mind seeing a mechanism for adding new numeric types
without having to make changes to the language, but I don't believe
operator overloading alone will do the job.
It does. I have implemented the complex numbers with it, and
the qfloat extension.

You had to make changes to the language both for complex (_Complex is
a keyword that has to be recognized by the compiler)
Yes, but that is unnecessary if we use operator overloading
since you just include the corresponding header file
and for qfloat
(the compiler has to recognize ``1.2Q'' as a qfloat literal).
That could be done with the pragma above
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #70
jacob navia wrote:
>
What bothers you is that lcc-win tries (and implements) an
effort to make C advance, by incorporating many things that
are necessary in a modern software development environment.
What bothers me is the assumption that it is an "advance"
to adopt every fad-of-the-moment that comes along.

--
Eric Sosman
es*****@ieee-dot-org.invalid
Dec 26 '07 #71
In article <cc******************************@bt.com>,
Malcolm McLean <re*******@btinternet.comwrote:
>"Richard Heathfield" <rj*@see.sig.invalidwrote in message
>>
Incidentally, I was in the minority (as I suspected I would be). If I can
abide by the majority decision despite not being totally happy with it, I
see no reason why others can't.
I've got very strong views on car use.
However I may not set up my own referendum, and on the basis of that start
organising "car smashes", going into supermarket car parks and burning all
the cars, because my referees have decided that the supermarket business
model is an exercise in almost criminal futility.
(Of course if the supermarkets themselves claim to be above the law it would
be a different story. :-) )

Gordon Brown, however, can call a referendum, because he is man in charge of
the government. If it came out against supermarkets with car parks, the case
for closing them down would be overwhelming.

The point is you have to have legitimate authority to make laws.
Good points; good post; good use of analogy.

What it boils down to is: What form of government is in force on Usenet
news groups? For most of time, and for most groups, the answer has
always been something which could be described as "True Democracy" (TD) -
aka, Athenian Democracy. That is, everybody votes on every issue (and
everybody's vote counts). An attribute of TD is that no one really has
any power (everybody has equal power).

Now, the point of course, is that no real world country has such a
system today, nor do many corporations. Everything (with probably
countable exceptions) is some form of "Representative Democracy".
"Representative Democracy" (RD) boils down to: individuals have no power;
rather, we employ people who have and wield power.

Now, notice that above I said "most of time and for most groups". My
own view is that there are two significant points to be made about this
generalization:
1) As the Internet and Usenet have evolved and the "chasm" has
been crossed (that's MBA-speak for "The masses have arrived"),
the need for more active policing (an attribute of RD) has
arisen. The masses want and need policing. Now, in fact,
this still hasn't happened on most groups, primarily because
the people involved just want no part of it. So, as
result, Usenet has kind of "withered away". The popular
media pretty much ignores it, and when they do mention it,
they do their best to make it sound obscure and geeky (which
it is - and we like it that way!).
2) CLC (this newsgroup) has, on the other hand, unique in my
Usenet experience, developed a rigid, authoritarian culture.
One that is a form of RD. That is, there are people who run
this place, and we all know and understand that.

Note: Yes, I know the people who run this place will write in to
disagree with #2 above (if they haven't already killfiled me, of
course). Pre-emptive strike (by me): They are lying sacks of crap.

Note also that the people who run this place have a lot in common with
the current GWB admin. More about that in another post...

Dec 26 '07 #72
Eric Sosman wrote:
jacob navia wrote:
>>
What bothers you is that lcc-win tries (and implements) an
effort to make C advance, by incorporating many things that
are necessary in a modern software development environment.

What bothers me is the assumption that it is an "advance"
to adopt every fad-of-the-moment that comes along.
Operator overloading is a technique that is well established and by all
means
not the latest fad.

You have no arguments Eric. Why would operator overloading
be a "fad"?

It is not the latest fad in C++ since many people are against it.
In fortran it was introduced YEARS ago.

I have repeated again and again the need to be able to create new types
of numbers
in C.

How would you solve that problem?

There are two technical reports in the commitee discussion about
o decimal floating point numbers for exact operations
o fixed point representations.

Both are needed. How would you incorporate those into the language?

Don' you see that we can't change the language (and force all
implementations to support) all possible types of numbers?

Please explain how would YOU do this.

Thanks
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #73
In article <fk**********@aioe.org>, jacob navia <ja***@nospam.com>
writes
>ym******@gmail.com wrote:
>So this is your new thing: JN is a spammer. And you are fighting
"commercial exploitation of comp.lang.c". Yeah.
JN vs RH is going on here for years, and suddenly it becomes
fighting spam which can be *mis*interpreted. Good one!
Yevgen

That is ridiculous. I could also argue that RH exploits this group
commercially since the fact of him being the guru here promotes his book
and he earns money with it.

Bloody good point! I had not thought of it that way. However as Jacob's
compiler can be obtained for Free and Richards book can not Richard is
more commercial than Jacob :-)

(get out of that one.....)
>
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #74
In article <5t*************@mid.individual.net>, Ian Collins
<ia******@hotmail.comwrites
>ym******@gmail.com wrote:
>>
Right, so you counted number of those who voted. I called
it a made-up vote because it didn't represent what you claim
it does represent: the opinions of people who care. You counted
number of people who cared to vote. See the difference? I, for
one, do not feel like playing democracy games on comp.lang.c,
but it doesn't mean I don't have an opinion.

You had your chance, now you have to put up with the result. That's the
way democracy tends to work.
The problem is that the vast majority who would have voted have long
since been chased off by the Language Taliban
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #75
>>>>"MMcL" == Malcolm McLean <re*******@btinternet.comwrites:

MMcLI've got very strong views on car use. However I may not
MMcLset up my own referendum, [...]

MMcLGordon Brown, however, can call a referendum, because he is
MMcLman in charge of the government. If it came out against
MMcLsupermarkets with car parks, the case for closing them down
MMcLwould be overwhelming.

MMcLThe point is you have to have legitimate authority to make
MMcLlaws.

Governments derive their powers from the consent of the governed. We
had a discussion about this, and found that the majority of the people
who cared enough to state an opinion preferred limiting the discussion
here to portable standard C, as defined by C99, C89, or K&R.

What is so hard to understand about that?

Charlton


--
Charlton Wilbur
cw*****@chromatico.net
Dec 26 '07 #76
Chris Hills said:
In article <tq*********************@bt.com>, Richard Heathfield wrote:
<snip>
>>
That is what Chris Hills was suggesting - a relaxation of pedantry (which
is simply another way of saying "be less accurate in future").

I did NOT say that.
Er, you did, actually. But I'll accept that you didn't mean to.
The pedantly I was refering to was all the OT crap we get.
See my other reply.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #77

"Chris Hills" <ch***@phaedsys.orgwrote in message
>
Jacobs compilers are as free as GCC compilers. (And the MS & Borland ones)
He releases the executable free for personal use. The source is secret, and
he makes his money on commercial use.
gcc is open source and free for any use, so is freer than lcc-win, whilst MS
release a stripped down and, in my experience, barely useable compiler for
personal use, as long as no open-source or, as they say "virally
licenced"software is developed with it, and charge $$$$ for the full
version. So they are less free than lcc-win.

I am currently trying to decide whether to junk Windows for Linux. It is
just getting too much grief to get a Windows program up and running. I might
try the commerical version of the Vista compiler and see if I can actually
get anything useful done with it. However I don't really like X either, and
I want people to be able to run my stuff.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #78
Chris Hills said:
In article <fk**********@aioe.org>, jacob navia <ja***@nospam.com>
writes
<snip>
>>I could also argue that RH exploits this group
commercially since the fact of him being the guru here promotes his book
and he earns money with it.


Bloody good point! I had not thought of it that way.
It's a ludicrous argument, and a rather self-defeating point. He's saying
that a compiler vendor doesn't know C well enough to be considered a
"guru" - but surely a compiler vendor ought to know C better than
*anyone*! It certainly ought to be the case that he knows C better than I
do, which is why I find it rather strange that even he acknowledges that
he doesn't.

He's also ignoring the fact that the real guru here is Chris Torek, who
knows several hundred times as much about C as I will ever know.

However as Jacob's
compiler can be obtained for Free and Richards book can not Richard is
more commercial than Jacob :-)

(get out of that one.....)
Since I've never, ever promoted the book here, the claim is without merit.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #79
On 26/12/2007 14:22, Chris Hills wrote:
In article <tq*********************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>If commercial exploitation of comp.lang.c is not opposed,


Jacobs compilers are as free as GCC compilers. (And the MS & Borland ones)
You are mistaken. The gcc compilers are free software. MS, Borland and
lcc are all properietary software. In fact, you don't even have the
freedom to *run* Jacob's compiler for commercial use, still less view
and modify the source and all the other rights *everyone* has under the
standard meaning of "free".
Dec 26 '07 #80

"Richard Heathfield" <rj*@see.sig.invalidwrote in message
>
>Being pedantically correct may be the wrong answer.

If the answer is correct *and* relevant, how can it be wrong?
Say someone asks "how do I convert from the hex numbers in the machine to
decimal?".
A regular might say "sprintf will convert from the machine's representation,
which is in a format known as two's complement binary, to human-readable
ASCII characters".
You can guarantee that someone else will mention one's complement machines
and weird and wonderful character codes. Correct, and relevant, whether it
is useful or not depends on the tone. Sometimes it will usefully advance the
newbie's understanding a notch, other times it will confuse the newbie and
irritate the regular.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #81
Malcolm McLean wrote:
>
"Chris Hills" <ch***@phaedsys.orgwrote in message
>>
Jacobs compilers are as free as GCC compilers. (And the MS & Borland
ones)
He releases the executable free for personal use. The source is secret,
and he makes his money on commercial use.
gcc is open source and free for any use, so is freer than lcc-win,
No. If you want to use gcc source code you have to put YOUR application
under the GPL. And if you do not want to put YOUR application
under the GPL you have to pay BIG bucks to Red Hat.

RedHat (a for profit corporation that owns most of the
gcc centered business) makes millions of dollars of profits.

True, if you compile with gcc, you do not need to put
your application under the GPL. But it is the same for
my compiler as a matter of fact.
whilst MS release a stripped down and, in my experience, barely useable
compiler for personal use, as long as no open-source or, as they say
"virally licenced"software is developed with it, and charge $$$$ for the
full version. So they are less free than lcc-win.
They have the right to do so.
I am currently trying to decide whether to junk Windows for Linux. It is
just getting too much grief to get a Windows program up and running.
You just ask the lcc-win wizard to generate the skeleton for you.
Then you just fill the blanks.
I
might try the commerical version of the Vista compiler and see if I can
actually get anything useful done with it.
Most of the C library is "considered deprecated".
However I don't really like X
either, and I want people to be able to run my stuff.
Parse error. What did you wanted to say with the above sentence?

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #82
Richard Heathfield wrote:
>
Since I've never, ever promoted the book here, the claim is without merit.
I must have been dreaming when you posted a discussion about the errata
in your book???
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #83
In article <Gq******************************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>Chris Hills said:
>In article <fk**********@aioe.org>, jacob navia <ja***@nospam.com>
writes
<snip>
>>>I could also argue that RH exploits this group
commercially since the fact of him being the guru here promotes his book
and he earns money with it.


Bloody good point! I had not thought of it that way.

It's a ludicrous argument,
Absolutely but so is getting at Jacob
>and a rather self-defeating point. He's saying
that a compiler vendor doesn't know C well enough to be considered a
"guru" - but surely a compiler vendor ought to know C better than
*anyone*!
Maybe... Compiler vendors produce things they can sell.... or rather
things people want. GCC is hardly "ISO-C" and most embedded compilers
are non-standard.

Also some compiler writers I know re very good at writing compilers but
the for the actual language definition they refer to a standard... not
their memory. Their memory contains algorithms for writing compilers
many of which are used on lots of different languages
It certainly ought to be the case that he knows C better than I
do, which is why I find it rather strange that even he acknowledges that
he doesn't.
Yes. However he is producing a tool people want (as do MS) and if
enough people want the tool he is supplying then the ISO definition is
not so relevant. Sad but true.
>compiler can be obtained for Free and Richards book can not Richard is
more commercial than Jacob :-)

(get out of that one.....)
Since I've never, ever promoted the book here, the claim is without merit.
Fair enough.

BTW What is "the book" called? Come on it's Christmas and I have asked
directly so give it a plug. Your book gets mentioned every now and
again so you may as well give the full information for those who don't
know.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #84
In article <Zd******************************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>Chris Hills said:
>In article <tq*********************@bt.com>, Richard Heathfield wrote:
<snip>
>>>
That is what Chris Hills was suggesting - a relaxation of pedantry (which
is simply another way of saying "be less accurate in future").

I did NOT say that.

Er, you did, actually. But I'll accept that you didn't mean to.
Hi Richard,

Thanks.

How come you are on line on boxing day? My excuse is we are doing a new
web site and I have Tax and company paperwork to do. (Also I am out
enjoying myself tomorrow, and had the last 3 days off)

Though unlike many I had the computers off for 36 hours from Christmas
eve. I am surprised how many people were on line yesterday.

Regards
Chris
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #85
jacob navia said:
Malcolm McLean wrote:
>>
"Chris Hills" <ch***@phaedsys.orgwrote in message
>>>
Jacobs compilers are as free as GCC compilers. (And the MS & Borland
ones)
He releases the executable free for personal use. The source is secret,
and he makes his money on commercial use.
gcc is open source and free for any use, so is freer than lcc-win,

No. If you want to use gcc source code you have to put YOUR application
under the GPL. And if you do not want to put YOUR application
under the GPL you have to pay BIG bucks to Red Hat.
Red Hat doesn't own gcc. And I can use gcc commercially without GPLing my
source and without paying anyone a bean. According to the lcc-win32 Web
page, the same is *not* true of lcc-win32.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #86
Chris Hills said:

<snip>
How come you are on line on boxing day?
Because I promised my wife I wouldn't touch the damn thing on Christmas
Day. :-)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #87
In article <z7******************************@bt.com>, Malcolm McLean
<re*******@btinternet.comwrites
>
"Chris Hills" <ch***@phaedsys.orgwrote in message
>>
Jacobs compilers are as free as GCC compilers. (And the MS & Borland ones)
He releases the executable free for personal use. The source is secret,
and he makes his money on commercial use.
So do many others. The fact the source is not open is irrelevant.
>gcc is open source and free for any use,
So what?
so is freer than lcc-win
In some ways.
>, whilst MS release a stripped down and, in my experience, barely
useable compiler for personal use,
In your opinion.
>as long as no open-source or, as they say "virally licenced"software is
developed with it, and charge $$$$ for the full version. So they are
less free than lcc-win.
OK.
>I am currently trying to decide whether to junk Windows for Linux.
I note that one of the main UK PC magazines in it's end of year top and
bottom 10 put Linux in it's bottom 10 (unless you are a geek) First time
I have seen that.

I also have a very good review of "Upgrade Vista XP" written as a
serious Vista-XP move.
>It is just getting too much grief to get a Windows program up and
running. I might try the commerical version of the Vista compiler and
see if I can actually get anything useful done with it. However I don't
really like X either, and I want people to be able to run my stuff.
It's getting difficult. I agree... I will stay with XP until the Vista
replacement turns up or else move to OSX and Solaris.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #88
In article <fk**********@aioe.org>, jacob navia <ja***@nospam.com>
writes
>Malcolm McLean wrote:
> "Chris Hills" <ch***@phaedsys.orgwrote in message
>>>
Jacobs compilers are as free as GCC compilers. (And the MS & Borland
ones)
He releases the executable free for personal use. The source is
secret, and he makes his money on commercial use.
gcc is open source and free for any use, so is freer than lcc-win,

No. If you want to use gcc source code you have to put YOUR application
under the GPL. And if you do not want to put YOUR application
under the GPL you have to pay BIG bucks to Red Hat.

RedHat (a for profit corporation that owns most of the
gcc centered business) makes millions of dollars of profits.
I note that all the management marketing and others get full commercial
salaries... the only people who don't are the programmers who actually
produce the main product they sell.

Turkeys voting for Christmas?
>True, if you compile with gcc, you do not need to put
your application under the GPL. But it is the same for
my compiler as a matter of fact.
Errr it depends on the library you use. Use the wrong one and you DO
have to put your application out as OS.
>I am currently trying to decide whether to junk Windows for Linux. It
is just getting too much grief to get a Windows program up and running.

You just ask the lcc-win wizard to generate the skeleton for you.
Then you just fill the blanks.
>I might try the commerical version of the Vista compiler and see if
I can actually get anything useful done with it.

Most of the C library is "considered deprecated".
Since when?
>However I don't really like X
>either, and I want people to be able to run my stuff.
Parse error. What did you wanted to say with the above sentence?

???
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #89
In article <fk**********@aioe.org>, Honest Jon <no***@spam.trapwrites
>On 26/12/2007 14:22, Chris Hills wrote:
>In article <tq*********************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>>If commercial exploitation of comp.lang.c is not opposed,
Jacobs compilers are as free as GCC compilers. (And the MS &
Borland ones)

You are mistaken. The gcc compilers are free software. MS, Borland and
lcc are all properietary software. In fact, you don't even have the
freedom to *run* Jacob's compiler for commercial use, still less view
and modify the source and all the other rights *everyone* has under the
standard meaning of "free".
GCC is proprietary It has a license just like MS, Borland and others.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #90
jacob navia wrote:
Eric Sosman wrote:
>jacob navia wrote:
>>>
What bothers you is that lcc-win tries (and implements) an
effort to make C advance, by incorporating many things that
are necessary in a modern software development environment.

What bothers me is the assumption that it is an "advance"
to adopt every fad-of-the-moment that comes along.

Operator overloading is a technique that is well established and by all
means
not the latest fad.

You have no arguments Eric. Why would operator overloading
be a "fad"?

It is not the latest fad in C++ since many people are against it.
In fortran it was introduced YEARS ago.
Fortran also has (or had, back when it was FORTRAN) statement
functions, assigned GOTO, the IMPLICIT declaration, and a complete
absence of reserved words. Does that mean that all these things
would be "advances" for C?

Java's designers deliberately rejected operator overloading.
Since Java was developed more recently than C++ and Fortran, may
we conclude that it would "advance" both those languages if they
were now to discard overloading?

Finally, operator overloading is by no means the only fad you
promote. Your exact words were "many things that are necessary in
a modern software development environment," with no limitation on
or characterization of all these so-called "necessities." The
sole mechanism you suggest for deciding whether something would or
would not be a useful change to the language is "Whatever Jacob is
enthusiastic about is an `advance' and goes into Jacob's compiler,
which should by rights be the reference implementation for and
definition of C." Pfui!
I have repeated again and again the need to be able to create new types
of numbers
in C.
Thank you for informing us that you repeat yourself. Without
this disclosure, I cannot imagine how anyone would have found out.
There are two technical reports in the commitee discussion about
o decimal floating point numbers for exact operations
o fixed point representations.

Both are needed. How would you incorporate those into the language?
"Desired by some subgroup of people" does not equate to
"needed." Witness C99's introduction of complex types; the
overwhelming, pressing, "need" for these is surely the reason
why every vendor rushed rushed rushed to implement C99.
Don' you see that we can't change the language (and force all
implementations to support) all possible types of numbers?

Please explain how would YOU do this.
Do what, exactly? Do what you yourself say cannot be done?

--
Eric Sosman
es*****@ieee-dot-org.invalid
Dec 26 '07 #91
Chris Hills wrote:
>Most of the C library is "considered deprecated".

Since when?
Since Microsoft got that technical report with its safe library, all
standard functions like fopen printf, etc provoke a warning.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Dec 26 '07 #92

"Chris Hills" <ch***@phaedsys.orgwrote in message
>
So do many others. The fact the source is not open is irrelevant.
>>gcc is open source and free for any use,

So what?
If a product is open source then in theory you can reengineer it. You can
keep your changes secret if they are for personal / in house use, but, for
obvious reasons, you may not sell the enhanced version.
In practise most people are not very interested. I did consider hacking into
gcc to make a 64 bit int compiler. Whilst I am pretty sure I have the
technical ability to do so, in practise the job seemed overwhelming, and I
haven't got beyond reading the GNU introductory pages.
I am not suggesting that Jacob go open source, by the way. It is huge
problem finding the right business model for software, and open source with
paid support isn't viable for everyone
>
>>It is just getting too much grief to get a Windows program up and running.
I might try the commerical version of the Vista compiler and see if I can
actually get anything useful done with it. However I don't really like X
either, and I want people to be able to run my stuff.

It's getting difficult. I agree... I will stay with XP until the Vista
replacement turns up or else move to OSX and Solaris.
You seem to have to fiddle with the thing for hours just to get a little
window up on screen. The it declares all your code deprecated. So much that
you forget what you did to finally make it work. So next session its back to
square one. Then the code won't compile on the MSVC 6.0 we still use at the
university.
I really can't do with it.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Dec 26 '07 #93
In article <fk**********@aioe.org>, jacob navia <ja***@nospam.com>
writes
>Chris Hills wrote:
>>Most of the C library is "considered deprecated".
Since when?

Since Microsoft got that technical report with its safe library, all
standard functions like fopen printf, etc provoke a warning.
I know what you mean. That was the worst thing that happened to C.
Personally I voted against it.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #94
In article <Rv******************************@bt.com>, Malcolm McLean
<re*******@btinternet.comwrites
>
"Chris Hills" <ch***@phaedsys.orgwrote in message
>>
So do many others. The fact the source is not open is irrelevant.
>>>gcc is open source and free for any use,

So what?
If a product is open source then in theory you can reengineer it.
This is true of virtually any other commercial software. I can supply
source but it is no Open source.
>You can keep your changes secret if they are for personal / in house
use, but, for obvious reasons, you may not sell the enhanced version.
Unlike other software where you can.
>In practise most people are not very interested.
This is true they like the idea of being able to do things but in
practice rarely do.
>I am not suggesting that Jacob go open source, by the way. It is huge
problem finding the right business model for software, and open source
with paid support isn't viable for everyone
True... It works for companies like Red Hat because they don't have to
finance the initial development of the software.
>>>It is just getting too much grief to get a Windows program up and
running. I might try the commerical version of the Vista compiler and
see if I can actually get anything useful done with it. However I
don't really like X either, and I want people to be able to run my stuff.

It's getting difficult. I agree... I will stay with XP until the
Vista replacement turns up or else move to OSX and Solaris.
You seem to have to fiddle with the thing for hours just to get a
little window up on screen.
Which?
The it declares all your code deprecated.
Oh I see you mean MS...

Now if most of the desktop uses MS or GCC and the embedded community
uses non-standard compilers anyway who is actually going to use ISO-C?

I think there was a a unifying moment in the early 1990's and then the
ISO panels screwed it. Next year ( in a couple of days) we will be a
decade on from the last C standard and still virtually no one is really
using it.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #95
In article <QP******************************@bt.com>, Richard Heathfield
<rj*@see.sig.invalidwrites
>Chris Hills said:

<snip>
>How come you are on line on boxing day?

Because I promised my wife I wouldn't touch the damn thing on Christmas
Day. :-)
:-)
I make it a point of having the computers off for at least 36 hours at
Christmas.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Dec 26 '07 #96
Chris Hills said:

<snip>
GCC is proprietary It has a license just like MS, Borland and others.
"Proprietary" means "of the nature of property; legally made only by a
person or body of persons having special rights, esp a patent or
trademark; pertaining to or belonging to the legal owner; (of a company,
etc) privately owned and run". Who do you think "owns" gcc?

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #97
On Dec 25, 3:12 pm, James Kuyper <jameskuy...@verizon.netwrote:
Paul Hsieh wrote:
On Dec 25, 5:13 am, James Kuyper <jameskuy...@verizon.netwrote:
...
I normally try to define each variable so that it has as small a
scope as possible (without gratuitous use of {} to create a smaller
scope just for the variable).
That's great for some minimalist sense while you are *writing* the
code, but it then becomes impossible to *read* the code afterwards.

My experience does not match your assertion.
Clearly not. I commonly have to read code, and I find it takes
several
times as long to read C++ code precisely because its so hard to track
down where a variable has been declared. Ordinarily, I would expect
that
if its not declared at the top of some enclosing scope then it is
either
a global or an attribute of "this" object. Except its not -- because
I
have to check every for(...) and in fact, every line of code (except
disjoint scopes) up until the start of the function.

The main advantage of C89 is that it really is just the top of each
enclosing scope and it can only be a local, a file scope static or an
extern global. Its typically extremely fast to scan for the first
two,
leaving the last check (looking through .h files) unnecessary. But
usually the difference between a file static/global and an extern
global
is not relevant to any given function -- you just want to know if a
variable is local. In C89, you know that with a quick scan by eye
with
a page-up keystroke or so.

With C99 we are now forced to scan every line of code up to the start
of each function.

Some will chime in and claim that you should be using some search
function in your editor or some source code browser. But that's
nonsense
as you typically can only do *one* of those at a time. I.e., you
might
be doing a "find next" on some important thing you are searching for
that
you want to retain the state for, and while you are doing so you want
to
check where a potential local is being declared without clearing your
search buffer. Furthermore, some editors (such as the Visual C++ text
editor) don't have a backwards search. This is not some fanciful
scenario
I am artificially constructing -- I *DO* this nearly every day.
If you know variable declarations are always at the top of a scope,
you can always find your local variables in a fast, deterministic
way. ...

Only if you know which scope it is defined in.
And just how deeply scoped do you write your code? There is an
explicit
syntactical pointer; namely the "{" character. Most people also
indent
their code to make finding these "{" characters visually obvious.
[...] Since scopes nest in C,
there's no way to be certain unless declarations are restricted not
merely to the top of the scope, but to the top of the function.
This is the very definition of pedantry. The problem of finding the
top
of a function is not significantly different from finding the set of
scope
beginnings up to the top of the function declaration. The depth of
your
scopes is typically O(log(lines in function)).
[...] I would
argue against the "top of the function" solution, but since you don't
seem to be advocating it, I won't bother.

Since a large fraction of the code I've ever worked on was written by
other people, there's no guarantee that any given variable is declared
in any particular scope, no matter what I might prefer. I have to do
the same kind of backwards search to find the top of the right scope
that I would have to perform to find a declaration that's not at the top
of a scope, so I don't see how it saves me any trouble.
Search backwards through indents or "{"s is the same as scanning line
by
line to you?
... The "gratuitous" {} 's give you the required indication to find
these declaration points easily.

They also make the program harder to read and comprehend, in my experience.
Odd. I find myself swinging in the other direction. Very often a
function
does things in distinct steps, where is it a valuable hint to separate
these
by scopes -- that typically corresponds exactly to where you want
separate
scopes to divide your local variables.
I've personally found that this greatly reduces my
search times, because I don't have to search as far to find it.
If you are using a tool, maybe. But if you are scanning by eye?
There's simply no comparison. You have to linearly search the entire
sequence of lines, unless you already know how and where the variable
is used. You are, in other words, giving up on the natural
expressiveness of the language, in favor of burning neurons on this
kind of information or just being slower in reading code.

In my experience, the search is easier whether I use my eyes or other
tools to perform it.
Mixing declarations and statements allows me to shorten the scope
even more, which reduces it further.
This just seems like a drive to a purpose that is wrong headed to
begin with. With C you have the opportunity to be optimally clear
about every variable in your program. They went and just messed that
up in C99 for no good purpose.

In my experience, code is clearer when definitions are closer to first
use, than it is when they're artificially constrained to be declared
somewhere prior to first use.
Well we clearly just have radically different experience.

The main problem with your approach is that the closest first use
might
be *wrong* since the local variable can be used early *and* late in a
function, in which case its got to be put into a high enough position
in an enclosing scope anyways:

type function (...) {
/* A */ ...
if () {
... /* Don't touch x */
}
... /* B */ ...
switch () {
... /* Don't touch x */
}
... /* C */ ...
for (/* D */ ...) {
/* E */
...
touch (&x); /* <-- Looking here */
...
}
...
return x; /* <-- Or looking here */
}

So if you happen to be scanning either either of the places which are
marked "looking here" you need to check A, B, C, D (and possibly E)
for
the declaration of x. In C89 you only need to check A (and possibly
E).
In fact you also need to check more lines at A (and possibly E) with
C99/C++.

This isn't just some worst case -- if x is a static or global (or
object attribute) you will commonly see code like this and have to
scan
all those positions before you realize it is such.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Dec 26 '07 #98
On Dec 26, 6:03 am, Eric Sosman <esos...@ieee-dot-org.invalidwrote:
Paul Hsiehwrote:
On Dec 25, 5:13 am, James Kuyper <jameskuy...@verizon.netwrote:
Delaying definition of a variable until the point where definition
is actually needed often allows you to declare it const (if it is
indeed a constant), which improves error detection and provides
increased opportunities for compiler optimization.
A compiler can always determine if a variable has const semantics
without programmer assistance.

The difference in declaration is about actuality versus
intent. Yes, the compiler can detect when a variable is
initialized and never assigned, or not initialized but assigned
only once, and can in that sense determine that it "has const
semantics." But if the programmer assigns to the variable a
second time, the compiler will determine that it is not const
even if that was the programmer's intent.
I know the difference; you should read my entire post. My point
was to vacate his false claim that it would improve compiler
optimization. It does not.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Dec 26 '07 #99
Chris Hills said:

<snip>
BTW What is "the book" called?
Out of print.

Seriously, those who really want to know will have no difficulty in finding
out.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 26 '07 #100

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.