C is too old? opinions?

I

Ian Collins

Lasse said:
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();
 
M

Mark McIntyre

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
 
M

Mark McIntyre

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
 
L

Lasse Espeholt

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

Lasse Espeholt

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


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



Brian

better but still not perfect...
:)
 
A

Andrew Poelstra

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

Lasse Espeholt

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

Lasse Espeholt

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.

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
 
I

Ian Collins

Andrew said:
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.
 
L

Lasse Espeholt

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;
 
L

Lasse Espeholt

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

Lasse Espeholt

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

Lasse Espeholt

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

Ian Collins

Lasse said:
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.
 
A

Al Balmer

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

Tak-Shing Chan

Lasse Espeholt said:

[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
 
A

Andrew Poelstra

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

Lasse Espeholt

That's why C++ added namespaces, the only remedy in C is care.

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

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top