tutorials

B

Barièeviæi

Can somebody list some books or internet pages concerning c leraning
tutorials?
If it was posted I appologize
 
N

Nick Keighley

If you are already an experienced programmer, but just haven't yet
learned C, you will appreciate the briefer approach of Brian
Kernighan (silent 'g', by the way), and Dennis Ritchie. Kernighan
is the 'K' in AWK, and Dennis Ritchie wrote the C language itself.
The book is very short (272 pages including the index), but its
information density is colossal. This book teaches you more about C
than many books four times the size:

unfortunately they now publish it on thicker paper (really)
so it can now only teach more about C than many books nearly twice
the size.

:)
 
J

jacob navia

Richard said:
jacob navia said:


The OP may not be aware that Jacob Navia is the maintainer of
lcc-win32 and has a commercial interest therein, so he is not
exactly a disinterested party.


This is not true since the download is without any charge for the user
This is another attempt by heathfield to misrepresent lcc-win.
Furthermore, since lcc-win32 does
not claim to conform to C90 and does not yet conform to C99, it
isn't actually a C compiler.

Sure sure, and heathfield is not a c programmer.
This is just not true

Note that the tutorial to which Jacob Navia posted a link says:

"What the C language concerns, this is not a full-fledged
introduction to all of C." In fact, large chunks of it are devoted
to the lcc-win32 interface, to Windows, and to extensions.

Contrary to heathfield, I do not say:

"This book is the best of the best, The first and final stop for all
your readings"
It is easy for a C aficionado to pick tiny holes in the tutorial,
but that would be uncharitable and I don't plan to do it here. So
here are three medium-to-large mistakes instead (the first three I
found). I deliberately stopped recording after finding three, but I
did find several others.

In 1.3.2, the tutorial confuses "argument" and "parameter". The
distinction between them is vital to understanding pass-by-value,
so this is not a minor nit.

This is not true
I was trying to avoid objecting to the claim that main() is always
the entry point, on the grounds that it is not that unreasonable to
expect the user to be concerned primarily with a hosted
implementation. But in 1.4.2.1 the tutorial specifically mentions
freestanding implementations, and incorrectly claims that on such
implementations the entry point is always int main(void).

In 1.6.9, the table claims that there are two flavours of char -
signed or unsigned. In fact, there are three (plain char was
omitted).

This is not true

If I discover that these have been fixed, I'll go and find the next
three.

You have no right to download or use my book, nor my compiler.

I can recommend the Tom Torfs tutorial or the Steve Summit tutorial.

I can recommend to fix the bugs in your book before you give lessons
to anyone here
 
J

James Kuyper

jacob said:
This is not true since the download is without any charge for the user
This is another attempt by heathfield to misrepresent lcc-win.


Your web site says "if you use it professionally you have to have to buy
a license". Is this no longer true? That web page doesn't indicate how
to get a license - are they now available for free? But in that case,
what does it mean when it says "contact us for special educational
rates."? If your commercial licenses are free, then why would special
rates be desirable for educational use?

If you do have charge money for licenses that allow commercial use of
lcc-win32, then you do have a commercial interest in the product.
There's nothing wrong with having a commercial interest in a product,
but it does tend to put your objectivity with respect to that product
into question, and it's entirely appropriate to point that fact out to
someone who might be unaware of that fact.
Sure sure, and heathfield is not a c programmer.

To the OP: Richard Heathfield, and many others, consider a compiler to
be a C compiler only if it implements no intentional deviations from
full C compliance. Jacob is using a more relaxed version definition of
"C compiler", one that he's never clearly specified.
Contrary to heathfield, I do not say:

"This book is the best of the best, The first and final stop for all
your readings"

He did not say that about his own book, and he did not suggest that you
have said that about your tutorial. However, a tutorial with the
features he describes is a bad starting point for learning C, unless one
has deliberately made the choice to restrict one's future career
development to Windows and lcc-win32.
This is not true

Are you saying that it is not true that the tutorial confuses them?
It talks about the "space reserved for the "function[']s arguments", but
it doesn't actually use the word "parameter" anywhere in that section
except for the title; no one who doesn't already know what "parameter"
means in a C context would be likely to realize that the space you refer
to is the space which contains the function parameters.

Or are you suggesting that it's not true that "the distinction between
them is vital"? I think the distinction is vital.

....
This is not true

Are you saying that it is not true that "the table claims that there are
two flavours of char" or that it is not true that there are three?


The standard's pretty clear about the fact that plain char is distinct
type from the other two, though it has the same representation as one of
the other two. However, since "flavour" is not a term with a
well-defined meaning in a C context, you could reasonably claim that it
refers to the representation, rather than the type; there are only two
different representations. However, that's far less than perfectly clear.
You have no right to download or use my book, nor my compiler.

Your web site specifies no restrictions on who can download from it,
except for specifying that a license is required for non-commercial use.
On what grounds do you deny that he has a right to download them? You
might want to modify your web site to say that "downloading for the
purpose of critiquing this software is strictly prohibited", or whatever
wording you think most accurately conveys your objection.
I can recommend to fix the bugs in your book before you give lessons
to anyone here

He has made errata available, and he's not giving lessons, he's
recommending getting lessons from other people.
 
B

BartC

Barièeviæi said:
Can somebody list some books or internet pages concerning c leraning
tutorials?
If it was posted I appologize

Googling for "C programming tutorial" didn't turn up anything?
 
O

osmium

:
jacob navia said:


I made these three claims. Which one are you claiming is false?

(a) you are the maintainer of lcc-win32
(b) you have a commercial interest in lcc-win32
(c) you are not a disinterested party


The claim that I am not a C programmer is indeed not true, but I
don't think you meant that. I think you meant it's not true that
lcc-win32 is not a C compiler. So are you now claiming that
lcc-win32 conforms to at least one version of the ISO 9899
standard? Because that's the benchmark.


How is that "contrary to heathfield"?


Yes, it is. Look for yourself.



Not true that there's such a thing as plain char? See 6.2.5(15):

"The three types char, signed char, and unsigned char are
collectively called the character types. The implementation shall
define char to have the same range, representation, and behavior as
either signed char or unsigned char."

Not true that you claimed there are two flavours? See 1.6.9 of your
tutorial:

char 1 Character or small integer type. Comes in two fla-
vours: signed or unsigned.



If you don't want people to download stuff from your Web site, don't
put it on your Web site. If you put it on your Web site under
"downloads", you can hardly be surprised if people download it.



I have done so, to the best of my knowledge, by publishing a
comprehensive errata list. For a printed work, that's about all I
can do, and you know it well. If you know of any bugs not listed on
the errata, feel free to tell me about them. Unlike you, I welcome
corrections.

Would you please at least pretend to be an adult and stop boring us all with
your tiresome vendetta against Jacob Navia?

Thanks a lot.
 
B

BartC

Keith Thompson said:
I'm sure it would turn up plenty of things -- and would demonstrate
that Sturgeon was an optimist.

(Sturgeon's law: 90% of everything is crud.)

So no different to most google searches then.

I did check beforehand and there seems to be quite a bit of useful material
out there. Unless you're a discerning connoisseur such as RHe of course then
you might be harder to please.

Usually google definitely isn't my friend and I would not suggest it, but
the amount of C programming material around is huge enough that even google
can hardly miss it. (A lot of it is pretty old though.)
 
F

Flash Gordon

Richard said:
Nick Keighley said:


The clc wiki is not in good shape. It is currently advertising all
kinds of bizarre medications. In fact, the last fourteen edits (all
the ones shown on "Recent Changes") are all spam.

It seems to have been hit by a/some user creation bots, I don't think
the real content has been hit. I'm going through deleted the spam.
 
P

Phil Carmody

Richard Heathfield said:
osmium said:

<snip>
ITYM:

It's not a vendetta to repeatedly correct someone who persistently
posts things of little or negative use. It may to some appear to be
a waste of effort, but if Jacob persists with his posts _someone_
will persist with picking his frequent misdirections and mistakes
to pieces.

That's lost on me. I know it's OT, but can I have a pointer please?

Thank you. Shame osmium couldn't work out such a cunning editorial
technique.

Phil
 
J

jacob navia

Phil said:
It's not a vendetta to repeatedly correct someone who persistently
posts things of little or negative use. It may to some appear to be
a waste of effort, but if Jacob persists with his posts _someone_
will persist with picking his frequent misdirections and mistakes
to pieces.

I do post code here, I do post help to people.

I have written a C compilation system without the help of anyone, and
without anyone's financing. It is a very popular C99 implementation,
with more than 1 million downloads since we started counting, some 4-5
years ago.

This has been a huge effort for the C community, an effort that has
been here repeatedly misrepresented as being selfish or plain commercial
by people whose only credentials are to complain about my compiler
in this group.

If I propose to that poster that asked for a tutorial to download my
tutorial is because I have taken from my time countless hours to write
that 500 pages tutorial in the first place!

I try to explain there how a compilation system
for C works from the ground up.

To see people like this heathfield guy say that my work is not a C
compiler and similar nonsense is preposterous. But in this group is
possible, since what it counts here is group-think and not actual
accomplishments.

That is why even if my programs work and are successful that will never
count in the eyes of people that can't do anything else but discuss
endlessly the same old questions here, or denigrate the work of others.

What have YOU contributed to the C community Mr Carmody?

My compiler system and all my posts are "of little or negative use"
to you, but then... how come that they are so largely used?

Yours sincerely

jacob navia
 
J

jacob navia

Richard said:
jacob navia said:


So the names "Christopher Fraser" and "David Hanson" don't ring any
bells for you?

This is the only thing I think needs to be clarified from your
ramblings.

I did start with the lcc compiler, as I have made abundantly clear.
(I didn't even change the name).

But from a compiler that generates ascii text to a compiler system
complete with assembler, linker, debugger, make utility and whatever
there is quite a distance.

I said that I wrote the compilation *system* even if all the code in the
original lcc is completely rewritten for increased performance.

And this doesn't disminish the work of Chris Fraser and Dave Hanson
at all.

I won't reply to any further posts from you.

It is just not worth the effort.
 
O

osmium

Richard Heathfield" said:
If I discover that these have been fixed, I'll go and find the next
three.

If that doesn't desribe a vendetta, WTF does?

I would suggest that Jacob fix the parameter/argument thing, I can't get
very worked up about the other things.

I don't spend all my waking hours obsessing about this stuff, but as I
semi-interested bystander, I thought the vast majority of compilers are not
C compilers by the standards you apply to him. I know my compiler allows //
comments but if I tried to use the built in complex numbers, I am quite sure
it would barf. So it is not a C compiler, QED.
 
J

jacob navia

osmium said:
If that doesn't desribe a vendetta, WTF does?

I would suggest that Jacob fix the parameter/argument thing, I can't get
very worked up about the other things.

The whole section reads like this
<quote>
What are “function parameters” ?
When you have a function like:
int fn(int a) { ... }
the argument (named a) is copied into a storage area reserved by the
compiler for the functions arguments. Note that the function fn will use
only a copy, not the original value. For instance:
int fn1(int a)
{
a = a+7;
return a;
}
int fn2(void)
{
int b = 7;
fn1(b);
return b;
}
The fn2 function will always return 7, because function fn1 works with a
copy of b, not with b itself. This is known as passing arguments by
value. This rule will not be used for arrays, in standard C.
When you see a statement like:
printf("Hello\n");
it means that the address of the first element is passed to “printf”,
not a copy of the whole character array. This is of course more
efficient than making a copy, but there is no free lunch. The cost is
that the array can be modified by the function you are calling. More
about this later.
<end quote>

From this, heathfield says I do not explain the difference between
passing by value and passing by address. That is just bad faith, only to
be had from a PEDANT. "Argument" and "parameter" are using
interchangeably in common day language.

From Dictionary.com we get for "pedant:
1. a person who makes an excessive or inappropriate display of learning.
2. a person who overemphasizes rules or minor details.
3. a person who adheres rigidly to book knowledge without regard to
common sense.

I think all of them apply to this guy.
 
K

Keith Thompson

jacob navia said:
I do post code here, I do post help to people.

Good for you. Seriously.
I have written a C compilation system without the help of anyone, and
without anyone's financing. It is a very popular C99 implementation,
with more than 1 million downloads since we started counting, some 4-5
years ago.

Since lcc-win is based on lcc, I have to question the assertion that
you wrote it "without the help of anyone". (This is not a criticism
of you or your work, though I don't expect you to believe that.)

You call it a "C99 implementation". Without arguing about the meaning
of that phrase, does your implementation fully implement the C99
standard? That's an important question which you've dodged in the
past.
This has been a huge effort for the C community, an effort that has
been here repeatedly misrepresented as being selfish or plain commercial
by people whose only credentials are to complain about my compiler
in this group.

If I propose to that poster that asked for a tutorial to download my
tutorial is because I have taken from my time countless hours to write
that 500 pages tutorial in the first place!

The primary objection was not to your mention of your tutorial,
but to your failure to mention your own association with it.
You provided the original poster with a URL, but did not mention
that it was your own work.

I have no problem with your posting a recommendation for something
that's your own work. But it's only polite, in my opinion, to
acknowledge that fact.

(There were also some technical criticisms of the tutorial itself;
I won't go into those here.)

[snip]

And as long as I have your attention (assuming you've read this
far), have you reconsidered your recent claim that the "regs"
have criticized you regarding lcc-win's undocumented ansic89 option?
 
F

Flash Gordon

osmium said:
If that doesn't desribe a vendetta, WTF does?

It could be laziness, not bothering to find more errors. However, I do
think making that statement was going a bit far, simply saying that he
had not gone further through the tutorial would have been sufficient.
I would suggest that Jacob fix the parameter/argument thing, I can't get
very worked up about the other things.

The others are important as well. Properly invoked a compiler will
generate a diagnostic if you pass it a pointer to (un)signed char when a
pointer to char is required. If dealing with freestanding
implementations, knowing that the entry point might not be main is
important (and the tutorial talks about freestanding implementations).
I don't spend all my waking hours obsessing about this stuff, but as I
semi-interested bystander, I thought the vast majority of compilers are not
C compilers by the standards you apply to him. I know my compiler allows //
comments but if I tried to use the built in complex numbers, I am quite sure
it would barf. So it is not a C compiler, QED.

I think you will find that if given the right options it will fully
conform to a version of the C standard, probably either C90 or C95, and
will diagnose // style comments.
 
B

BartC

Richard Heathfield said:
jacob navia said:

So you didn't write a C compilation system without anyone's help
after all. (In fact, it seems that you didn't write a C compilation
system *at all* - see below.)


Undoubtedly. It's a huge distance. But it's not the /whole/
distance.

I don't know what proportion of the lcc-win32 project still consists of lcc.
But how small a proportion would that have to be for you to admit that it
might now be a largely independent effort? (For my own projects, I made sure
they were 100% my own code, to avoid exactly this kind of argument.)

There is nothing after all to stop anyone downloading and using lcc instead
of lcc-win32, so there must be a good reason for someone to prefer the
latter over lcc.

Not having used lcc, I wouldn't know but might guess it might be that
lcc-win32 works out of the box and is complete with headers and libraries
not only for standard C, but for Windows, and for a host of other common
addons, together with the other utilities mentioned.

Perhap even the excellent tutorial might play a part, describing not just
the usual C stuff but showing what is possible by going beyond the standard
language a little way, which is a good way to keep it interesing. But to
dismiss the lot because on one page it might have mistakenly described an
argument as a parameter or whatever it was ...
 
K

Keith Thompson

jacob navia said:
From this, heathfield says I do not explain the difference between
passing by value and passing by address. That is just bad faith, only
to be had from a PEDANT. "Argument" and "parameter" are using
interchangeably in common day language.
[...]

Yes, but they are not properly used interchangeably in discussions of
C. They are two very different things, (you can look up their
definitions in the C standard), and a tutorial of all things should
clearly make the distinction.

Suppose someone posts a program here that looks like this:

#include <stdio.h>

void func(int x)
{
printf("x = %d\n", x);
x ++;
}

int main(void)
{
int x = 42;
func(x);
printf("x = %d\n", x);
return 0;
}

Of course we all know that the output will be

x = 42
x = 42

but how do you explain that to an inexperienced C programmer? I'd say
that modifying the parameter doesn't modify the argument, along with
an explanation of the words mean.
 
K

Keith Thompson

BartC said:
I don't know what proportion of the lcc-win32 project still consists of lcc.
But how small a proportion would that have to be for you to admit that it
might now be a largely independent effort? (For my own projects, I made sure
they were 100% my own code, to avoid exactly this kind of argument.)

I don't know, but that's not the point. I'll gladly acknowledge that
lcc-win32 may be a "largely independent effort", and that may have
been what jacob *meant*, but it's not what he actually wrote. What he
actually wrote was

I have written a C compilation system without the help of anyone,
...

(That's an incomplete quotation, but I don't think any of the meaning
is lost by quoting it out of context.)
There is nothing after all to stop anyone downloading and using lcc instead
of lcc-win32, so there must be a good reason for someone to prefer the
latter over lcc.

Nobody here has claimed otherwise.
Not having used lcc, I wouldn't know but might guess it might be that
lcc-win32 works out of the box and is complete with headers and libraries
not only for standard C, but for Windows, and for a host of other common
addons, together with the other utilities mentioned.

Nobody here has claimed otherwise.
Perhap even the excellent tutorial might play a part, describing not just
the usual C stuff but showing what is possible by going beyond the standard
language a little way, which is a good way to keep it interesing. But to
dismiss the lot because on one page it might have mistakenly described an
argument as a parameter or whatever it was ...

Personally, I'm less concerned with the errors in the tutorial
than with jacob's reaction when they're pointed out. But Richard,
by his own account, simply started reading the tutorial and found
three major errors in about 10 minutes. Each error by itself may be
minor, but the implied density of errors is worrying. Perhaps the
rest of the tutorial is error-free, but that seems unlikely.

If jacob is unwilling to accept criticism of his tutorial, perhaps he
should stop posting links to it here.
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top