473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

To C or not to C, that is the question...

Hello everyone,

I'm using Linux since quite a while now and I'm happy to notice that I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.

However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd just
like to look under the hood of some Linux apps and perhaps write a little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.

The problem is, C doesn't look at all like the newbie-friendly "written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;) or
should I leave that to the computer science students and full-time Linux
hackers?

I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.

With best regards,
Rehceb
Apr 13 '07 #1
25 1743
On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,

I'm using Linux since quite a while now and I'm happy to notice that I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.

However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd just
like to look under the hood of some Linux apps and perhaps write a little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.

The problem is, C doesn't look at all like the newbie-friendly "written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;) or
should I leave that to the computer science students and full-time Linux
hackers?

I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).

It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.

By the way, you've come to the right place to ask questions.

Apr 13 '07 #2

"user923005" <dc*****@connx.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
>Hello everyone,

I'm using Linux since quite a while now and I'm happy to notice that I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.

However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd just
like to look under the hood of some Linux apps and perhaps write a little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.

The problem is, C doesn't look at all like the newbie-friendly "written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;) or
should I leave that to the computer science students and full-time Linux
hackers?

I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.

Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).

It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.

By the way, you've come to the right place to ask questions.
How has it been since you read it? Certainly more than one month.
Yes I mean to imply something.
Apr 13 '07 #3
On Apr 13, 12:39 pm, "Barry" <bar...@nullhighstream.netwrote:
"user923005" <dcor...@connx.comwrote in message

news:11**********************@d57g2000hsg.googlegr oups.com...


On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,
I'm using Linux since quite a while now and I'm happy to notice that I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.
However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd just
like to look under the hood of some Linux apps and perhaps write a little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.
The problem is, C doesn't look at all like the newbie-friendly "written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;) or
should I leave that to the computer science students and full-time Linux
hackers?
I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
By the way, you've come to the right place to ask questions.

How has it been since you read it?
It has not changed since I read it. I pick it up from time to time
(it's within arm's reach at my desk) and verify things.
Certainly more than one month.
I have read from in recently, if that is what you are implying. I
guess your first sentence was supposed to be "How long has it been
since you read it?"
If that is the case, it has been 20 years since I read it from cover
to cover. And yet if you master that simple book, less than 1/2 inch
thick, then you will definitely be an expert in the C language. In
fact, that is the main beauty of C. It is not something with
megabytes of features that takes years to learn.
Yes I mean to imply something.
I guess it will be better if you just come out and say it. Then we
can make fun of you and we'll all have a good belly-laugh.

Yes, I also meant to imply something.
Apr 13 '07 #4

"user923005" <dc*****@connx.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
On Apr 13, 12:39 pm, "Barry" <bar...@nullhighstream.netwrote:
>"user923005" <dcor...@connx.comwrote in message

news:11**********************@d57g2000hsg.googleg roups.com...


On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,
>I'm using Linux since quite a while now and I'm happy to notice that
I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.
>However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd
just
like to look under the hood of some Linux apps and perhaps write a
little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.
>The problem is, C doesn't look at all like the newbie-friendly
"written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;)
or
should I leave that to the computer science students and full-time
Linux
hackers?
>I would be glad if you could tell me about your own experiences with
C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
By the way, you've come to the right place to ask questions.

How has it been since you read it?

It has not changed since I read it. I pick it up from time to time
(it's within arm's reach at my desk) and verify things.
>Certainly more than one month.

I have read from in recently, if that is what you are implying. I
guess your first sentence was supposed to be "How long has it been
since you read it?"
If that is the case, it has been 20 years since I read it from cover
to cover. And yet if you master that simple book, less than 1/2 inch
thick, then you will definitely be an expert in the C language. In
fact, that is the main beauty of C. It is not something with
megabytes of features that takes years to learn.
>Yes I mean to imply something.

I guess it will be better if you just come out and say it. Then we
can make fun of you and we'll all have a good belly-laugh.

Yes, I also meant to imply something.

The next time you post something incorrect I will take the time
to correct it for you. I don't have a copy of K&R2, but I can
probably find a copy of K&R around here somewhere.

My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.

Barry
Apr 13 '07 #5
In article <13*************@corp.supernews.com>,
Barry <ba****@nullhighstream.netwrote:
>My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.
If the OP already has some skill in programming, a month of seriously
studying K&R2 will be more than enough to acquire a basic competence
with C.
Becoming an expert will take longer, but the OP seems to be interested
in acquiring basic competence, not becoming an expert.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
Basically, there is no control structure you can imagine that
can't be implemented using call/cc. Even very silly ones.
--Bear in comp.lang.scheme
Apr 13 '07 #6

"Dave Vandervies" <dj******@caffeine.csclub.uwaterloo.cawrote in message
news:ev**********@rumours.uwaterloo.ca...
In article <13*************@corp.supernews.com>,
Barry <ba****@nullhighstream.netwrote:
>>My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.

If the OP already has some skill in programming, a month of seriously
studying K&R2 will be more than enough to acquire a basic competence
with C.
Becoming an expert will take longer, but the OP seems to be interested
in acquiring basic competence, not becoming an expert.
dave
Perhaps you should reply to my question about arbitrary returns
in correct portbable C.
Apr 13 '07 #7
On Apr 13, 1:06 pm, "Barry" <bar...@nullhighstream.netwrote:
"user923005" <dcor...@connx.comwrote in message

news:11**********************@n59g2000hsh.googlegr oups.com...


On Apr 13, 12:39 pm, "Barry" <bar...@nullhighstream.netwrote:
"user923005" <dcor...@connx.comwrote in message
>news:11**********************@d57g2000hsg.googleg roups.com...
On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,
I'm using Linux since quite a while now and I'm happy to notice that
I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.
However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd
just
like to look under the hood of some Linux apps and perhaps write a
little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.
The problem is, C doesn't look at all like the newbie-friendly
"written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;)
or
should I leave that to the computer science students and full-time
Linux
hackers?
I would be glad if you could tell me about your own experiences with
C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
By the way, you've come to the right place to ask questions.
How has it been since you read it?
It has not changed since I read it. I pick it up from time to time
(it's within arm's reach at my desk) and verify things.
Certainly more than one month.
I have read from in recently, if that is what you are implying. I
guess your first sentence was supposed to be "How long has it been
since you read it?"
If that is the case, it has been 20 years since I read it from cover
to cover. And yet if you master that simple book, less than 1/2 inch
thick, then you will definitely be an expert in the C language. In
fact, that is the main beauty of C. It is not something with
megabytes of features that takes years to learn.
Yes I mean to imply something.
I guess it will be better if you just come out and say it. Then we
can make fun of you and we'll all have a good belly-laugh.
Yes, I also meant to imply something.

The next time you post something incorrect I will take the time
to correct it for you.
Believe it or not, I will deeply appreciate it.
I don't have a copy of K&R2, but I can
probably find a copy of K&R around here somewhere.

My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month.
In one month of intense effort, I believe that the OP could not only
become an adequate C programmer, but even be good enough for junior
level work on C projects. That is the main beauty of the C language.
The same thing cannot be said for C++ or .NET languages or even SQL.
The real excellence of C is its simplicity. That is one reason that I
really like it.
I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.
No need to apologize. My opinion is no better than yours.

Apr 13 '07 #8
On Apr 13, 1:29 pm, "Barry" <bar...@nullhighstream.netwrote:
"Dave Vandervies" <dj3va...@caffeine.csclub.uwaterloo.cawrote in message
[snip]
Perhaps you should reply to my question about arbitrary returns
in correct portbable C.
No poster is obligated to post replies in a subject for which he/she
lacks interest in responding. Structural arguments tend to foment
religious fervor (e.g. what about goto, what about multiple returns).

Let me say something about multiple returns:
1. They're bad.
2. I use them.

They are bad because they can cause a lot of problems, especially if
the routine is allocating resources like memory or file handles or
things of that nature. On the other hand, I often do a big heap of
tests right at function entry to see if things are in order. If (for
instance) your file name is NULL or the length of some string is -7 or
some other naughty-no-no I am liable to return right away, after
handling the error (if possible). And so I do not object to this
particular format:

<typesome_func(param_list,...)
{
/* do a heap of parameter checks... */
if (something_is_seriously_haywire)
{
handle_error();
return FOO_STATUS_FAILURE; /* Or *status = FOO_STATUS_FAILURE or
whatever... */
}

/* One hundred or more lines of important glop go here... */

return FOO_STATUS_SUCCESS;
}

Every rule is meant to be broken except one:
Use good sense when you write your program and always do the right
thing.

Apr 13 '07 #9
"Barry" <ba****@nullhighstream.netwrites:
[...]
>>"user923005" <dcor...@connx.comwrote in message
[...]
>Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).

It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
[...]
My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.
I have to agree with Barry. Working your way through K&R2 will give
you a good basic working knowledge of C, but it will hardly make you
an expert. That takes practice and experience.

But it's a good first step on the road to becoming an expert,
especially if you already have some programming experience.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 13 '07 #10
"Barry" <ba****@nullhighstream.netwrites:
[...]
Perhaps you should reply to my question about arbitrary returns
in correct portbable C.
It would help if you could explain just what you're trying to
accomplish.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 13 '07 #11
Barry wrote:
"user923005" <dc*****@connx.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
>On Apr 13, 12:39 pm, "Barry" <bar...@nullhighstream.netwrote:
>>"user923005" <dcor...@connx.comwrote in message

news:11**********************@d57g2000hsg.google groups.com...

On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,
I'm using Linux since quite a while now and I'm happy to notice that
I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.
However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd
just
like to look under the hood of some Linux apps and perhaps write a
little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.
The problem is, C doesn't look at all like the newbie-friendly
"written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;)
or
should I leave that to the computer science students and full-time
Linux
hackers?
I would be glad if you could tell me about your own experiences with
C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
By the way, you've come to the right place to ask questions.
How has it been since you read it?
It has not changed since I read it. I pick it up from time to time
(it's within arm's reach at my desk) and verify things.
>>Certainly more than one month.
I have read from in recently, if that is what you are implying. I
guess your first sentence was supposed to be "How long has it been
since you read it?"
If that is the case, it has been 20 years since I read it from cover
to cover. And yet if you master that simple book, less than 1/2 inch
thick, then you will definitely be an expert in the C language. In
fact, that is the main beauty of C. It is not something with
megabytes of features that takes years to learn.
>>Yes I mean to imply something.
I guess it will be better if you just come out and say it. Then we
can make fun of you and we'll all have a good belly-laugh.

Yes, I also meant to imply something.
The next time you post something incorrect I will take the time
to correct it for you. I don't have a copy of K&R2, but I can
probably find a copy of K&R around here somewhere.

My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.
Let's review the original reply, shall we?

"In about one month you can learn enough to become a C programmer with
nothing to be ashamed of (if you apply yourself)."

In terms of adequate understanding to poke around in non-kernel stuff on
Linux, I have to agree that one month will certainly give you enough
traction to get somewhere useful.

Especially since he then went on to say:

"By the way, you've come to the right place to ask questions."

I read this to mean that you will get further in your education if you
read, practice and ask questions about what you discover and don't
understand. A good place to ask such questions is this very forum.

If you already have the basics of programming, and can already wrap your
head around variables, logic and flow constructs, then C isn't much of a
stretch. It's just easier to make mistakes that crash and burn. Some
see this as a Good Thing in a learning language.

"A month (or so) to learn. A lifetime to master."
Apr 13 '07 #12

"user923005" <dc*****@connx.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
On Apr 13, 1:06 pm, "Barry" <bar...@nullhighstream.netwrote:
>"user923005" <dcor...@connx.comwrote in message

news:11**********************@n59g2000hsh.googleg roups.com...


On Apr 13, 12:39 pm, "Barry" <bar...@nullhighstream.netwrote:
"user923005" <dcor...@connx.comwrote in message
>>news:11**********************@d57g2000hsg.google groups.com...
On Apr 13, 10:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,
>I'm using Linux since quite a while now and I'm happy to notice
that
I'm
beginning to "know my way round". I can write little bash, sed and
awk
scripts to help me with my everyday tasks and I've also had a
thorough
look at Python, which is ideally suited for helping me with my
work,
which is linguistic research, i.e. mainly text processing.
>However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to
be
written in C. I do not want to write revolutionary new programs,
I'd
just
like to look under the hood of some Linux apps and perhaps write a
little
patch here and there to adapt them for my purposes and, in this
way,
maybe even contribute back to the Open Source community one day.
>The problem is, C doesn't look at all like the newbie-friendly
"written
pseudo-code" walk-in-the-park that is Python! Variable
declarations,
pointers, memory allocations... I'm scared! My main concern is: Is
it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM!
;)
or
should I leave that to the computer science students and full-time
Linux
hackers?
>I would be glad if you could tell me about your own experiences
with
C --
and whether I should or shouldn't learn it from your point
of view.
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you
can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.
By the way, you've come to the right place to ask questions.
>How has it been since you read it?
It has not changed since I read it. I pick it up from time to time
(it's within arm's reach at my desk) and verify things.
>Certainly more than one month.
I have read from in recently, if that is what you are implying. I
guess your first sentence was supposed to be "How long has it been
since you read it?"
If that is the case, it has been 20 years since I read it from cover
to cover. And yet if you master that simple book, less than 1/2 inch
thick, then you will definitely be an expert in the C language. In
fact, that is the main beauty of C. It is not something with
megabytes of features that takes years to learn.
>Yes I mean to imply something.
I guess it will be better if you just come out and say it. Then we
can make fun of you and we'll all have a good belly-laugh.
Yes, I also meant to imply something.

The next time you post something incorrect I will take the time
to correct it for you.

Believe it or not, I will deeply appreciate it.
>I don't have a copy of K&R2, but I can
probably find a copy of K&R around here somewhere.

My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month.

In one month of intense effort, I believe that the OP could not only
become an adequate C programmer, but even be good enough for junior
level work on C projects. That is the main beauty of the C language.
The same thing cannot be said for C++ or .NET languages or even SQL.
The real excellence of C is its simplicity. That is one reason that I
really like it.
>I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.

No need to apologize. My opinion is no better than yours.
Unlike you (I expect), I started my career writing assembly language
device drivers. When someone found the time to write a C compiler
for the devices I was using they (the devices) were nearly obsolete.
But I have been bitten more than once for writing sloppy C, and that
is the type of thing you don't learn from a month of reading K&R2.

Mr. Heathfield will certainly agree that he didn't learn C in a month.
I have never seen his book, but I do read his comments.
He recently posted a note about the knowledgeable posters on
c.l.c, and if you watch the comments from that list of folks
you will find it wasn't by accident.

Like I said, if I am wrong...it won't be the first time. Millions
of people use code I wrote in C every day. Since it "works"
only I know how poorly it was designed and written.

Barry
Apr 13 '07 #13

"Keith Thompson" <ks***@mib.orgwrote in message
news:ln************@nuthaus.mib.org...
"Barry" <ba****@nullhighstream.netwrites:
[...]
>Perhaps you should reply to my question about arbitrary returns
in correct portbable C.

It would help if you could explain just what you're trying to
accomplish.
I made the mistake of referring to a previous note and did not
include the proper context. I apologize.

Barry
Apr 13 '07 #14
In article <13*************@corp.supernews.com>,
Barry <ba****@nullhighstream.netwrote:
>Perhaps you should reply to my question about arbitrary returns
in correct portbable C.
Perhaps if you want useful answers you should read the ones you've
already gotten, and explain what's wrong with them in a way that lets
people establish that it's worth giving you another one.

You won't be getting any more from me, though.
**PLONK**
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
The inability of Microsoft to produce a C99 compiler is not a good reason
not to embrace the current C standard. (There may well /be/ good reasons,
but that isn't one of them.) --Richard Heathfield in comp.lang.c
Apr 13 '07 #15

"Dave Vandervies" <dj******@caffeine.csclub.uwaterloo.cawrote in message
news:ev**********@rumours.uwaterloo.ca...
In article <13*************@corp.supernews.com>,
Barry <ba****@nullhighstream.netwrote:
>>Perhaps you should reply to my question about arbitrary returns
in correct portbable C.

Perhaps if you want useful answers you should read the ones you've
already gotten, and explain what's wrong with them in a way that lets
people establish that it's worth giving you another one.

You won't be getting any more from me, though.
**PLONK**

I think you missed my point. I didn't want to see you make anymore
stupid posts to c.l.c. Hopefully it worked.
Apr 13 '07 #16
On Apr 13, 1:55 pm, Keith Thompson <k...@mib.orgwrote:
"Barry" <bar...@nullhighstream.netwrites:

[...]>>"user923005" <dcor...@connx.comwrote in message
[...]
Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.

[...]
My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.

I have to agree with Barry. Working your way through K&R2 will give
you a good basic working knowledge of C, but it will hardly make you
an expert. That takes practice and experience.
Here is what the OP asked:
"My main concern is: Is it even feasible for me to learn enough C for
the above purposes in my restricted spare time (which would be pretty
much 8 PM till 8 AM! ;) or should I leave that to the computer science
students and full-time Linux hackers?"

In what way is guru status implied here?
But it's a good first step on the road to becoming an expert,
especially if you already have some programming experience.
For someone who can already write code in Python, I guess that after
one month of intense effort learning the language, he could contribute
to open source projects at some level.

As evidence, I would say to examine the excellent progress of 'arnuld'
who is clearly going over K&R2 carefully. Now, Arnuld has been at it
for about two months, but C is also his first programming language.
For someone in that situation, I think K&R2 is probably not the ideal
choice because of its terseness. Maybe K. N. King's book or is easier
in that case.

At any rate, I think that someone who is already a programmer can
become adequate in C in one month to the level that they can
contribute to an open source project.

IMO-YMMV.

Obviously, it depends on the intelligence and motivation of the
student, but typically people who want to become programmers are
intelligent and motivated.

Apr 13 '07 #17
On Apr 13, 11:39 pm, "Barry" <bar...@nullhighstream.netwrote:
"Dave Vandervies" <dj3va...@caffeine.csclub.uwaterloo.cawrote in message

news:ev**********@rumours.uwaterloo.ca...In article <131vq11j9cn9...@corp.supernews.com>,
Barry <bar...@nullhighstream.netwrote:
>Perhaps you should reply to my question about arbitrary returns
in correct portbable C.
Perhaps if you want useful answers you should read the ones you've
already gotten, and explain what's wrong with them in a way that lets
people establish that it's worth giving you another one.
You won't be getting any more from me, though.
**PLONK**

I think you missed my point. I didn't want to see you make anymore
stupid posts to c.l.c. Hopefully it worked.
This way I won't see _your_ stupid posts here anymore
**PLONK**

Apr 13 '07 #18
Barry wrote:
>
Unlike you (I expect), I started my career writing assembly language
device drivers. When someone found the time to write a C compiler
for the devices I was using they (the devices) were nearly obsolete.
But I have been bitten more than once for writing sloppy C, and that
is the type of thing you don't learn from a month of reading K&R2.
Did you have to quote the entire thread just to say that?

A crap programmer could spend years studying a language and still write
crap code. A competent one should have no problem getting up and
running in C in a month.

--
Ian Collins.
Apr 13 '07 #19
"user923005" <dc*****@connx.comwrites:
On Apr 13, 1:55 pm, Keith Thompson <k...@mib.orgwrote:
>"Barry" <bar...@nullhighstream.netwrites:

[...]>>"user923005" <dcor...@connx.comwrote in message
[...]
>Buy or borrow a copy of
"The C Programming Language"
by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).
>It's 272 pages long, including the index. In about one month you can
learn enough to become a C programmer with nothing to be ashamed of
(if you apply yourself). I don't think C is more difficult than
Python so if you became comfortable in Python you will be able to do
the same thing with C.

[...]
My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.

I have to agree with Barry. Working your way through K&R2 will give
you a good basic working knowledge of C, but it will hardly make you
an expert. That takes practice and experience.

Here is what the OP asked:
"My main concern is: Is it even feasible for me to learn enough C for
the above purposes in my restricted spare time (which would be pretty
much 8 PM till 8 AM! ;) or should I leave that to the computer science
students and full-time Linux hackers?"

In what way is guru status implied here?
[...]

Sorry, I inadvertently snipped the paragraph to which I was actually
reacting.

Upthread, you (user923005) wrote:
| If that is the case, it has been 20 years since I read it from cover
| to cover. And yet if you master that simple book, less than 1/2 inch
| thick, then you will definitely be an expert in the C language. In
| fact, that is the main beauty of C. It is not something with
| megabytes of features that takes years to learn.

I took issue with your use of the word "expert". Apart from that,
we're probably pretty much in agreement.

Perhaps by "master that simple book" you were referring to something
that would take more than a month?

You can certainly become a reasonably decent C programmer given
personal potential, a copy of K&R2, and a month or so of work.
Becoming an expert requires more experience.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Apr 13 '07 #20
On Apr 14, 1:56 am, Rehceb Rotkiv <reh...@no.spam.plzwrote:
Hello everyone,

I'm using Linux since quite a while now and I'm happy to notice that I'm
beginning to "know my way round". I can write little bash, sed and awk
scripts to help me with my everyday tasks and I've also had a thorough
look at Python, which is ideally suited for helping me with my work,
which is linguistic research, i.e. mainly text processing.

However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. I do not want to write revolutionary new programs, I'd just
like to look under the hood of some Linux apps and perhaps write a little
patch here and there to adapt them for my purposes and, in this way,
maybe even contribute back to the Open Source community one day.

The problem is, C doesn't look at all like the newbie-friendly "written
pseudo-code" walk-in-the-park that is Python! Variable declarations,
pointers, memory allocations... I'm scared! My main concern is: Is it
even feasible for me to learn enough C for the above purposes in my
restricted spare time (which would be pretty much 8 PM till 8 AM! ;) or
should I leave that to the computer science students and full-time Linux
hackers?

I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.
I learned C because I wanted to know how to do stuff systems
programmers do.
Much like why one is intrigued by the understanding of how things work
and be
able to create stuff. The thing about C is that it provides high
level language
features so that you are less error prone while at the same time be
able to touch
the guts of the machine and do something with it.

Cheers.

Napi

Apr 14 '07 #21
Thanks very much for your tips! As most of you recommended, I'll get K&R
and see where I can get with it.

Rehceb
Apr 14 '07 #22

"Barry" <ba****@nullhighstream.netwrote in message
news:13*************@corp.supernews.com...
>
My comment was not about the quality of K&R2, but your
statement that someone could be an adequate C programmer
in a month. I am sure we will get some comments from other
folks, and I expect them to agree with me. If I am wrong I
apologize up front.
There is guy on comp.lang.c lisp who claimed to have one day's experience
and was posting perfectly adequate lisp code with lambda functions and the
like.
I've recently learnt lisp. Whilst it only took a few minutes to "get it", to
actually use it took several days, partly because I had to set up the
environment myself, partly because it is just so difficult for an
imperative-type person like me to rewrite everything as recursive calls. I
still haven't done anything useful with it, so I would still classify myself
as in the learning stage.

This poster was working in a financial institution. He seemed to have some
job involving share dealing. Those jobs tend to be very lucrative and
attract extremely able people. I can believe he was telling the truth.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Apr 14 '07 #23
On 13 Apr, 19:56, Rehceb Rotkiv <reh...@no.spam.plzwrote:
[...] linguistic research, i.e. mainly text processing [...]
I started working in Python during a final thesis - I worked with
databases, regular expressions and so on. If that is what you want
than I'd recommend you to stick to Python since it is awesome for
processing text - I am learning C more and more because it's closer to
where all the action is (pointers to memory and stuff) but I find it
in no way as user friendly as Python is.

ALSO: I work a lot in .NET (C#) (that is available on all systems
thanks to the MONO project). I have made some small, silly
applications that integrates the console and the windows trash-can for
example (it takes about 3-7 lines of code to send a file to the
trashcan in C#). I recently started wondering if that is possible to
do the same things in C. It most likely is but I have no idea of where
to start looking for the code/packages/etc to integrate C and the
trashcan.

[...] However, this does not seem to be of much use in understanding and
modifying source code of Linux applications, 90% of which seem to be
written in C. [...]

Indeed - to me this is really interesting stuff - I have looked at
some source code to f.x. grep, I have looked at it for two minutes and
hardly understand anything. Still: this interests me and I am
determine to learn more about it. So I recently bought "Linux
Programming For Dummies" http://www.dummies.com/WileyCDA/Dumm...764506919.html
- I have not read it yet but I hope it'll give me a crash course to
stuff I want to know.

[...] or
should I leave that to the computer science students and full-time Linux
hackers? [...]

I do not consider myself a code guru but I enjoy C. It's a little like
learning latin before learning french. I see C as the mother of all
languages - and if you know how pointers work in C you will understand
Python better. In case you didn't know it: Python is written in C and
that has to mean C is good, right?

I would be glad if you could tell me about your own experiences with C --
and whether I should or shouldn't learn it from your point
of view.

I'd say: do your research in Python - that way you will save a lot of
time, at least initially. But learn C to understand the core of
Python, Linux, etc.

Also: the Python community (at least the python-usenet list) is as I
see it a more friendly place than the C community (at least compared
to this list). Here you can get hanged for top-posting. On the Python
list (most) people are friendly.

HTH,

Per
[:)]-|--<

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/

Apr 16 '07 #24
On Fri, 13 Apr 2007 12:56:19 -0500, Rehceb Rotkiv wrote:
I would be glad if you could tell me about your own experiences with C
-- and whether I should or shouldn't learn it from your point of view.
Gnome now has/accept Python software as part of their "official"
components.

C is still very useful to know though.

--
Lars Rune Nøstdal
http://nostdal.org/
Apr 16 '07 #25
On 13 Apr, 19:56, Rehceb Rotkiv <reh...@no.spam.plzwrote:

<snip>
I also bought C All-in-One Desk Reference For Dummies
http://www.dummies.com/WileyCDA/Dumm...764570692.html
and that one I *have* read - it's friendly way of getting to know a
little more about C. But not a complete way - it lacks a lot of topics
(f.x. call-backs).

Also like most (American ?) litterature it's talky (you might want a
book with more code and less talk).

/Per

--

Per Erik Strandberg
..NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/

Apr 16 '07 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.