C is too old? opinions?

A

Andrew Poelstra

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
 
A

Al Balmer

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

Ian Collins

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

Lasse Espeholt

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
 
L

Lasse Espeholt

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

Andrew Poelstra

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/DoesVisualStudioRotTheMind.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.
 
R

Richard Heathfield

Andrew Poelstra said:

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

Andrew Poelstra

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/DoesVisualStudioRotTheMind.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. ;-)
 
R

Richard Heathfield

Tak-Shing Chan said:
Lasse Espeholt said:

[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.
 
C

Coos Haak

Op Thu, 13 Jul 2006 00:32:37 +0200 schreef Lasse Espeholt:
Simple, as i said, namespaces and usings so instead of:

#include "myfunctions.h"

you write

using myfunctions;

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

Richard Heathfield

Ian Collins said:
Lasse Espeholt wrote:
I don't, my boilerplate generator does.

I hope not. I hope it puts a # at the beginning, and I hope it omits those
leading underscores. If not, it's broken.
 
L

Lasse Espeholt

Hi...

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

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

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

Something like:

a_source_file.c:

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

private void someMethod() {};

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

another_source_file.c:

using SomeName(.SomeName);

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

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

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

Best and kindest regards
Lasse Espeholt

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

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

Andrew Poelstra

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

#include "myfunctions.h"

you write

using myfunctions;

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

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

With headers I can quickly read this:

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

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

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

Ian Collins

Richard said:
Ian Collins said:




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

#ifndef _module_filename_h_
#define _module_filename_h_

#endif

Where module is lower case.
 
L

Lasse Espeholt

Op Thu, 13 Jul 2006 00:32:37 +0200 schreef Lasse Espeholt:


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

Have'nt you read the threads?
 
A

Andrew Poelstra

I'm not the master in english nor languages in generel. I try...

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

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

Coos Haak

Op Thu, 13 Jul 2006 01:01:35 +0200 schreef Lasse Espeholt:
Have'nt you read the threads?

No, you haven't. This is comp.lang.c not comp.lang.c++
You have been told too many times now.
Verder kan het me aan m'n reet roesten hoe je over C denkt.
 
A

Andrew Poelstra

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

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

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

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

Whatever language you find, happy coding. :)
 
L

Lasse Espeholt

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

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

Whatever language you find, happy coding. :)

Thank you very much.

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

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

Best and kindest regards
Lasse Espeholt
 

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

Forum statistics

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

Latest Threads

Top