pre-requestie for learning C...

P

Phlip

Ike said:
It's Bjarne, not Barney.

And it was "disregard", not "burn".

And doesn't /3rd/ start near std::string, anyway? I'm referring to BS's BFF,
Andy Koenig (of "Koenig Lookup" infamy), and his /Accelerated C++/. He treats it
as a high-level language, not as the Portable Assembler that's so entertaining.
 
J

John Bode

Hi,

I am new to programming. I would like to learn C programming language.
But, one of my cousin told me that, it is only suited for Computer
Science students and for learning that language you should know the
following things :-

1. Computer Organization and Architecture

2. Assembly Language [ For good understanding of pointers ]

Is it true ? Any suggestions ?

Not true. Knowing architecture and assembly language certainly wouldn't
hurt, but it's not necessary to learn C.

Having said that, C makes a *terrible* teaching language; if you're new
to programming, you might want to start with something like Python.
 
T

thushianthan15

I am new to programming. I would like to learn C programming language.
But, one of my cousin told me that, it is only suited for Computer
Science students and for learning that language you should know the
following things :-
1. Computer Organization and Architecture
2. Assembly Language [ For good understanding of pointers ]
Is it true ? Any suggestions ?

Not true.  Knowing architecture and assembly language certainly wouldn't
hurt, but it's not necessary to learn C.

Having said that, C makes a *terrible* teaching language; if you're new
to programming, you might want to start with something like Python.  
Excuse my English.
                             Thank you...
Thushanthan.

Thank you for all your replies and support. I have decided to learn C.
I am using "Practical C programming" from O'Reilly press.

Thank you.
 
L

luser-ex-troll

luser-ex-troll wrote:

... snip ...


I think your difficulties arose from using the blunted Borland
version, rather than something that met the requirements of the
Pascal standard.

Quite possibly. Or from the class itself which focused
exclusively on control structures. I had no concept of
structured data whatsoever.

Is there a programming course that starts with data-
structures? Lately, I tend to think of the data as more
important than the code. Almost like how fully analysing
a question uncovers the answer latent within.

l-x-t
 
P

Pascal J. Bourguignon

John Bode said:
Having said that, C makes a *terrible* teaching language; if you're new
to programming, you might want to start with something like Python.

By the way, the automatic memory management in languages like Python,
Ruby, Lisp, etc, doesn't prevent teaching manual and automatic memory
management with them.

You can write malloc and free, or a garbage collector in a high level
programming language.


;; Silly implementation of malloc/free: we allocate the memory once.
(defconstant +memory-size+ (expt 2 16)) ; 64 Kw
(defvar *memory* (make-array +memory-size+))
(defvar *free* 0)
(defun malloc (size)
(let ((next (+ *free* (1+ size))))
(if (<= next +memory-size+)
(let ((result *free*))
(setf *free* next)
(setf (aref *memory* result) size)
(1+ result))
nil)))
(defun free (ptr)
nil)

;; exercice 1: draw a memory map after the following call:
;; (list (malloc 10) (malloc 0) (malloc 16))
;;
;; exercise 2: modify the above malloc and free to implement
;; a free list; allocate in priority new memory,
;; use the free list when *free* reaches the end.
 
P

Pascal J. Bourguignon

luser-ex-troll said:
Is there a programming course that starts with data-
structures? Lately, I tend to think of the data as more
important than the code. Almost like how fully analysing
a question uncovers the answer latent within.

Well basically all OO course should start with data.

This is an important selling point of OO, that we concentrate about
data more than functions, given that in the real world, data is more
stable than functions.

Otherwise, you are right, when I was taught programming we studied
first a data structure then the statements to process it, then the
next data structure, and the next statements, etc. But it was too
long ago, I don't have any book references.
 
G

Guest

luser-ex-troll wrote:

I think your difficulties arose from using the blunted Borland
version, rather than something that met the requirements of the
Pascal standard.


What was "blunted" about Turbo Pascal? I've used Macintosh Pascal
and Turbo Pascal and things closer to ISO Pascal. ISO Pascal is a
tough
cookie. The Mac (Lightning?) and Turbo Pascals were much closer to
usable
languages.

So what did Turbo Pascal lack that was in the standard to justify the
term "blunted".
 
L

luser-ex-troll

No! That book has appeared on the semi-official comp.lang.c recommended
book list (and I know why), but it's a terrible book to use, assuming a
sample of one code listing is adequate.
Yours,
Han from China

If you already own it, though, it's safe to start reading about
variables and functions and everything. A good second book is
/Deep C Secrets/ by van den Lint(?). It should repair any damage
done by the first book.

l-x-t
 
I

Ike Naar

You missed the X-Troll: header.

The newsreader that I use hides such headers by default.
And besides, that header was explicitly addressed to someone else.
 
I

Ike Naar

A good second book is
/Deep C Secrets/ by van den Lint(?). It should repair any damage
done by the first book.

"Expert C programming: deep C secrets" by Peter van der Linden.
A very entertaining book, but not for an absolute beginner.
 
K

Kenny McCormack

(e-mail address removed) writes:
[...]
Thank you for all your replies and support. I have decided to learn C.
I am using "Practical C programming" from O'Reilly press.

I've heard bad things about that book; see, for example,
<http://accu.org/index.php?module=bookreviews&func=search&rid=1225>.

Kernighan & Ritchie's "The C Programming Language", 2nd Edition, is
widely considered to be the best book for learning C. It's a bit
dense, though.

And so are you. Which is probably why you recommend it.
 
R

Richard Bos

Phlip said:
20 years ago it was wrong. Today, you can get a heck of a lot of programming
done in a softer language. C, today, is for the low-level system stuff, like the
inside of your database or your soft language.

Which, IMLimitedE, is exactly what computer science students do _not_
do, and is definitely what computer practitioners do a lot more than
computer scientists.
and for learning that language you should know the
following things :-
1. Computer Organization and Architecture
2. Assembly Language [ For good understanding of pointers ]
Is it true ?
Absolutely not (although it certainly doesn't hurt).

They are great for recognizing the symptoms of a stray pointer or double free()...

Possibly, but for a beginning programmer, they are much more likely to
lead him astray.
Thank you for your reply. Yes, i have computer and i am using Linux
[ Ubuntu ]. I also installed gcc ....

Install ruby, smalltalk, python, and perl, too, and try little programs with
them! One will catch on with you.

C is a wicked choice for a _first_ language!

Wicked as in bad, or wicked as in *puts on baseball cap, backwards*
like, bad, man! *removes baseball cap and burns it*?

C is not a good choice for a first language. I'd suggest (real, not
Borland!) Pascal myself, but Ruby or Python might be good as well,
though personally I loathe Python. Perl, however, is even worse than C.

Richard
 
R

Richard

Richard Heathfield said:
(e-mail address removed) said:



Its own newsgroup?

There is a thread elsewhere about news readers. You might ask which one
support "kill thread".

I recommend Gnus.
 
C

CBFalconer

Ike said:
.... snip ...


The newsreader that I use hides such headers by default. And
besides, that header was explicitly addressed to someone else.

Newsgroups (and Usenet in general) are not for private
communications. All input is public. For private communications
use e-mail (if possible).
 
C

CBFalconer

.... snip ...


What was "blunted" about Turbo Pascal? I've used Macintosh Pascal
and Turbo Pascal and things closer to ISO Pascal. ISO Pascal is a
tough cookie. The Mac (Lightning?) and Turbo Pascals were much
closer to usable languages.

So what did Turbo Pascal lack that was in the standard to justify
the term "blunted".

The primary thing is that they did not meet the ISO standard for
Pascal in many ways. Just to mention a couple, they lacked the f^,
put, and get functions. The arithmetic text input functions
insisted on termination with EOLine, rather than a non-numeric
character. Lacking f^ etc. you couldn't pick out what was needed.

Note that I am not objecting to extensions (although I consider
they should be suppressible, in order to show conformation to the
standard). I am objecting to lack of things required by the
standard. Users of Borland never learned to use the language
properly.
 
C

CBFalconer

.... snip ...

Thank you for all your replies and support. I have decided to
learn C. I am using "Practical C programming" from O'Reilly press.

I think you should at least get K&RII. Most consider it the best
introduction to C available, although some find it too compact.
 

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,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top