Making C better (by borrowing from C++)

Y

ymuntyan

Yup. People were invited to offer an opinion. Those who had an opinion
voted.


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.
It was. An electoral majority is defined in terms of those who vote.
Those who remain silent disenfranchise themselves and are not counted. If
you find this peculiar, I suggest a dose of real-world election study.

I suppose you don't see how funny it is.
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.

Another funny thing, I am not for off-topic stuff, I don't
want C++ and sockets to be on-topic here, so I am not even
against so-called majority opinion. You just can't see that,
because the so-called world here is very simple: people are
either with you (and then they are automatically in the
"majority"), or they are not *with* you, and then they are
by definition
1) wrong;
2) in the minority;
3) your mortal enemies;
4) trolls;
5) etc.

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 [*].
Luckily for you, I forgot to plonk you. Its a mistake I've now rectified.

Very luckily for me, I am happy. And I was indeed right that I
replied. But now you got to really do the sweet act of *plonk*-ing,
otherwise it won't look good.
So what? How does that equate to claiming they're cool or good? You're
fully of horseshit.

Well, perhaps I am full of shit. But I am not making stuff up.

Yevgen

[*] Keith, it wasn't about you. You are honest. You are just
either blind or a robot.
 
I

Ian Collins

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.
 
J

James Kuyper

CBFalconer said:
James Kuyper wrote:
... snip ...

Er, reducing function size does the same thing, and provides side
benefits. Use of the 'inline' marker can eliminate the object code
difference. :)

True, and I use that technique as well. There's a nice synergy involved:
if I realize that my design needs to be reorganized, by splitting a
function block into two or more smaller functions, I'll often find that
the natural place for dividing the function corresponds to a block
within that function. I find that most, if not all, of the variables
which need to be local variables in that function are already declared
inside that block, so that creating the body of the new function
requires little beyond moving that block to a new location.

In fact, I've found that that accumulation of a lot of variables inside
a particular block is a good indicator that the block might be a
candidate for splitting off into a separate function.
 
J

jacob navia

Keith said:
I hope you're aware that most of us were upset by the "C language
Taleban" insult, and not by the content of his question.


In other words, if you want a C-like language that supports operator
overloading, references, et al, then you can use C++ or you can use
lcc-win. Neither of this is really C (C doesn't have operator
overloading, for example). The major differences seen to be that (a)
lcc-win provides a smaller superset of C than C++ does, (b) lcc-win
probably goes to a bit more effort to maintain compatibility with
standard C, and (c) lcc-win is available only from a single vendor for
a single platform.

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.

The regulars here (and all C++ people) agree that the only
advance for C is to go to C++ and leave C to disappear.

This attitude is shared by the C standards comitee that seems awfully
busy to wait till 2019 for a new standard. Revisions aren't even planned
papers are published when some important company demands so,
but nothing is done to improve the state of the language itself.

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.

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.
Perhaps using lcc-win is a good solution for some people, particularly
the OP. I personally wouldn't have much problem with you mentioning
it *if* you'd do the following each time: (a) acknowledge that it's
your work (and thus that you have an entirely understandable bias in
its favor), (b) acknowledge the set of platforms to which it's limited
(currently just MS Windows unless I've missed something), and (c)
suggest that further discussion should be directed to
comp.compilers.lcc. Don't assume that everyone is already aware of
this; not all readers have been following the newsgroup long enough to
know the background.

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.

To be clear, this is not a set of rules that you must follow. This is
simply my opinion regarding what I think you should do. Others'
opinions will inevitably differ.

Well, I mention lcc-win when is on topic. And in this thread is
on topic.
 
K

Keith Thompson

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.
 
J

James Kuyper

Paul said:
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.
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.
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.
 
K

Keith Thompson

jacob navia said:
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.
 
J

James Kuyper

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.
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.
 
J

James Kuyper

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.
 
J

jacob navia

James said:
jacob navia wrote:
...

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?
 
K

Kenny McCormack

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.
 
Y

ymuntyan

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
 
M

Martin Ambuhl

jacob said:
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.

Your version of "advance" is hardly shared by everyone. Your
solipsistic attitude has, from the evidence of your recent posts, become
pure egotism. Ger over yourself, already. This is not
comp.navia.masturbation, but comp.lang.c. Almost all your recent posts
have been solely about Jacob Navia, how wonderful he is, and how the
nasty world mistreats him. Almost none have had more than a passing
reference to C.
The regulars here (and all C++ people) agree that the only
advance for C is to go to C++ and leave C to disappear.

And that, silly boy, is either a flat lie or shows that you are
completely out of touch with the world.
 
I

Ian Collins

Martin said:
Your version of "advance" is hardly shared by everyone. Your
solipsistic attitude has, from the evidence of your recent posts, become
pure egotism. Ger over yourself, already. This is not
comp.navia.masturbation, but comp.lang.c. Almost all your recent posts
have been solely about Jacob Navia, how wonderful he is, and how the
nasty world mistreats him. Almost none have had more than a passing
reference to C.


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...
 
K

Kenny McCormack

Martin Ambuhl begged for attention by posting a bunch of crap which is
snipped: ....

I see the Grinch uses Usenet...

Ole Marty is another excellent example of someone who did not earn his
mother's love.
 
C

CBFalconer

jacob said:
James Kuyper wrote:
.... snip ...
.... snip ...

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.

Once more, try reading one of the C standard documents, from K&R2
to C99. You will not find any mention of operator overloading. IT
IS NOT A C FEATURE. It is available in C++.
 
K

Keith Thompson

CBFalconer said:
jacob navia wrote: [...]
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.

Once more, try reading one of the C standard documents, from K&R2
to C99. You will not find any mention of operator overloading. IT
IS NOT A C FEATURE. It is available in C++.

Of course that isn't the point jacob is trying to make. I'm sure he's
very well aware that no C standard, up to and including C99, defines
operator overloading.

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).
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.

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.

In any case, Chuck is of course correct that operator overloading is
not part of C (though it's a valid extension, but then so is Fortran
support). Discussion of operator overloading as an extension is
topical in comp.compilers.lcc. Discussion of operator overloading as
a proposed language change is topical in comp.std.c. Neither is
topical here, except for a brief mention along with a redirection to a
more appropriate forum.
 
R

Richard Heathfield

Sjouke Burry said:
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.
 

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top