pre-requestie for learning C...

P

Pascal J. Bourguignon

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 ?

Don't start learning programming with C.

The best professors of the world, teaching at MIT, start teaching
programming in their 6.001 course with scheme.

I thought I'd heard MIT had dropped scheme for their introductory
programming course?

That's not because we observe dumbing down everywhere that we have to
follow suit.

this has a reputation of being a tough read- it expects a certain
mathematical literacy

The OP said he was a beginner in programming, not an idiot.
 
P

Phlip

luser-ex-troll said:
toby wrote:
What a supremely bizarre thing to read in comp.lang.c!

I used to post the equivalent to the C++ forum. Why is it bizarre?

People would ask, like, "How do I write a web page in C++?", or "How do I write
a simple C++ program that moves my files around?"

C and C++ put the needs of the CPU above the needs of the programmer. If you use
a softer language (one that stays out of your way) you can get more done,
faster. This, in turn, frees up your time to use a C language, when you actually
need its power.
 
L

luser-ex-troll

I used to post the equivalent to the C++ forum. Why is it bizarre?

People would ask, like, "How do I write a web page in C++?", or "How do I write
a simple C++ program that moves my files around?"

C and C++ put the needs of the CPU above the needs of the programmer. If you use
a softer language (one that stays out of your way) you can get more done,
faster. This, in turn, frees up your time to use a C language, when you actually
need its power.

Agreed. I have no objection to recommending appropriate
alternatives. But the OP concerned whether to /learn/ C.
And the trend of the responses appeared to be
communicating: don't do it. I felt compelled to protest.

I was taught BASIC in school at around 10 y/o, and it
just felt annoyingly clumsy, confusing and lacking power.
When I found Turbo Pascal on the 386 in the corner of the
computer room (otherwise dominated by Apple IIs), I took
it home over the space of a week, copying as much as my
one floppy disk would hold. Now I could write a text game
that would work like a Choose-Your-Own-Adventure book!
After about 2000 lines of functions full of print
statements with retyped input routines at the end of
each one, I gave up and devoted my afternoons to the
guitar.
Then, in college, some dude who lived down the hall
showed me a Korn Shell script to sort a text-file,
pull fields from each line with cut, and some other magic.
I signed up for Introduction to Computer Science CS120
the next semester. We learned C. I've never looked back.

I can't help but think that had I encountered C instead
of Pascal, I'd have almost 10 years more experience with
all this. The C language has a gravitas that more
beginner-friendly languages lack. Every difficulty
overcome increases ones knowledge about the implementation
issues that are intrinsic to what's actually going on
"under the hood".

Yes, it's a challenge, but the curious should be
encouraged even as they're being warned.


l-x-t
 
J

[Jongware]

luser-ex-troll said:
Agreed. I have no objection to recommending appropriate
alternatives. But the OP concerned whether to /learn/ C.
And the trend of the responses appeared to be
communicating: don't do it. I felt compelled to protest.

I was taught BASIC in school at around 10 y/o, and it
just felt annoyingly clumsy, confusing and lacking power.
When I found Turbo Pascal on the 386 in the corner of the
computer room (otherwise dominated by Apple IIs), I took
it home over the space of a week, copying as much as my
one floppy disk would hold. Now I could write a text game
that would work like a Choose-Your-Own-Adventure book!
After about 2000 lines of functions full of print
statements with retyped input routines at the end of
each one, I gave up and devoted my afternoons to the
guitar.
Then, in college, some dude who lived down the hall
showed me a Korn Shell script to sort a text-file,
pull fields from each line with cut, and some other magic.
I signed up for Introduction to Computer Science CS120
the next semester. We learned C. I've never looked back.

I can't help but think that had I encountered C instead
of Pascal, I'd have almost 10 years more experience with
all this. The C language has a gravitas that more
beginner-friendly languages lack. Every difficulty
overcome increases ones knowledge about the implementation
issues that are intrinsic to what's actually going on
"under the hood".

Yes, it's a challenge, but the curious should be
encouraged even as they're being warned.

It seems to come down to a personal feeling: "how do I feel about
lo-level programming".

I already was highly proficient in Z80 and Motorola assembler and half a
dozen Basic dialects when I bought an Archimedes (dubbed 'the best home
computer [lots of] money can buy at that time'). I found a few disks
with a C compiler, but I soon found out its 'hellow.c' was a nightmare
of system calls, window update rectangles, and other API stuff. I
abandoned C in disgust and turned (again) to its native Basic dialect,
which also (ta-da!) dubbed as native assembler.

The computer came with a PC emulator, which was good enough to run ...
Turbo C under MS-DOS. Oddly enough, I found myself programming PC stuff
in weeks, but never dared touching Archimedes C again.

Morale of the story? None -- your experience may differ.

[Jongware]
 
K

Keith Thompson

Kenneth Brody said:
Keith said:
jacob navia said:
toby wrote:
C is the wrong language for most tasks.
C is a general purpose programming language and can be used for any
task. This guy is just talking nonsense.
[...]

Yes, it *can* be used for any programming task, but it's not always
the best tool for the job.

Well, there's a big difference between "not always the best tool for the
job" (which I agree with, BTW) and Toby's "the wrong language for most
tasks" (which I disagree with, BTW).

Are you saying C is the right language for *most* tasks? In other
words, that of all programming tasks, C is the best tool for the
majority of them? (Yes, this reasoning assumes that there is a single
"right language" for any given job, which is an oversimplification.)

I suspect most of us are in agreement, but just stating the same thing
in different ways and with differing emphasis.
 
J

jacob navia

Kenneth said:
Keith said:
jacob navia said:
toby wrote:
C is the wrong language for most tasks.
C is a general purpose programming language and can be used for any
task. This guy is just talking nonsense.
[...]

Yes, it *can* be used for any programming task, but it's not always
the best tool for the job.

Well, there's a big difference between "not always the best tool for the
job" (which I agree with, BTW) and Toby's "the wrong language for most
tasks" (which I disagree with, BTW).

Though, I suppose if "all tasks" were to include everything non-computer-
related, then I would agree with Toby's assertion. :)

that guy ("toby") is in good company.

The "speaker" (or representant) of the standards committee, Mr Gwyn,
has the same opinion about C.

We were discussing (2007) about why doesn't C feature libraries for
lists, and other containers so that we would not need to rewrite them
for each new application.

Mr Gwyn wrote (in comp.std.c, Message id: <[email protected]>):

<quote>
The very age of C might be partly responsible, in that the vast
amount of existing C applications already embed some solutions
to the requirements for lists, etc. The maintenance programmer
(a)is unlikely to rework the existing app just to use some new
standardized interface for the same thing; and (b) has to
continue to maintain whatever libraries he has been using.

The only real use for such a library would be for new program
development, once the learning hurdle has been overcome. Much
new development really ought to use higher-level languages in
the first place.
<end quote>

New development should not be done in C.

This same person defended gets() and tried to avoid any change
to the standard to ban that function.
 
M

Mensanator

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 ?
Don't start learning programming with C.
The best professors of the world, teaching at MIT, start teaching
programming in their 6.001 course with scheme.

I thought I'd heard MIT had dropped scheme for their introductory
programming course?

Possibly because the MIT version of Scheme is a piece of junk?

The one time I used it, I got the impression of a student
project that received a D as a grade. If you insist on using
Scheme, avoid the MIT version.

Not recommended.
 
J

jameskuyper

jacob navia wrote:
....
Mr Gwyn wrote (in comp.std.c, Message id: <47052645.8AE ....
... Much
new development really ought to use higher-level languages in
the first place.
<end quote>

New development should not be done in C.

I know that English isn't your native language, so it might interest
you to know that "much" is not a synonym for "all". For instance, I
can say "much of the world's population lives outside of Asia",
without in any way implying that "all of the world's population lives
outside of Asia". Similarly, Mr. Gwyn's statement does not in any way
imply that "all new development really ought to use higher-level
languages".
 
M

Mensanator

Agreed. I have no objection to recommending appropriate
alternatives. But the OP concerned whether to /learn/ C.
And the trend of the responses appeared to be
communicating: don't do it. I felt compelled to protest.

I was taught BASIC in school at around 10 y/o, and it
just felt annoyingly clumsy, confusing and lacking power.
When I found Turbo Pascal on the 386 in the corner of the
computer room (otherwise dominated by Apple IIs), I took
it home over the space of a week, copying as much as my
one floppy disk would hold. Now I could write a text game
that would work like a Choose-Your-Own-Adventure book!
After about 2000 lines of functions full of print
statements with retyped input routines at the end of
each one, I gave up and devoted my afternoons to the
guitar.
Then, in college, some dude who lived down the hall
showed me a Korn Shell script to sort a text-file,
pull fields from each line with cut, and some other magic.
I signed up for Introduction to Computer Science CS120
the next semester. We learned C. I've never looked back.

I can't help but think that had I encountered C instead
of Pascal, I'd have almost 10 years more experience with
all this. The C language has a gravitas that more
beginner-friendly languages lack. Every difficulty
overcome increases ones knowledge about the implementation
issues that are intrinsic to what's actually going on
"under the hood".

Yes, it's a challenge, but the curious should be
encouraged even as they're being warned.

l-x-t

How bizarre.

I, too, went to Turbo Pascal from Apple ][ basic.

Only instead of writing an adventure game, I translated
a BASIC version to Pascal. The BASIC code was the biggest
mess I've ever seen. A nighmare of spaghetti code,
sub-routines where an error trap jumped away never to
return, logic code that always returned false due to
invalid math, etc.

It was simply impossible to replicate in Pascal. Pascal
forced correct code writing (and I made sure to avoid any
use of GOTO). It was amazing that the BASIC code worked
at all. In retrospect, I realized the BASIC code did not,
in fact, work correctly. But the errors were often too
subtle to notice easily.

It was the best educational experience in programming I
ever had. I am _so_ glad I didn't try Turbo C or I probably
_would_ have exactly duplicated the BASIC program.
 
P

Paul Hsieh

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 :-

I don't think C is a very good language for computer science students
except as an intermediate step to something like C++ or Java. Those
later languages are far better for implementing data structures.
1. Computer Organization and Architecture

Well, you should understand what memory, a disk, and input are. Also
what a central processing unit is and why your computer has one.
2. Assembly Language [ For good understanding of pointers ]

Unnecessary, but it is one path for learning C. Personally, I learned
it in the order of BASIC, 6502/6510 assembly, PDP-11 assembly,
Fortran, 8086 assembly, Pascal, Ada, 68000 assembly then C. As a
Pascal programmer, it took me about a week to pick up the basics of C,
because the languages are similar enough in nature. The real hump was
going from Basic to Pascal, but I think that was mostly because I was
simultaneously gaining (dynamic memory, data structures) and losing a
lot (unstructuredness, nice and simple system-specific libraries,
direct access to assembly and memory locations, etc) from that
transition.

A more sensible path these days is simply to pick up Python first,
then follow it up with any *NORMAL* programming language like C. You
should skip crazy languages like Lisp, scheme, Haskell, Erlang,
Prolog, etc as they are very different and have very little real world
utility. Also these days, there is basically no place that you can
use C where you cannot also use C++, which is simply a more expressive
(though more complicated) language with most of the same functional
characteristics as C.

So Python => C => C++ is a very effective and useful path for learning
programming languages. That triplet of languages also gives you the
most important aspects of all practical modern programming languages.

If you really want to learn assembly, I think it might be useful to
pick it up after you've got the basic's of C down pat. It will help
you understand how the C language and your machine truly functions,
but its optional, and many people get away with never learning it.

After getting to C++, you can branch off to Ruby or Java or some other
exotic modern language, or you can head off to Lua if you want to do
more embedded control programming and bring back the expressiveness of
Python to a C-like programming environment. After that, sky's the
limit.
 
K

Keith Thompson

Paul Hsieh said:
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 :-

I don't think C is a very good language for computer science students
except as an intermediate step to something like C++ or Java. Those
later languages are far better for implementing data structures. [snip]
So Python => C => C++ is a very effective and useful path for learning
programming languages. That triplet of languages also gives you the
most important aspects of all practical modern programming languages.
[snip]

(comp.lang.c readers: note that this thread is cross-posted to
comp.programming.)

I don't think I'd agree that learning C is a prerequisite to learning
C++ (though that's what I did). C++ nearly contains C as a subset,
but they're very different languages, and it's likely easier to learn
to write *good* C++ (at least high-level C++) without a lot of the
preconceived notions imposed by its C ancestry. See, for example,
Koenig & Moo's book "Accelerated C++", which starts by teaching the
STL; it doesn't introduce pointers until later on, and presents them
as a low-level kind of iterator.

Of course a good C++ programmer does need to understand the C-like
subset of C++, but it's not necessarily the best place to start.
 
P

Phlip

Default said:
The thread is cross-posted to comp.programming as well.

Ooops!

<Phlip hastens to adjust his opinion, knowing .c is in the house!>

Please disregard everything I said, folks! C is awesome! Really!!
 
P

Phil Carmody

Phlip said:
Including C++, which is _not_ C, and which should not be learned like C.

Disregard any C++ tutorial which starts with character arrays to hold
text.

I fully agree - burn Barney's /The C++ Programming Language, 3rd. ed./
for a start.

Phil
 
K

Kaz Kylheku

C is the wrong language for most tasks. Make sure you need C before
you learn C. As others point out, there are much better starting
points.

Someone who doesn't know C (or C++) has a gaping, puzzling hole in his
computing background which, I would say, casts a shadow over his credibility.

You don't need C only if you want to be a permanent hobbyist, and are not
looking for a career in software.
 
P

Pascal J. Bourguignon

Kaz Kylheku said:
Someone who doesn't know C (or C++) has a gaping, puzzling hole in his
computing background which, I would say, casts a shadow over his credibility.

You don't need C only if you want to be a permanent hobbyist, and are not
looking for a career in software.

If you had written some programs in assembler, you could skip C.

I would even go so far as saying that if you learned Modula-2, you could ignore C,
and if you learned Modula-3, you could ignore C++.

Unless, of course, you want to do kernel programming on unix systems.
 
P

Phil Carmody

Keith Thompson said:
Paul Hsieh said:
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 :-

I don't think C is a very good language for computer science students
except as an intermediate step to something like C++ or Java. Those
later languages are far better for implementing data structures. [snip]
So Python => C => C++ is a very effective and useful path for learning
programming languages. That triplet of languages also gives you the
most important aspects of all practical modern programming languages.
[snip]

(comp.lang.c readers: note that this thread is cross-posted to
comp.programming.)

I don't think I'd agree that learning C is a prerequisite to learning
C++ (though that's what I did). C++ nearly contains C as a subset,
but they're very different languages, and it's likely easier to learn
to write *good* C++ (at least high-level C++) without a lot of the
preconceived notions imposed by its C ancestry. See, for example,
Koenig & Moo's book "Accelerated C++", which starts by teaching the
STL; it doesn't introduce pointers until later on, and presents them

Erm, I see a pointer on the very first page with code on it?
Oh, yeah, it doesn't introduce them at all, it simply uses them
whilst pretending that it's not using them. The complete avoidance
of their mention only brings attention to them, at least to an
alert reader familiar with both languages. A painful read.
as a low-level kind of iterator.

From what I've read I think it's more likely that they treat them
as an embarassment.
Of course a good C++ programmer does need to understand the C-like
subset of C++, but it's not necessarily the best place to start.

In that case a good C++ programmer needs to either avoid Koenig & Moo,
or at least read a proper reference afterwards.

Phil
 
C

CBFalconer

luser-ex-troll said:
.... snip ...

I can't help but think that had I encountered C instead of Pascal,
I'd have almost 10 years more experience with all this. The C
language has a gravitas that more beginner-friendly languages
lack. Every difficulty overcome increases ones knowledge about the
implementation issues that are intrinsic to what's actually going
on "under the hood".

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

Ben Pfaff

I would even go so far as saying that if you learned Modula-2,
you could ignore C, and if you learned Modula-3, you could
ignore C++.

Unless you ever want to work with real-world software systems,
outside of sheltered environments.
 

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,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top