Which book is better for a begainer to study C language?

S

Slow_Mind

Dingjiu said:
Please give me some suggestion, thanks a lot$B!*(B

Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

Regards.
 
I

Ian Collins

Slow_Mind said:
Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

Well that al depends what you want or have to program.
 
S

Slow_Mind

Ian said:
Well that al depends what you want or have to program.

Well question is not about me actually. Lets assume someone wants to
learn a general purpose, procedural, Turing complete language. Need more
info ?

Regards.
 
R

Rich Webb

Dingjiu said:


C Programming: A Modern Approach, K.N.King, W.W.Norton & Company,
1996. ISBN 0-393-96945-2

C: How to Program, 5th Ed. Deitel, H.M. & Deitel, P.J. Prentice
Hall, 2007. ISBN: 0-13-240416-8

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:

The C Programming Language, 2nd Ed. Kernighan & Ritchie. Prentice
Hall, 1988. ISBN 0-13-110362-8 (paperback), or 0-13-110370-9
(hardback).

See http://www.cpax.org.uk/prg/portable/c/resources.php#RecBooks

Seconded. Compare and contrast "I learned C from reading
_C_For_Dummies_" to "I learned C from reading K&R2 *and* working all of
the exercises." One might get hired, the other probably won't get a
callback.

The first chapter can be a tough go for new programmers but it gets
easier after that.
 
C

Chris Dollin

Richard said:
I never quite got why "Turing Complete" keeps cropping up here.

Nor I.
I've a couple of good degrees in CS and EE and never once really knew what
Turing Complete was or why people harp no about it.

It means it can compute anything computable (by a Turing machine or one
of its many equivalents). What it means in practice is more like "doesn't
have crippling theoretical restrictions"; if I recall correctly, matching
regular expressions doesn't require TC, so REs alone don't make a powerful
enough programming language.

TC alone doesn't tell you much about the pragmatics of a language, but
if you have a TC system, you can bootstrap yourself up to whatever you
like -- modulo speed and space, of course.
And a quick glance at some definitions make me sure I don't want to know
either. I never ever worked on a project which stated it needed "Turing
Completeness" ...

That's because they all do. I expect most projects also forget to specify
that the programmers must be oxygen-breathers or that they must cope
with temperatures above 200 degrees.
 
K

Kenny McCormack

Absolutely yes. You will learn things about how real machines work. My
first language was assembler, then C. Crap like Pascal at Uni and then
ADA were a walk in the park afterwards.

Keep in mind that "how real machines work" is OT here.

(I'm serious - the whole point of this NG is to focus on the abstract
machine and ignore any/all real world machines and implementaitons)
 
P

pughparkour

Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

Regards.

Well I started learning C very recently from K&R. I've had some
experience programming before, but it's only vb.net. I also had a look
and small fiddle with python. But from a realistic point of view, I
don't know much about programming. From what I've heard, K&R teaches
good practises, and if you don't understand anything, you can always
look it up on the net. There's no reason why it shouldn't be a first
language, so long as you approach it expecting a challenge.
 
J

jfbode1029

Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

IMO, no. The philosophy behind the design of the C language is that
the programmer knows what he is doing at all times, which is typically
not the case for someone with no prior coding experience. Elements of
the syntax can be confusing (especially with declarators and
pointers), and there are some innocent-looking patterns that give you
unpredictable results; for example, i=j++ is well-defined, but i=i++
is not.

There are better languages out there for learning how to program. I
haven't used it myself, but people I trust recommend Python for
learning the basics. Once you learn the basic concepts, picking up
new languages is relatively easy.
 
O

osmium

Slow_Mind said:
Is C recommended for someone who has no coding experience ?

There are better languages designed specifically to ease the learning
process. Two that come to mind are Pascal (kind of like C), and Dartmouth
Basic. Microsoft appropriated the name "Basic" and Visual Basic has little
resemblance to Basic.

If the whole notion of learning a starter language first repulses you, you
could start with C. Most serious programmers know several languages with
various degrees of fluency. It might help to scan the linked article. Note
that assembly language is not really *a* language, there is usually at least
one assembler for each instruction processor.

http://www.scriptol.com/programming/history.php
 
G

Guest

Good to know I'm not alone.

I didn't think it was *that* often


so pretty well *any* reasonable computer language will be TC.
You could almost argue it was the *definition* of a programming
language.

if I recall correctly, matching

I dont even understand that. With any language I have used before I
could write my own RE parser if necessary.

yes, but you couldn't do the reverse. If you don't have a C compiler
then an RE parser won't allow you to build one. Same "problem" with
HTML.

Err, ok <backs off totally confused>

you can write a translater to whatever language suits you.
(If you have lots of spare time...)

This is my point.

So why does it keep cropping up here?

does it?
 
G

Guest

Where is this philosophy written down? I never heard of that.


Which is all part of learning but not something that will necessary
form part of early lessons.


Python?????

Python is at odds with just about everything else out there. You might
as well have picked Haskell.

it can be used as a pretty bog-standard imperitive language.
It looks a lot like the pseudo code I write when I'm designing
an algorithm. Python seems a pretty good choice to me.
 
B

Beej Jorgensen

Richard said:
Python is at odds with just about everything else out there. You might
as well have picked Haskell.

Ha!

I am curious how Python is at odds with just about everything else out
there, though. Lots of schools teach it as a beginner course.

-Beej
 
J

jfbode1029

Yes, I saw some of your pseudo code. It was totally unreadable unless
you read python or similar.

Surely you meant procedural language? Why would you murky the waters by
dropping in the rarely used or heard of "imperitive" (sic)?

"Imperative" as opposed to "functional"; my understanding is that
Python supports multiple paradigms (imperative, functional, object-
oriented, etc).
 
J

jfbode1029

(e-mail address removed) writes:
[snip]
IMO, no.  The philosophy behind the design of the C language is that
the programmer knows what he is doing at all times, which is typically

Where is this philosophy written down? I never heard of that.

I can no longer remember where I read it, but I saw a quote from dmr
to the effect that C was designed for experienced programmers who
wanted a language that didn't get in their way.
 
K

Kaz Kylheku

Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

No.

Here is a good litmus test whether a programming language is a good
introduction to programming for an absolute newbie:

Can you take two character strings, and catenate them, without having to
allocate a buffer to hold the catenated string, and without worrying about
freeing the storage when the program no longer needs the catenated string?

If the answer is no, that language is not suitable for beginning programmers.
 
O

osmium

Kaz Kylheku said:
Here is a good litmus test whether a programming language is a good
introduction to programming for an absolute newbie:

Can you take two character strings, and catenate them, without having to
allocate a buffer to hold the catenated string, and without worrying about
freeing the storage when the program no longer needs the catenated string?

If the answer is no, that language is not suitable for beginning
programmers.

I don't have the energy to try to analyze that. But my WAG is that C++
passes the litmus test and C does not.

That's assuming that "you" is short for "someone" since a beginner doesn't
know what a string is or, likely, what catenate means.

later ... My spell checker refuses to believe there is a word spelled
"cateante". QED.
 
B

BartC

Kaz Kylheku said:
No.

Here is a good litmus test whether a programming language is a good
introduction to programming for an absolute newbie:

Can you take two character strings, and catenate them, without having to
allocate a buffer to hold the catenated string, and without worrying about
freeing the storage when the program no longer needs the catenated string?

If the answer is no, that language is not suitable for beginning
programmers.

If the answer is no, that language is probably C. If yes, then that language
was likely implemented in C.

C is good for implementing things rather than applications.
 
R

Richard Bos

Slow_Mind said:
Hi, can I add another question ? (Oops they become two with this one)

Is C recommended for someone who has no coding experience ?

No. Learn to program using a B&D language like Pascal. When you've done
that, you won't run the risk of picking up a lot of bad habits when you
start to learn C.

Richard
 
B

Beej Jorgensen

osmium said:
I don't have the energy to try to analyze that. But my WAG is that C++
passes the litmus test and C does not.

In his defense, he didn't say that if the answer was "yes" that the
language *was* suitable.

I wasn't a beginner when I learned C or C++, so I can't really imagine
what it would be like as a first language.

-Beej
 

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
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top