473,233 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

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 #1
187 6230
Lasse Espeholt writes:
Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.
--
"Some people *are* arrogant, and others read the FAQ."
--Chris Dollin
Jul 12 '06 #2
On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
Lasse Espeholt writes:
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

It sounds like you can get what you want from C++.
There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

Jul 12 '06 #3
In article <44***********************@dread16.news.tele.dk> ,
<Lasse Espeholtwrote:
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
Please read about the "static" storage qualifier, and about "file scope".

--
Programming is what happens while you're busy making other plans.
Jul 12 '06 #4
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>Lasse Espeholt writes:
>>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?
I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?

--
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 #5
On 2006-07-12 23:44:41 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>>Lasse Espeholt writes:

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

It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?
I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...

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

Jul 12 '06 #6
On 2006-07-12, Lasse Espeholt <Lassewrote:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
Nah; in fact, a new standard was released around 1999, and it still
isn't implemented widely because the features from 1989 are still
perfectly useful today!
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.
C++ has namespaces. You could try over there.
Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
If you qualify a function with `static', it isn't visible outside
of the file that it is defined in.
>
I'm really annoyed ;) Is im the only own with that point of view?
Around here, probably. :-)
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...
There was a guy who did that... Bjarne Strousup, they called him.
(Although `they' knew how to spell his name properly.)

--
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 #7
Lasse Espeholt writes:
On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>Lasse Espeholt writes:
>>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?
I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.
--
"Some programming practices beg for errors;
this one is like calling an 800 number
and having errors delivered to your door."
--Steve McConnell
Jul 12 '06 #8
Lasse Espeholt said:
Hi...

I am relativ new to the impressive and powerfull C language, but i
thinks it is obsolete...
Fine, so don't use it. Nobody is forcing you to.
The idea with header/source files where methods can clash into
eachother i don't like...
Since C doesn't have methods, the problem doesn't arise.
Look at C# which is much cleaner with namespaces.
No thanks.
Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
Because the language definition doesn't say it has.

<snip>
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...
Nobody is stopping you.

--
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 #9
Lasse Espeholt said:

<snip>
I'm looking for the simplicity of c# without objects ;)
Then C is the wrong place to look. C has objects. So does C++, so it's no
good looking there, either.

--
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 #10
On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
Lasse Espeholt writes:
>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>>Lasse Espeholt writes:

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.
If C# can, C also can ;).... i can't see any problems ?

Jul 12 '06 #11
On 2006-07-12 23:48:41 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>Hi...

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

Nah; in fact, a new standard was released around 1999, and it still
isn't implemented widely because the features from 1989 are still
perfectly useful today!
>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.

C++ has namespaces. You could try over there.
>Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?

If you qualify a function with `static', it isn't visible outside
of the file that it is defined in.
>>
I'm really annoyed ;) Is im the only own with that point of view?

Around here, probably. :-)
>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...

There was a guy who did that... Bjarne Strousup, they called him.
(Although `they' knew how to spell his name properly.)
yeah.... Bjarne Stroustrup is from my planet (Denmark, NOT the swedish
capital) ;)

hhm... i'm sadly the only one whom does not like C structure very much :D

Jul 12 '06 #12
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:44:41 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:

Lasse Espeholt writes:

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

It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?

I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...
Headers aren't technically necessary in C, either... it's still a
terrible idea to try and get along without them.

--
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 #13
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>Lasse Espeholt writes:
>>On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:

Lasse Espeholt writes:

Why has C not namespaces and a "area idea" where some methods and
fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.

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.

--
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 #14
On 2006-07-12 23:59:02 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:44:20 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:
>>Lasse Espeholt writes:

On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:

Lasse Espeholt writes:
>
>Why has C not namespaces and a "area idea" where some methods and
>fields could be hidden from the outside?
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?

I don't think there is a practical way to write large C or C++
programs without using header files. If you want to avoid header
files entirely, you'll need to move to something like C# or Java.

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

Jul 12 '06 #15
On 2006-07-12 23:52:55 +0200, Richard Heathfield
<in*****@invalid.invalidsaid:
Lasse Espeholt said:

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

Then C is the wrong place to look. C has objects. So does C++, so it's
no good looking there, either.
Object-orientated, classes then....

Jul 12 '06 #16
On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:44:41 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>>On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:29:50 +0200, Ben Pfaff <bl*@cs.stanford.edusaid:

Lasse Espeholt writes:
>
>Why has C not namespaces and a "area idea" where some methods and
>fields could be hidden from the outside?
>
It sounds like you can get what you want from C++.

There is still the header issue which i'm not a fan of... I can get rid
of header files but it is still recommended, right?
I'm not sure what you mean by that. No, you shouldn't eliminate header
files. C++ has what you want with namespaces. What is "still recommended,
right"?

I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...

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

Jul 12 '06 #17
On 2006-07-12 23:52:12 +0200, Richard Heathfield
<in*****@invalid.invalidsaid:
Lasse Espeholt said:
>Hi...

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

Fine, so don't use it. Nobody is forcing you to.
>The idea with header/source files where methods can clash into
eachother i don't like...

Since C doesn't have methods, the problem doesn't arise.
>Look at C# which is much cleaner with namespaces.

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

Because the language definition doesn't say it has.

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

Nobody is stopping you.
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....

best regards

Jul 12 '06 #18
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
Jul 12 '06 #19
Lasse Espeholt wrote:
On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:
>>
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...?
They have rules to enforce application layout and/or complex object
names that include a search path. What would you rather have:

path.to.some.external.wibble.a();

or

#include "wibble.h"

a();

--
Ian Collins.
Jul 12 '06 #20
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.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 12 '06 #21
On Wed, 12 Jul 2006 23:47:45 +0200, in comp.lang.c , Lasse Espeholt
wrote:
>
I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...
Headers aren't necessary in C or C++, if you don't mind declaring
absolutely everything yourself, including all the system-level
interfaces and internal structs required by IO routines.
>I'm looking for the simplicity of c# without objects ;)
What makes you think that C# doesn't have all this too? It just hidden
differently.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 12 '06 #22
On 2006-07-13 00:19:03 +0200, Ian Collins <ia******@hotmail.comsaid:
Lasse Espeholt wrote:
>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:
>>>
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...?
They have rules to enforce application layout and/or complex object
names that include a search path. What would you rather have:

path.to.some.external.wibble.a();

or

#include "wibble.h"

a();
I like to have namespaces and using... ;)

Jul 12 '06 #23
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...
:)

Jul 12 '06 #24
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12, 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...?
A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.

--
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 #25
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.

--
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 #26
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... :)

Jul 12 '06 #27
Lasse Espeholt wrote:
On 2006-07-13 00:19:03 +0200, Ian Collins <ia******@hotmail.comsaid:
>Lasse Espeholt wrote:
>>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:
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...?
They have rules to enforce application layout and/or complex object
names that include a search path. What would you rather have:

path.to.some.external.wibble.a();

or

#include "wibble.h"

a();


I like to have namespaces and using... ;)
So what's the difference in typing a few includes or the equivalent
using directives?

--
Ian Collins.
Jul 12 '06 #28
On 2006-07-13 00:23:04 +0200, Mark McIntyre <ma**********@spamcop.netsaid:
On Wed, 12 Jul 2006 23:47:45 +0200, in comp.lang.c , Lasse Espeholt
wrote:
>>
I thought that header issen't nessesary in c++ but recommended, but i'm
not a c++ developer so...

Headers aren't necessary in C or C++, if you don't mind declaring
absolutely everything yourself, including all the system-level
interfaces and internal structs required by IO routines.
>I'm looking for the simplicity of c# without objects ;)

What makes you think that C# doesn't have all this too? It just hidden
differently.
C# has namespaces, usings, classes

C has includes + some other things

I want a C with namespaces, usings, a "area" thing and without header files

A thing i hate about header files is the prevention from dobble
includes (#ifndef __FILE_H_)... i know there are #import, but nobody
uses it

Jul 12 '06 #29
Andrew Poelstra wrote:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:

>>>On 2006-07-12, Lasse Espeholt <Lassewrote:

On 2006-07-12, 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...?

A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.
I'd second both points.

I've been doing a lot of PHP recently, and it is a real pain not having
a header like summary of an object's member functions. So much so, I
end up creating interfaces as a header replacement.

--
Ian Collins.
Jul 12 '06 #30
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;

Jul 12 '06 #31
On 2006-07-13 00:26:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>>On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12, 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...?

A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.
A. Sorry for my formatting, i will try not to use question marks

B. In a modern IDE all the functions is listed.

Jul 12 '06 #32
On 2006-07-13 00:29:04 +0200, Ian Collins <ia******@hotmail.comsaid:
Lasse Espeholt wrote:
>On 2006-07-13 00:19:03 +0200, Ian Collins <ia******@hotmail.comsaid:
>>Lasse Espeholt wrote:

On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.all>
said:

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

They have rules to enforce application layout and/or complex object
names that include a search path. What would you rather have:

path.to.some.external.wibble.a();

or

#include "wibble.h"

a();


I like to have namespaces and using... ;)
So what's the difference in typing a few includes or the equivalent
using directives?
with includes you risk that the files have functions there have the same name.

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

Jul 12 '06 #33
On 2006-07-13 00:31:23 +0200, Ian Collins <ia******@hotmail.comsaid:
Andrew Poelstra wrote:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:

On 2006-07-12, 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...?

A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.
I'd second both points.

I've been doing a lot of PHP recently, and it is a real pain not having
a header like summary of an object's member functions. So much so, I
end up creating interfaces as a header replacement.
Maybe you should try a better IDE... with the Visual Studio and ASP.net
(c#, java,...) all methods(functions, procedure and what they are
called) is listed...

But i must amitted that i have'nt meet any well written PHP IDE, so
from that point of view i will agree with you....

Jul 12 '06 #34

<Lasse Espeholtwrote in message
news:44***********************@dread16.news.tele.d k...
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?
It does: static methods are hidden to the world outside the file in which
they are defined.

<snip>>
Best and kindest regards
Lasse Espeholt
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
Jul 12 '06 #35
Lasse Espeholt wrote:
On 2006-07-13 00:29:04 +0200, Ian Collins <ia******@hotmail.comsaid:
>Lasse Espeholt wrote:
>>I like to have namespaces and using... ;)
So what's the difference in typing a few includes or the equivalent
using directives?


with includes you risk that the files have functions there have the same
name.
That's why C++ added namespaces, the only remedy in C is care.
with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
I don't, my boilerplate generator does. In your case, I'm sure your
modern IDE would do the same.

--
Ian Collins.
Jul 12 '06 #36
On Thu, 13 Jul 2006 00:31:02 +0200, Lasse Espeholt wrote:
>
I want a C with namespaces, usings, a "area" thing and without header files
It's becoming obvious that whatever it is that you want, it isn't C. I
suggest that you identify the language you do want, and then find a
suitable place to discuss it (it won't be here.)

--
Al Balmer
Sun City, AZ
Jul 12 '06 #37
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.]

[Richard Heathfield continued:]
Then C is the wrong place to look. C has objects. So does C++, so it's no
good looking there, either.
While C does have objects, its definition (``object: a
region of data storage in the execution environment, the contents
of which can represent values'', C90/C99 3.14) is totally
different from that of C# which was the context of this subthread
(``The object class type is the ultimate base class of all other
types. Every type in C# directly or indirectly derives from the
object class type'', ECMA-334 11.2.2).

By comparing C objects with C# objects, one is making a
faulty analogy (also known as ``comparing apples with oranges'').

Better is to write that C# is off-topic here without making
that gratuitous (and logically unsound) remark.

Tak-Shing
Jul 12 '06 #38
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.

--
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 #39
On 2006-07-13 00:40:42 +0200, Ian Collins <ia******@hotmail.comsaid:
Lasse Espeholt wrote:
>On 2006-07-13 00:29:04 +0200, Ian Collins <ia******@hotmail.comsaid:
>>Lasse Espeholt wrote:

I like to have namespaces and using... ;)

So what's the difference in typing a few includes or the equivalent
using directives?


with includes you risk that the files have functions there have the same
name.
That's why C++ added namespaces, the only remedy in C is care.
>with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
I don't, my boilerplate generator does. In your case, I'm sure your
modern IDE would do the same.
Hmm, it seems like we come from two different worlds, but there is room
enogh to both opinions :) but i must amit that i throught many had the
same opinion as i do :)

Jul 12 '06 #40
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 00:29:04 +0200, Ian Collins <ia******@hotmail.comsaid:
>Lasse Espeholt wrote:
>>On 2006-07-13 00:19:03 +0200, Ian Collins <ia******@hotmail.comsaid:

I like to have namespaces and using... ;)
So what's the difference in typing a few includes or the equivalent
using directives?

with includes you risk that the files have functions there have the same name.

with includes you shall write "ifndef __FILE_H__" otherwise you could
end up in trouble.
Well, you may very well end up in trouble typing that. Invading the
implementation's namespace is a no-no. (Using _ followed by another
_ or an UPPERCASE letter is the implementation's namespace).

What exactly is wrong with typing this?:

#ifndef FILE_H_
#define FILE_H_

....

#endif

--
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 #41
On Wed, 12 Jul 2006 23:57:15 +0200, Lasse Espeholt wrote:
>yeah.... Bjarne Stroustrup is from my planet (Denmark, NOT the swedish
capital) ;)
What a coincidence! He's from my planet, too.
>
hhm... i'm sadly the only one whom does not like C structure very much :D
In case you haven't noticed, this is a newsgroup about the standard C
language. Many of the people here do like C and most of its features.
Here, we really don't discuss other languages or what the C language
might be turned into, we discuss it as it is now. If you want to
discuss enhancement of the C language, perhaps you should visit
comp.std.c.

--
Al Balmer
Sun City, AZ
Jul 12 '06 #42
Lasse Espeholt wrote:
On 2006-07-13 00:31:23 +0200, Ian Collins <ia******@hotmail.comsaid:
>>
I've been doing a lot of PHP recently, and it is a real pain not having
a header like summary of an object's member functions. So much so, I
end up creating interfaces as a header replacement.


Maybe you should try a better IDE... with the Visual Studio and ASP.net
(c#, java,...) all methods(functions, procedure and what they are
called) is listed...
I don't like IDEs, I'm happy with my editor and I don't use windows.
--
Ian Collins.
Jul 12 '06 #43
On 2006-07-13 00:42:00 +0200, Al Balmer <al******@att.netsaid:
On Thu, 13 Jul 2006 00:31:02 +0200, Lasse Espeholt wrote:
>>
I want a C with namespaces, usings, a "area" thing and without header files
It's becoming obvious that whatever it is that you want, it isn't C. I
suggest that you identify the language you do want, and then find a
suitable place to discuss it (it won't be here.)
I want C, i don't hate C, i just think things could have been done
better :), fine, end of discussion

Jul 12 '06 #44
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...

Jul 12 '06 #45
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 00:31:23 +0200, Ian Collins <ia******@hotmail.comsaid:
>Andrew Poelstra wrote:
>>On 2006-07-12, Lasse Espeholt <Lassewrote:

On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
On 2006-07-12, Lasse Espeholt <Lassewrote:
>
>On 2006-07-12, 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...?
A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.
I'd second both points.

I've been doing a lot of PHP recently, and it is a real pain not having
a header like summary of an object's member functions. So much so, I
end up creating interfaces as a header replacement.
I comment C-style prototypes up at the top of my listings. If I have a lot
of functions, I'll write a "header" full of comments and include that. (I
prefer not to because it isn't very PHP-like, and friends usually edit my
PHP scripts a lot more often than I do.)
>
Maybe you should try a better IDE... with the Visual Studio and ASP.net
(c#, java,...) all methods(functions, procedure and what they are
called) is listed...
http://www.charlespetzold.com/etc/Do...otTheMind.html

I'm not installing a GUI just so that I can have an IDE. I can't stand
either one of them. vi works just fine, thank you.
But i must amitted that i have'nt meet any well written PHP IDE, so
from that point of view i will agree with you....
/Please/ start using proper punctuation.

--
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 #46
Andrew Poelstra said:

<snip>
>
Please tell me a practical way to write a large C program without any
headers.
Easy. Write a large C program with headers. Run it through the preprocessor.
The output is a large C program without headers.

--
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 #47
On 2006-07-13 00:47:23 +0200, Ian Collins <ia******@hotmail.comsaid:
Lasse Espeholt wrote:
>On 2006-07-13 00:31:23 +0200, Ian Collins <ia******@hotmail.comsaid:
>>>
I've been doing a lot of PHP recently, and it is a real pain not having
a header like summary of an object's member functions. So much so, I
end up creating interfaces as a header replacement.


Maybe you should try a better IDE... with the Visual Studio and ASP.net
(c#, java,...) all methods(functions, procedure and what they are
called) is listed...
I don't like IDEs, I'm happy with my editor and I don't use windows.
Fair

Jul 12 '06 #48
On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-13 00:26:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:
>On 2006-07-12, Lasse Espeholt <Lassewrote:
>>On 2006-07-12 23:58:00 +0200, Andrew Poelstra <ap*******@nowhereat.allsaid:

On 2006-07-12, Lasse Espeholt <Lassewrote:
On 2006-07-12, 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...?

A) Stop ending all of your statements with ellipses and question marks.
B) I don't think it works well in other languages; it's much nicer to
read a header to find the prototype of a function than to have to
find the definition, or documentation, or wherever else you might
find help.

A. Sorry for my formatting, i will try not to use question marks
Thank you. Also try not to use ellipses, and do use other punctuation
correctly.
B. In a modern IDE all the functions is listed.
http://www.charlespetzold.com/etc/Do...otTheMind.html

Interestingly enough, I've typed that out twice for you, and now I have
it memorized. Not only that, but I can type it faster than I could click
on Bookmarks, or Favorites, or whatever the term is on the browser I'm
using.

Kinda proves the point of the article, huh. ;-)

--
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 #49
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. 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.

--
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 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: jerrygarciuh | last post by:
Hi all, I was just wondering what popular opinion is on PHP giving this warning: Warning: Invalid argument supplied for foreach() in /home/boogerpic/public_html/my.php on line 6 when...
2
by: Kari Laitinen | last post by:
During the past 15 years I have been writing computer programs with so-called natural names, which means that the names (identifiers, symbols) in progarms are constructed of several natural words....
29
by: David Eng | last post by:
In replying to P.J. Plauger (...
3
by: Jack Klein | last post by:
I'm looking for opinions on a C technique I, and others, have used successfully in the past. While some people swear by, apparently others swear at it. Assume a part of a program too large to...
3
by: John Doe | last post by:
I've been doing some reading/research on parsing simple configuration files through C, and have heard various opinions on the matter. I'd like to solicit some opinions and design criteria (as well...
10
by: John Swan | last post by:
Please, I have just created this site and am wondering what your opinion is from both professionals and amatures or the curious alike. Any opinions? www.integrated-dev-sol.co.uk Remove 123...
0
by: Florian Thiel | last post by:
Dear PHP web developers, We are currently researching the ways in which the major web development platforms differ and in addition to our work with the Plat_Forms contest, we're now looking for...
5
by: JT | last post by:
Hi, I would like opinions on a shareware issue. If shareware uses an online database to hold registration codes, which get copied locally and therefore only needs to check online if the...
1
by: happyperson | last post by:
Hi All, I want to have a news and product review website. I want an RSS feed, online forum, article submission section, and possibly down the road the ability to upload/download music to this...
21
by: Steve Swift | last post by:
On page 90 of my O'Reilly "Javascript The definitive guide" 3rd edition there is an example of an If/Else construct: (some text removed) If (username != null) alert("Hello " + username); else {...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.