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 187 6269
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
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?
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.
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
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 ;)
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
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
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)
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)
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 ?
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
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
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
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
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....
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...?
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
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
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.
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
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
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... ;)
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...
:)
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
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
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... :)
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.
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
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.
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;
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.
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.
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....
<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
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.
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
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
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
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 :)
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
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
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.
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
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...
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
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)
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
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
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) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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....
|
by: David Eng |
last post by:
In replying to P.J. Plauger (...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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 {...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |