All inclusive header files?

T

Tim Rentsch

Malcolm McLean said:
Malcolm McLean said:
I notice that there are a lot of header files eg. <stdio.h>,
stdlib.h> and <conio.h> which a programmer must include
in order to use certain commands. Is there a all-inclusive
file?
No.
If we were designing C from scratch we'd probably just [snip]

His Majesty McLean employs a majestic plural (also called
a "royal 'we'") -
Strictly it should be "If one were to design C from scratch ..."

No, what you mean is if _you_ were to design C from scratch, you
would probably etc.

If _one_ were to design C from scratch, what he or she would
do would depend on who the someone is. Saying what an unknown
someone would probably do displays an enormous amount of hubris,
don't you think?
 
K

Keith Thompson

Tim Rentsch said:
Malcolm McLean said:
I notice that there are a lot of header files eg. <stdio.h>,
stdlib.h> and <conio.h> which a programmer must include
in order to use certain commands. Is there a all-inclusive
file?

No.
If we were designing C from scratch we'd probably just [snip]

His Majesty McLean employs a majestic plural (also called
a "royal 'we'") -
Strictly it should be "If one were to design C from scratch ..."

No, what you mean is if _you_ were to design C from scratch, you
would probably etc.

If _one_ were to design C from scratch, what he or she would
do would depend on who the someone is. Saying what an unknown
someone would probably do displays an enormous amount of hubris,
don't you think?

Surely such hubris is better displayed than hidden, don't you think?

:cool:}
 
M

Malcolm McLean

Malcolm McLean said:
I notice that there are a lot of header files eg. <stdio.h>,
stdlib.h> and <conio.h> which a programmer must include
in order to use certain commands. Is there a all-inclusive
file?
No.
If we were designing C from scratch we'd probably just [snip]
His Majesty McLean employs a majestic plural (also called
a "royal 'we'") -
Strictly it should be "If one were to design C from scratch ..."

No, what you mean is if _you_ were to design C from scratch, you
would probably etc.

If _one_ were to design C from scratch, what he or she would
do would depend on who the someone is.  Saying what an unknown
someone would probably do displays an enormous amount of hubris,
don't you think?
No, "if I were to design C from scratch" implies that I'm aware of a
significant group of people who would do things differently, and not
aware of a similar group who think along the same lines as I do. Also
it implies an ability, even a willingness, to design a programming
language from scratch.

However I think the number of people who, charged with redesigning C
and not concerned with backwards compatibility, would leave the header
system as it is, would be quite small. You can call that hubris if you
like, but I think it's just experience, I've been programming for 30
years and using C for 20 of them, so I know what the average
programmer is likely to think.
 
T

Tim Rentsch

Malcolm McLean said:
[snip]

However I think the number of people who, charged with redesigning C
and not concerned with backwards compatibility, would leave the header
system as it is, would be quite small. You can call that hubris if you
like,

Saying "I think ..." is simply stating an opinion. Making the
statement you did, as though it were simply true, is hubris.
but I think it's just experience, I've been programming for 30
years and using C for 20 of them, so I know what the average
programmer is likely to think.

Ahhh, you mean if relatively inexperienced programmers were to
redesign C this is what they would do. No doubt you are better
able to judge that than many of the people here.
 
M

Malcolm McLean

Ahhh, you mean if relatively inexperienced programmers were to
redesign C this is what they would do.  No doubt you are better
able to judge that than many of the people here.
No, not at all.
If you've 30 years experience programming then, in the normal run of
things, that bring you into contact with many other programmers, both
experienced and inexperienced. So you know that the bulk of them
wouldn't have designed the C header system the way it is, if charged
with redesigning the language from scratch.

It's unscientific, of course, I'm not going to send out a survey and
control for response bias and other effects. It's just basic knowledge
of the way other people think. Experience. Which could be confused
with hubris.
 
N

Nick Keighley

It's not just the headers, the whole c language is like that.
Anytime that I have to use a feature of the language
and I can't remember exactly how it works,
I have to look it up.

I had that sortofproblem when I was learning C, but really C is a
small langauge. Is it really hat hard to remember most of the common
functions/headers?
 
M

Malcolm McLean

I couldn't care less what the average programmer thinks, his preferences or
whatever. I do care some about what great programmers think. Ritchie,
Thompson, Kernighan, Pike, et. al. If you Mr. McClean would redesign C from
scratch you have been invited to do so for several years. There are a
plethora of open source C compilers out there for you to choose as a
beginning. Pick one. Go for it!
It's Dr McLean.

I have designed a language from scratch. It's called MiniBasic and is
available on the web.

It's based on BBC Basic, but I made a few changes, for instance it's
possible to intialise arrays rather than using read / data statements,
which many beginners find confusing.
To change the C include system you don't need to rewrite a compiler
from scratch, just constuct an "stdheaders.h" file. It's not a good
idea, because of backwards compatibility, and because, unless you are
the ANSI committee, you shouldn't be trying to redefine the language
in this sort of way.
 
M

MikeP

Malcolm said:
It's Dr McLean.

I have designed a language from scratch. It's called MiniBasic and is
available on the web.

It's based on BBC Basic, but I made a few changes, for instance it's
possible to intialise arrays rather than using read / data statements,
which many beginners find confusing.
To change the C include system you don't need to rewrite a compiler
from scratch, just constuct an "stdheaders.h" file. It's not a good
idea, because of backwards compatibility, and because, unless you are
the ANSI committee, you shouldn't be trying to redefine the language
in this sort of way.

What would that stdheaders.h file consist of? I use a technique that one
header file includes the appropriate headers depending on what
preprocessor conditional is defined. For example.

// Example entry in stdheaders.h
// (Additional REQUIRE_XXX defines may be and probably will be
// defined by in this main header. i.e., The dependency "analysis" is
// done here via preprocessor conditionals and the necessary headers
// are then included in a proper order below).
//
#if defined REQUIRE_THREADS
# ifndef THREADS_H_
# define THREADS_H_
# include <thread/threads.h>
# endif
#endif

// Some using source file
//
#define REQUIRE_THREADS
#include <stdheaders.h>

Basically, I'm doing dependency management manually, and that results in
more orthogonal code rather than the spaghetti-like standard library
inclusion pattern. It's a real boon during library development since all
the files don't have to be updated with the #include statements as the
library evolves and the dependencies change.
 
M

Malcolm McLean

So you designed a language from scratch called MiniBasic? Yet its based
on BBC basic with a "few changes".

Yesss......
Redesigned from scratch. Everything I put in was there because I
wanted it to be in, not because it needed to be compatible with
previous code.

I had my old Beeb manual handy, and I used that as a guide, but mainly
for the built-in functions. No programming language is designed from
scratch in the sense that there is no influence at all from other
languages.
 
S

Seebs

However I think the number of people who, charged with redesigning C
and not concerned with backwards compatibility, would leave the header
system as it is, would be quite small. You can call that hubris if you
like, but I think it's just experience, I've been programming for 30
years and using C for 20 of them, so I know what the average
programmer is likely to think.

Well, you disagree with many other experienced C programmers on what "the
average programmer" is likely to think. But perhaps more importantly, why
would we care about what "the average programmer" thinks? Languages designed
by average programmers are not much good.

I will say, your coding style is highly idiosyncratic for C, and not much
like what I've seen from almost anyone else.

-s
 
T

Tim Rentsch

Malcolm McLean said:
No, not at all.
If you've 30 years experience programming then, in the normal run of
things, that bring you into contact with many other programmers, both
experienced and inexperienced. So you know that the bulk of them
wouldn't have designed the C header system the way it is, if charged
with redesigning the language from scratch.

It's unscientific, of course, I'm not going to send out a survey and
control for response bias and other effects. It's just basic knowledge
of the way other people think. Experience. Which could be confused
with hubris.

The online Merriam-Webster's dictionary defines hubris as "exaggerated
pride or self-confidence". I leave it to others to decide which of us
might be confused.
 
M

Malcolm McLean

When using hubris it is more useful than for most words
to remember its root in Greek legend. Hubris is wanton
insolence or arrogance resulting from excessive pride
or from passion; setting oneself up as an equal to the
gods. Drawing the attention of the gods is unwise.
Generally, appealing to a dictionary doesn't illuminate matters. It's
even listed as a philosophical fallacy.

A dictionary can tell you how a word is used in everyday speech, but
not what it "really" means. For example, looking up "God" in the
dictionary isn't going to tell you anything about theology.
 
B

Ben Bacarisse

Malcolm McLean said:
Generally, appealing to a dictionary doesn't illuminate matters. It's
even listed as a philosophical fallacy.

A dictionary can tell you how a word is used in everyday speech, but
not what it "really" means. For example, looking up "God" in the
dictionary isn't going to tell you anything about theology.

They are not as bad as all that. i just looked up "of-topic" in the OED
and it says:

off-topic adj. not relevant, away from the subject in question (now
freq. of material sent to an Internet newsgroup).
 
T

Tim Rentsch

Michael Press said:
Merriam-Webster is most often cited. I find it
soulless, repressed, and less than illuminating.

I chose this definition because I think it most closely
represents what most people mean when they use the word
(in contemporary native English). I'm sure it does for
me, and that sense is what I set out to explain.
When using hubris it is more useful than for most words
to remember its root in Greek legend. Hubris is wanton
insolence or arrogance resulting from excessive pride
or from passion; setting oneself up as an equal to the
gods. Drawing the attention of the gods is unwise.

I found that too during my dictionary search. I agree
that it's interesting, but it's not really relevant to
what I meant in my usage (nor, I expect, to how most
people read it).
 
T

Tim Rentsch

I dunno, Tim. You chose the shoe; wear it.

This comment surprises me, coming from you. If you
have something to say, just say it straight out.
The above remark is nothing but innuendo.
 
R

Robert Hinson

Is that what the automake utils are for? It generates include files so
it can make the app?
 

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,085
Messages
2,570,597
Members
47,221
Latest member
LashundaCh

Latest Threads

Top