468,490 Members | 2,603 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.

C is too old? opinions?

Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

Something like:

a_source_file.c:

namespace SomeName(.SomeName)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

public void push(int i) {};
public int pop() {};
}
}

another_source_file.c:

using SomeName(.SomeName);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(Stack.pop());
}

I'm really annoyed ;) Is im the only own with that point of view?

If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...

Best and kindest regards
Lasse Espeholt

Jul 12 '06
187 5254
Ian Collins said:
Lasse Espeholt wrote:
<snip>
>
>with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
I don't, my boilerplate generator does.
I hope not. I hope it puts a # at the beginning, and I hope it omits those
leading underscores. If not, it's broken.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 12 '06 #51
Op Thu, 13 Jul 2006 00:32:37 +0200 schreef Lasse Espeholt:
On 2006-07-13 00:27:05 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
If C# can, C also can ;).... i can't see any problems ?
>

Untrue. Think carefully about that statement, and consider why C and
C# are different languages.

I know why they are different, but in this case it is true

Please tell me a practical way to write a large C program without any
headers.

Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;
There is no keyword 'using' in C.
<OT>Might be in C++ or Pascal</OT>
--
Coos
Jul 12 '06 #52
On 2006-07-12 23:26:08 +0200, Lasse Espeholt said:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

Something like:

a_source_file.c:

namespace SomeName(.SomeName)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

public void push(int i) {};
public int pop() {};
}
}

another_source_file.c:

using SomeName(.SomeName);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(Stack.pop());
}

I'm really annoyed ;) Is im the only own with that point of view?

If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...

Best and kindest regards
Lasse Espeholt
Hmm... Let's stop the discussion know. I'm feeling some of you don't
like me because of my point of view. My only intend was to know what
other programmers think.

And again i don't hate C, there is just something i don't like so much.

Jul 12 '06 #53
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 00:27:05 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12, Andrew Poelstra <ap*******@nowhereat.allsaid:
Please tell me a practical way to write a large C program without any
headers.

Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;
Okay, and when I need to look up the parameters for myfunction(),
instead of going into myfunctions.h, I do what?

The answer is not to download a GUI, purchase an IDE, type the
function name (perhaps I don't even remember /that/), read through
a popup, reach over to the mouse and click a menu.

With headers I can quickly read this:

int myfunction (int w, int h);
double mymoreprecisefunction (double w, double h);

And hey, I discover that there's a better function there that will
suit my needs, because I wasn't happy with integer precision. With
an IDE, I'd know how to use myfunction(), but I'd still be using it
despite its inadequacies.

Then, if I read a comment in the header that warns that
mymoreprecisefunction will grok the widget prematurely,
I can read down another line and find a ungrokwidget()
function.

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #54
On 2006-07-13 00:56:20 +0200, Coos Haak <ch*****@hccnet.nlsaid:
Op Thu, 13 Jul 2006 00:32:37 +0200 schreef Lasse Espeholt:
>On 2006-07-13 00:27:05 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>>On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>If C# can, C also can ;).... i can't see any problems ?
>>
>
Untrue. Think carefully about that statement, and consider why C and
C# are different languages.

I know why they are different, but in this case it is true
Please tell me a practical way to write a large C program without any
headers.

Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;

There is no keyword 'using' in C.
<OT>Might be in C++ or Pascal</OT>
Have'nt you read the threads?

Jul 12 '06 #55
Richard Heathfield wrote:
Ian Collins said:

>>Lasse Espeholt wrote:

<snip>
>>>with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.

I don't, my boilerplate generator does.


I hope not. I hope it puts a # at the beginning, and I hope it omits those
leading underscores. If not, it's broken.
I'm sure you get my point, but for completeness, it emits

#ifndef _module_filename_h_
#define _module_filename_h_

#endif

Where module is lower case.

--
Ian Collins.
Jul 12 '06 #56
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 00:42:36 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>nobody forcing me - no, but in some cases C is a wonderfull
language.... don't get me wrong... i don't hate the language... it is
infact one of my favourites but i think some things could be done
better... i think it has some things there issent nessesary in modern
languages... for example header files...

hhm... it is correct that nobody is stopping me, but i stops myself...
I'm not good enogh....

Well, then learn and become good enough. Also, please use proper
capitalization and punctuation.

I'm not the master in english nor languages in generel. I try...
That's perfectly alright, but you have the resources before you to
learn programming languages very well (that is, I assume you have
an Internet connection), and you've been given specific suggestions
on how to improve your grammar.

Remove the ellipses (...) and the ill-placed question marks (?), and
add some periods (.) at the end of sentences, commas (,) to indicate
pauses, and finally put the beginning of sentences and `I' in UPPER-
CASE.

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #57
Op Thu, 13 Jul 2006 01:01:35 +0200 schreef Lasse Espeholt:
On 2006-07-13 00:56:20 +0200, Coos Haak <ch*****@hccnet.nlsaid:
>Op Thu, 13 Jul 2006 00:32:37 +0200 schreef Lasse Espeholt:
>>On 2006-07-13 00:27:05 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:

On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>If C# can, C also can ;).... i can't see any problems ?
>>>
>>
>Untrue. Think carefully about that statement, and consider why C and
>C# are different languages.
>
I know why they are different, but in this case it is true
>

Please tell me a practical way to write a large C program without any
headers.

Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;

There is no keyword 'using' in C.
<OT>Might be in C++ or Pascal</OT>

Have'nt you read the threads?
No, you haven't. This is comp.lang.c not comp.lang.c++
You have been told too many times now.
Verder kan het me aan m'n reet roesten hoe je over C denkt.
--
Coos
Jul 12 '06 #58
On 2006-07-12, Lasse Espeholt <Lassewrote:
Hmm... Let's stop the discussion know. I'm feeling some of you don't
like me because of my point of view. My only intend was to know what
other programmers think.

And again i don't hate C, there is just something i don't like so much.
This discussion has probably run its course, so yes, it should stop
soon. It's perfectly fair for you to dislike C's features or lack
thereof. However, in clc, most people are happy with the major
features of C.

Nobody here dislikes you for your ideas; your lack of grammar is mildly
annoying but at least you don't top-post or snip context. (Those two are
not only annoying but make it incredibly difficult for many of us to
follow the thread).

Whatever language you find, happy coding. :-)

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #59
On 2006-07-13 01:07:52 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>Hmm... Let's stop the discussion know. I'm feeling some of you don't
like me because of my point of view. My only intend was to know what
other programmers think.

And again i don't hate C, there is just something i don't like so much.

This discussion has probably run its course, so yes, it should stop
soon. It's perfectly fair for you to dislike C's features or lack
thereof. However, in clc, most people are happy with the major
features of C.

Nobody here dislikes you for your ideas; your lack of grammar is mildly
annoying but at least you don't top-post or snip context. (Those two are
not only annoying but make it incredibly difficult for many of us to
follow the thread).

Whatever language you find, happy coding. :-)
Thank you very much.

I will try to write better, and have a better grammar. You will maybe
see a "simplyfied c" in about 5 years from now :-P.

I have tried to make a better grammar in this thread. Did i succeed?

Best and kindest regards
Lasse Espeholt

Jul 12 '06 #60
On Wed, 12 Jul 2006, Richard Heathfield wrote:
Tak-Shing Chan said:
>On Wed, 12 Jul 2006, Richard Heathfield wrote:
>>Lasse Espeholt said:

<snip>

I'm looking for the simplicity of c# without objects ;)

[It is very clear that Lasse is talking about objects in the
C# sense here.]

Not so. In comp.lang.c, the word "object" has a clearly-defined meaning. If
he isn't using the word in that sense, his usage is off-topic.
This is basically a summary of what *I* have said in my
previous post (which you have largely snipped and rewritten in
your own words without attributions to me).
Since I
cannot believe he would be so ungentlemanly as to post off-topic material,
I deduce that he is using the word with its topical, C-related meaning.
You can believe in anything you want, but a valid deduction
requires more than mere statements of beliefs.

Tak-Shing
Jul 12 '06 #61
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 01:07:52 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>Whatever language you find, happy coding. :-)

Thank you very much.

I will try to write better, and have a better grammar. You will maybe
see a "simplyfied c" in about 5 years from now :-P.

I have tried to make a better grammar in this thread. Did i succeed?
Yes, you have. Good job. :-)

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 12 '06 #62
Tak-Shing Chan said:
On Wed, 12 Jul 2006, Richard Heathfield wrote:
>Tak-Shing Chan said:
>>On Wed, 12 Jul 2006, Richard Heathfield wrote:

Lasse Espeholt said:

<snip>

I'm looking for the simplicity of c# without objects ;)

[It is very clear that Lasse is talking about objects in the
C# sense here.]

Not so. In comp.lang.c, the word "object" has a clearly-defined meaning.
If he isn't using the word in that sense, his usage is off-topic.

This is basically a summary of what *I* have said in my
previous post (which you have largely snipped and rewritten in
your own words without attributions to me).
No, it isn't. Learn to read for comprehension. Especially consider the
importance of the word 'if'. You can accuse me of plagiarism as much as you
want, but a /valid/ accusation requires evidence of plagiarism.

>Since I
cannot believe he would be so ungentlemanly as to post off-topic
material, I deduce that he is using the word with its topical, C-related
meaning.

You can believe in anything you want, but a valid deduction
requires more than mere statements of beliefs.
Yes. It requires one or more axioms (statements of belief, assumptions) and
premises (either axioms, observed facts, or results of previous
deductions), and a logical connection between them. In this case, the valid
deduction I drew is as follows:

Axiom: he did not use the word 'object' in an off-topic sense.
Premise: he used the word 'object'.
Deduction: he used the word 'object' in a topical sense.

You can contradict me as much as you want, but a valid contradiction
requires more than mere statements of disagreement.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 13 '06 #63

Andrew Poelstra wrote:
<snip>
Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.
<snip>

Don't you think separating specification from its implementation is
necessary.

Jul 13 '06 #64
<Lasse Espeholtwrote in message
news:44***********************@dread16.news.tele.d k...
On 2006-07-13 00:27:05 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:
On 2006-07-12, Lasse Espeholt <Lassewrote:
If C# can, C also can ;).... i can't see any problems ?
If we took all the features from C++/C#/Java/Perl/whatever and added them
into C, you'd end up with C++/C#/Java/Perl/whatever and not C.

You have a fundamental idea that old is inherently bad; there are certainly
things C doesn't have, but the trade-off is that C is available nearly
everywhere and far more stable/usable than many newer languages. The more
"cool" things you add, the fewer platforms that it can run on.

If C doesn't meet your needs, use a language that does, don't try to change
C.
>Please tell me a practical way to write a large C program without any
headers.

Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;
That implies some way for the compiler to determine what the "myfunctions"
namespace contains. In languages that specify an output format, like Java,
they have simply moved the contents of the "headers" into the output file
and made them somewhat automatically generated. The information the
compiler needs has to come from _somewhere_. Dictating output formats is
considered outside the scope of C, so headers are necessary.

S

--
Stephen Sprunk "Stupid people surround themselves with smart
CCIE #3723 people. Smart people surround themselves with
K5SSS smart people who disagree with them." --Aaron Sorkin
--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '06 #65
Lasse wrote:
Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;
Just to clarify for myself, I don't think this is really what you
want. From the rest of the thread, it seems that what
you're interested in is the ability to disambiguate a
potential name collision so that while you can't do:

#include<foo.h>
int name_already_in_foo;

you can do:

using foo
int name_already_in_foo;
name_already_in_foo = foo::name_already_in_foo

Jul 13 '06 #66
Lasse Espeholt wrote:
On 2006-07-13 00:21:25 +0200, Mark McIntyre <ma**********@spamcop.netsaid:
>On Wed, 12 Jul 2006 23:55:02 +0200, in comp.lang.c , Lasse Espeholt
wrote:
>>>
If C# can, C also can ;).... i can't see any problems ?

The only problem is that C# is a different language. Whats your point?
If you want these features, use a language that has them.

I dont want arything from c#... i don't want a JIT for example... i
want C with namespaces, usings, and a "area" thing... :)
It hasn't got them. Use something else. Or build a C compiler with
extensions and try and get people interested.

[If I could add just one feature to C it would be decent namespace
control. And if I could add just one feature to physics I think it
would be the spindizzy. Any bets on which is more likely?]

--
Chris "for particular values of 'decent'" Dollin
"People are part of the design. It's dangerous to forget that." /Star Cops/

Jul 13 '06 #67
Lasse Espeholt wrote:
On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.

I think its workds great in other languages...?
Other languages have other rules to handle what C handles using #includes.

#includes may be utterly awful, but they work well enough to be going on
with: they're not a pressure point on the use of C.

--
Chris "and they have an excellent predigree" Dollin
"We did not have time to find out everything we wanted to know." /A Clash of Cymbals/

Jul 13 '06 #68
On Thu, 13 Jul 2006 11:01:16 +1200,
Ian Collins <ia******@hotmail.comwrote
in Msg. <4h***********@individual.net>
Richard Heathfield wrote:
>Ian Collins said:

>>>Lasse Espeholt wrote:

<snip>
>>>>with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
I don't, my boilerplate generator does.


I hope not. I hope it puts a # at the beginning, and I hope it omits those
leading underscores. If not, it's broken.
I'm sure you get my point, but for completeness, it emits

#ifndef _module_filename_h_
#define _module_filename_h_

#endif

Where module is lower case.
It still pollutes implementation namespace.

robert

Jul 13 '06 #69
On 13 Jul 2006 08:24:51 GMT,
Robert Latest <bo*******@yahoo.comwrote
in Msg. <4h***********@individual.net>
It still pollutes implementation namespace.
Forget that.
robert
Jul 13 '06 #70

<Lasse Espeholtschrieb im Newsbeitrag
news:44***********************@dread16.news.tele.d k...
On 2006-07-13 00:15:37 +0200, "Default User"
<de***********@yahoo.comsaid:
>Lasse Espeholt wrote:
>>Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

What you think is largely irrelevant. C isn't going anywhere, and
is
still the language of choice for many applications.
>>The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Gawd. If you must have that, C++ is a far better idea.

Brian

better but still not perfect...
:)
Then use D or VisualBasic.NET. TROLL!

PLONK
Jul 13 '06 #71
Lasse wrote:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
So do many people; usually they get tired and move on
to C++, or to Java, python, perl, ruby, etc.

If C does not meet your needs, then don't use it.
>
The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.
So use C#.
>
Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

Something like:

a_source_file.c:

namespace SomeName(.SomeName)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

public void push(int i) {};
public int pop() {};
}
}

another_source_file.c:

using SomeName(.SomeName);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(Stack.pop());
}
C++ might help you here.
I'm really annoyed ;)
GOOD!!!
They do say necessity is the mother of all invention
so go ahead and come up with a new language; heavens
knows the world could use more languages.
Is im the only own with that point of view?
No; many C++, java, python, perl and ruby developers
are of that view as well.

Which is why they are not C programmers.
If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...
So go ahead; nothing gives one experience like experience.

goose,

Jul 13 '06 #72
Robert Latest said:
On 13 Jul 2006 08:24:51 GMT,
Robert Latest <bo*******@yahoo.comwrote
in Msg. <4h***********@individual.net>
>It still pollutes implementation namespace.

Forget that.
1) You are hardly a stranger to C.
2) The construct led you to think it was incorrect, and you had to check the
naming rules. This cost you a non-zero amount of time.
3) The construct is trivially avoidable without loss of expressive power.

Combining the above leads to a conclusion that seems obvious to me -
avoiding a leading underscore on /any/ identifier is the wisest course.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 13 '06 #73
Andrew Poelstra wrote:

<snipped>
What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_

...

#endif
use
#ifndef H_FILE
#define H_FILE
....
#endif

You don't want to find yourself renaming files
because you suddenly stepped on the implementations
(or the standards) toes :-)
goose,

Jul 13 '06 #74
Lasse wrote:
>
<snipped>
>
Hmm... Let's stop the discussion know. I'm feeling some of you don't
like me because of my point of view.
Don't be so quick to judge; maybe they don't like you
for other reasons :-).

Anyway, this *is* a little off the topic here (of course
someone *will* flame for not saying "TOTALLY OFFTOPIC"
and someone else will flame me for not saying "TOPICAL" :-)
so I suggest you correct all the grammer and spelling
in your original question and post it on comp.std.c

I won't claim that they will like you but at least
there you may be better enlightened.
My only intend was to know what
other programmers think.
You are in comp.lang.c; we all think C is great. Nothing
surprising there :-)
And again i don't hate C, there is just something i don't like so much.
You have a few nitpicks; thats fine but I doubt that
you'll find many here who will agree with you.

You see, as you gain more experience using C, you will
find that the way it does some things (like using headers)
is *better* than the C# way (no headers).

Good luck and good day.

goose,

Jul 13 '06 #75
Lasse wrote:

<snipped>
>
Thank you very much.

I will try to write better, and have a better grammar.
Good.
You will maybe
see a "simplyfied c" in about 5 years from now :-P.
I look forward to simplified C. I hate to spoil your
day but have you taken a look at the D programming language?

http://www.digitalmars.com/d/index.html
>
I have tried to make a better grammar in this thread. Did i succeed?
You have at least convinced a few people that you are
not a troll and will be taken more seriously. Well done!

goose,

Jul 13 '06 #76
v4vijayakumar wrote:
Andrew Poelstra wrote:
<snip>
Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.
<snip>

Don't you think separating specification from its implementation is
necessary.
I assumed that he meant /forced on you/, rather than
/technically necessary/.

goose,

Jul 13 '06 #77
Gernot Frisch wrote:
<Lasse Espeholtschrieb im Newsbeitrag
news:44***********************@dread16.news.tele.d k...
On 2006-07-13 00:15:37 +0200, "Default User"
<de***********@yahoo.comsaid:
Lasse Espeholt wrote:

Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...

What you think is largely irrelevant. C isn't going anywhere, and
is
still the language of choice for many applications.

The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Gawd. If you must have that, C++ is a far better idea.

Brian
better but still not perfect...
:)

Then use D or VisualBasic.NET. TROLL!

PLONK
Man!

Some people are *so* sensitive. I didn't see anything
up there worthy of killfiling but I might be missing
a few social rules if the above exchange resulted
in hurt feelings.

:-)
goose,
at least only *one* troll remark.

Jul 13 '06 #78
Ian Collins wrote:
Richard Heathfield wrote:
Ian Collins said:

>Lasse Espeholt wrote:
<snip>
>>with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
I don't, my boilerplate generator does.

I hope not. I hope it puts a # at the beginning, and I hope it omits those
leading underscores. If not, it's broken.
I'm sure you get my point, but for completeness, it emits

#ifndef _module_filename_h_
#define _module_filename_h_

#endif

Where module is lower case.
Hehe :-)

See http://www.lelanthran.com/downloads for my attempt
:-)

goose,
running out of smileys today.

Jul 13 '06 #79
Richard Heathfield wrote:

<snipped>

<OT>
Yes. It requires one or more axioms (statements of belief, assumptions) and
premises (either axioms, observed facts, or results of previous
deductions), and a logical connection between them. In this case, the valid
deduction I drew is as follows:
I like this game :-) Can I play too?
(IIRC when I studied, it was
premise1
....
premiseN
-------------
deduction1 (from premises and previous deductions)
....
deductionN (from premises and previous deductions)
-------------
result (from premises and previous deductions)

Axiom: he did not use the word 'object' in an off-topic sense.
Premise: he used the word 'object'.
Deduction: he used the word 'object' in a topical sense.
<grin>
OK, how about this
1. He used the word OBJECT.........................premise
2. He was off-topic................................premise
3. OBJECT was topically used ......................assumption
4. He used the word OBJECT in topical sense........& introduction, 1,
3
5. He used the word OBJECT in off-topic sense......& introduction, 1,
2
6. OBJECT was not topically used...................not elimination 3,
4, 5
7. OBJECT was not topically used...................discharge 3
8. OBJECT was not topically used...................proof

Of course, changing the premises from off-topic to topical
proves just the opposite :-)

goose,
WARNING: I have only proved the above, not stated it
as a fact, an observance or a religous citing.

Jul 13 '06 #80
On Thu, 13 Jul 2006, Richard Heathfield wrote:
Tak-Shing Chan said:
>On Wed, 12 Jul 2006, Richard Heathfield wrote:
>>Tak-Shing Chan said:

On Wed, 12 Jul 2006, Richard Heathfield wrote:

Lasse Espeholt said:
>
<snip>
>
>I'm looking for the simplicity of c# without objects ;)

[It is very clear that Lasse is talking about objects in the
C# sense here.]

Not so. In comp.lang.c, the word "object" has a clearly-defined meaning.
If he isn't using the word in that sense, his usage is off-topic.

This is basically a summary of what *I* have said in my
previous post (which you have largely snipped and rewritten in
your own words without attributions to me).

No, it isn't. Learn to read for comprehension. Especially consider the
importance of the word 'if'. You can accuse me of plagiarism as much as you
want, but a /valid/ accusation requires evidence of plagiarism.
Your reply to Lasse implies that he isn't using the word in
the C sense. As the protasis is true, our statements are
logically equivalent. More on that below.
>>Since I
cannot believe he would be so ungentlemanly as to post off-topic
material, I deduce that he is using the word with its topical, C-related
meaning.

You can believe in anything you want, but a valid deduction
requires more than mere statements of beliefs.

Yes. It requires one or more axioms (statements of belief, assumptions) and
premises (either axioms, observed facts, or results of previous
deductions), and a logical connection between them. In this case, the valid
deduction I drew is as follows:

Axiom: he did not use the word 'object' in an off-topic sense.
Premise: he used the word 'object'.
Deduction: he used the word 'object' in a topical sense.

You can contradict me as much as you want, but a valid contradiction
requires more than mere statements of disagreement.
This axiom contradicts with your reply to Lasse: ``Then C is
the wrong place to look. C has objects. So does C++, so it's no
good looking there, either'' (Heathfield, 2006-07-12).

Since when are C++ objects on-topic here? For your
information (although I believe that you are aware of this
already), C++ objects cannot be interpreted in the C sense
because for polymorphic objects ``the implementation generates
information associated with each such object that makes it
possible to determine that object's type during program
execution'' (ISO/IEC 14882:2003, 1.8; 10.3). Therefore the C
interpretation is ruled out.

Even if you exclude such polymorphic objects from the entire
discussion, the subset of C-reinterpretable objects in C++ are
*still* off-topic. Moreover, if you apply the strictest
topicality rules here, then C++ does not even exist, let alone
objects in C++.

If you agree that C++ objects are off-topic here, then you
must also agree that your reply to Lasse is off-topic. It would
be inconsistent to assume the topicality axiom in Lasse's post
while disobeying the very same axiom in your immediate reply to
that post. Therefore, my criticisms still hold.

Tak-Shing
Jul 13 '06 #81
On Thu, 13 Jul 2006, goose wrote:
1. He used the word OBJECT.........................premise
2. He was off-topic................................premise
3. OBJECT was topically used ......................assumption
4. He used the word OBJECT in topical sense........& introduction, 1,
3
5. He used the word OBJECT in off-topic sense......& introduction, 1,
2
6. OBJECT was not topically used...................not elimination 3,
4, 5
7. OBJECT was not topically used...................discharge 3
8. OBJECT was not topically used...................proof
You proof is flawed. (1) and (2) does not imply (5).

Tak-Shing
Jul 13 '06 #82
[mailed, not posted]

You said:

<snip>
>
Your reply to Lasse implies that he isn't using the word in
the C sense.
No, it doesn't.

Tak-Shing, I'm delighted to see your return to comp.lang.c, and I know and
respect your knowledge and experience of the C language.

But I also know that you and I have very different and conflicting ways of
thinking about things. Also, we both have a tendency to follow minutiae to
the bitter end, and sometimes beyond.

If we are not careful, we will end up generating colossal amounts of heat
and almost no light.

Therefore, I have decided to strive to minimise the number and length of my
replies to your articles. This is not intended as a slur to you. It's just
an attempt to keep the group's noise levels down.

<snip>

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 13 '06 #83
On Thu, 13 Jul 2006, Richard Heathfield wrote:
[mailed, not posted]
Your newsreader has a bug. :-)

Tak-Shing
Jul 13 '06 #84
Tak-Shing Chan said:
On Thu, 13 Jul 2006, Richard Heathfield wrote:
>[mailed, not posted]

Your newsreader has a bug. :-)
Oops. No, I do.

Sorry about that.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 13 '06 #85
Tak-Shing Chan wrote:
On Thu, 13 Jul 2006, goose wrote:
1. He used the word OBJECT.........................premise
2. He was off-topic................................premise
3. OBJECT was topically used ......................assumption
4. He used the word OBJECT in topical sense........& introduction, 1,
3
5. He used the word OBJECT in off-topic sense......& introduction, 1,
2
6. OBJECT was not topically used...................not elimination 3,
4, 5
7. OBJECT was not topically used...................discharge 3
8. OBJECT was not topically used...................proof

You proof is flawed. (1) and (2) does not imply (5).
Well, since it was done right and proper,
perhaps you can point out where it went
wrong.

After all, /formal logic/ is to /formally prove/
something, not make a statement and then magically
"know" the correct answer:-)
goose,
(hey, it *might* be wrong, but I'd rather know
which /step/ is wrong).

Jul 13 '06 #86
In article <e9**********@malatesta.hpl.hp.com>,
Chris Dollin <ch**********@hp.comwrote:
>[If I could add just one feature to C it would be decent namespace
control. And if I could add just one feature to physics I think it
would be the spindizzy. Any bets on which is more likely?]
Modern stoeticists use Jorn Spindillies (R) -- recommended by
three out of five Apostles!
--
Prototypes are supertypes of their clones. -- maplesoft
Jul 13 '06 #87
On Wed, 12 Jul 2006 23:26:08 +0200, Lasse Espeholt wrote in
comp.lang.c:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
[snip drivel]

You have the official permission of comp.lang.c not to use the C
language if you don't like it.

If you want C++, or Java, or C# of Visual Basic, or any one of
hundreds of other languages that would be more to your liking, who's
stopping you?

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 13 '06 #88
On 2006-07-13, goose <ru**@webmail.co.zawrote:
Andrew Poelstra wrote:
>What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_

use
#ifndef H_FILE
#define H_FILE

You don't want to find yourself renaming files
because you suddenly stepped on the implementations
(or the standards) toes :-)
True, it'd be stupid to have a `file.h'. However, the implementation
would almost certainly use guards like `__FILE_H__' or the like, and
so there wouldn't be any problems solved by reorganizing the #define.

(Note: If you were talking about the leading underscore, it's so
common that the Standard'd be nuts to move it into implementation
namespace.)

--
Andrew Poelstra <http://www.wpsoftware.net/projects/>
To email me, use "apoelstra" at the above domain.
"You people hate mathematics." -- James Harris
Jul 13 '06 #89

Andrew Poelstra wrote:
On 2006-07-13, goose <ru**@webmail.co.zawrote:
Andrew Poelstra wrote:
What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_
use
#ifndef H_FILE
#define H_FILE

You don't want to find yourself renaming files
because you suddenly stepped on the implementations
(or the standards) toes :-)

True, it'd be stupid to have a `file.h'. However, the implementation
would almost certainly use guards like `__FILE_H__' or the like, and
so there wouldn't be any problems solved by reorganizing the #define.

(Note: If you were talking about the leading underscore, it's so
common that the Standard'd be nuts to move it into implementation
namespace.)
nope; its easier to remember that H_* does not clash
with standard nor implementation than to remember
all the rules for #define

goose,

Jul 13 '06 #90
"goose" <ru**@webmail.co.zawrites:
Andrew Poelstra wrote:

<snipped>
>What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_

...

#endif

use
#ifndef H_FILE
#define H_FILE
...
#endif

You don't want to find yourself renaming files
because you suddenly stepped on the implementations
(or the standards) toes :-)
Neither FILE_H_ nor H_FILE is in the implementation's namespace.
There's no problem with trailing underscores, only leading ones.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 13 '06 #91
Keith Thompson <ks***@mib.orgwrites:
>Andrew Poelstra wrote:
>>What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_
Neither FILE_H_ nor H_FILE is in the implementation's namespace.
There's no problem with trailing underscores, only leading ones.
Unfortunately, the FILE_H approach breaks down for files whose
names begin with "e". H_FILE is a better way from that
viewpoint.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}
Jul 13 '06 #92

Lasse wrote:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
C is a product of the early 1970s and it shows, but that doesn't
necessarily make it obsolete.
The idea with header/source files where methods can clash into
eachother i don't like... Look at C# which is much cleaner with
namespaces.

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
Again, C dates from a time where these concepts hadn't yet been
formalized. They could certainly be added to a future version of the
standard (C89 incorprated several useful concepts from C++), but
frankly, if they haven't been added by now, I wouldn't expect them to
be added in the future.

And, you can currently restrict visibility by using the static keyword.
Something like:

a_source_file.c:

namespace SomeName(.SomeName)
{
area Stack
{
private int[] myStack;

private void someMethod() {};

public void push(int i) {};
public int pop() {};
}
}

another_source_file.c:

using SomeName(.SomeName);

int main(int argc, char[] *argv)
{
Stack.push(10);
System.printf(Stack.pop());
}
Language design isn't as easy as it looks. Something that looks simple
on paper may turn out to be difficult to code (as I'm discovering right
now with a design of mine; not quite as painless as I'd hoped it would
be).
I'm really annoyed ;) Is im the only own with that point of view?
Yes.
>
If i was a really good programmer (which i'm not... yet! ;)) i would
developed a compiler and a much more simple (but still impressive and
powerfull) c...
A lot of people *say* that, damn few wind up ever doing it.
Best and kindest regards
Lasse Espeholt
Jul 13 '06 #93
Languages do not age the way that people think they do.
COBOL and BASIC are alive and well.
C will never go away.
For writing simple filter programs, it is a very good alterative.
Languages like C# and Java have to go garbage collection and hence are
unsuitable for real-time stuff.
Can you imagine .NET installed on a toaster IC to pop your toast up in the
morning? I can't.
Jul 13 '06 #94
On Thu, 13 Jul 2006 11:45:02 -0700, "Dann Corbit" <dc*****@connx.com>
wrote:
>Languages do not age the way that people think they do.
COBOL and BASIC are alive and well.
C will never go away.
For writing simple filter programs, it is a very good alterative.
Languages like C# and Java have to go garbage collection and hence are
unsuitable for real-time stuff.
Can you imagine .NET installed on a toaster IC to pop your toast up in the
morning? I can't.
Java is used extensively on embedded devices. You're making yourself
look a bit silly, there.
Jul 13 '06 #95
"W Marsh" <wa*********@gmail.comwrote in message
news:oc********************************@4ax.com...
On Thu, 13 Jul 2006 11:45:02 -0700, "Dann Corbit" <dc*****@connx.com>
wrote:
>>Languages do not age the way that people think they do.
COBOL and BASIC are alive and well.
C will never go away.
For writing simple filter programs, it is a very good alterative.
Languages like C# and Java have to go garbage collection and hence are
unsuitable for real-time stuff.
Can you imagine .NET installed on a toaster IC to pop your toast up in the
morning? I can't.

Java is used extensively on embedded devices. You're making yourself
look a bit silly, there.
How does your response relate to my post?

Is Java used for real-time systems (if so, they should fire the product
implementors for incompetence).

Does Java require .NET?

I think you have a reading comprehension problem.
Jul 13 '06 #96
On Thu, 13 Jul 2006, goose wrote:
Tak-Shing Chan wrote:
>On Thu, 13 Jul 2006, goose wrote:
>>1. He used the word OBJECT.........................premise
2. He was off-topic................................premise
3. OBJECT was topically used ......................assumption
4. He used the word OBJECT in topical sense........& introduction, 1,
3
5. He used the word OBJECT in off-topic sense......& introduction, 1,
2
6. OBJECT was not topically used...................not elimination 3,
4, 5
7. OBJECT was not topically used...................discharge 3
8. OBJECT was not topically used...................proof

You proof is flawed. (1) and (2) does not imply (5).

Well, since it was done right and proper,
Only in form but not in content.
perhaps you can point out where it went
wrong.
I already did. In the above, I said (1) and (2) does not
imply (5). In English, this means: ``he used the word OBJECT''
and ``he was off-topic'' does not imply that ``he used the word
OBJECT in off-topic sense''. To claim otherwise is to commit the
fallacy of division.
(hey, it *might* be wrong, but I'd rather know
which /step/ is wrong).
From step (5) onwards.

Tak-Shing
Jul 13 '06 #97
On Thu, 13 Jul 2006 11:53:06 -0700, "Dann Corbit" <dc*****@connx.com>
wrote:
>"W Marsh" <wa*********@gmail.comwrote in message
news:oc********************************@4ax.com.. .
>On Thu, 13 Jul 2006 11:45:02 -0700, "Dann Corbit" <dc*****@connx.com>
wrote:
>>>Languages do not age the way that people think they do.
COBOL and BASIC are alive and well.
C will never go away.
For writing simple filter programs, it is a very good alterative.
Languages like C# and Java have to go garbage collection and hence are
unsuitable for real-time stuff.
Can you imagine .NET installed on a toaster IC to pop your toast up in the
morning? I can't.

Java is used extensively on embedded devices. You're making yourself
look a bit silly, there.

How does your response relate to my post?

Is Java used for real-time systems (if so, they should fire the product
implementors for incompetence).

Does Java require .NET?

I think you have a reading comprehension problem.
You were lumping Java and .NET together, suggesting that they were
inadequate in real-time systems for the same reason. I assumed you
must have been talking about embedded stuff as well because of your
vague reasoning and toaster example*. In other words, you seemed
confused. I made a logical leap as required.

Go on then - I would like to know how garbage collection affects
real-time systems. A good reason, showing thought and reason. In other
words, show us that you're not just full of shit.

Bear in mind that garbage collection shouldn't affect the behaviour of
a system, only its constraints.

* Exactly how precise do you think a toaster timer needs to be?
Jul 13 '06 #98
Keith Thompson wrote:
>
"goose" <ru**@webmail.co.zawrites:
Andrew Poelstra wrote:

<snipped>
What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_

...

#endif
use
#ifndef H_FILE
#define H_FILE
...
#endif

You don't want to find yourself renaming files
because you suddenly stepped on the implementations
(or the standards) toes :-)

Neither FILE_H_ nor H_FILE is in the implementation's namespace.
There's no problem with trailing underscores, only leading ones.
He's talking about a safe procedure for creating
header guard identifiers from .h file names.

EBOLA_H_ would not be a suitable header guard
for a file named ebola.h

N869
7.26 Future library directions
[#1] The following names are grouped under individual
headers for convenience. All external names described below
are reserved no matter what headers are included by the
program.
7.26.3 Errors <errno.h>
[#1] Macros that begin with E and a digit or E and an
uppercase letter (possibly followed by any combination of
digits, letters, and underscore) may be added to the
declarations in the <errno.hheader.

--
pete
Jul 13 '06 #99

Dann Corbit wrote:
"W Marsh" <wa*********@gmail.comwrote in message
news:oc********************************@4ax.com...
On Thu, 13 Jul 2006 11:45:02 -0700, "Dann Corbit" <dc*****@connx.com>
wrote:
>Languages do not age the way that people think they do.
COBOL and BASIC are alive and well.
C will never go away.
For writing simple filter programs, it is a very good alterative.
Languages like C# and Java have to go garbage collection and hence are
unsuitable for real-time stuff.
Can you imagine .NET installed on a toaster IC to pop your toast up in the
morning? I can't.
Java is used extensively on embedded devices. You're making yourself
look a bit silly, there.

How does your response relate to my post?

Is Java used for real-time systems (if so, they should fire the product
implementors for incompetence).
There is a real time Java specification, and Sun has released a real
time version of Java (RTS). A high-level introduction is at
http://www.onjava.com/pub/a/onjava/2...on.html?page=1.
Quote:

"Real-time Java offers a much more reliable and predictable scheduling
mechanism, memory handling methods, different memory models, a more
predictable threading and synchronization model, asynchronous event
handling, and high-resolution time handling. It makes predictable
execution the first priority in all trade-off decisions, sometimes at
the expense of typical general-purpose computing performance measures.
This is what real-time means."

Jul 13 '06 #100

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kari Laitinen | last post: by
29 posts views Thread by David Eng | last post: by
3 posts views Thread by Jack Klein | last post: by
10 posts views Thread by John Swan | last post: by
reply views Thread by Florian Thiel | last post: by
21 posts views Thread by Steve Swift | last post: by
3 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.