learning C

Werner Schiendl ws-news at gmx.at
Wed Mar 7 09:31:11 EST 2001


Hi,

Laura Creighton <lac at cd.chalmers.se> wrote in message
news:mailman.983972829.23481.python-list at python.org...
> Greetings from Sweden:
>
> I think that objecting to using C because pointers and strings are hard
> is akin to objecting to using a scalpel because it is sharp and you
> can cut yourself.

Really? Is it that obviously off sense?

Do you give your children a scalpel to cut paper? Probably not.
But in surgery there is a need for it.

The fine thing is: C++ still HAS the scalpel, so what?

>  Now if the original poster had said, `Look, I have
> never written anything but Python before, but I have to write some
> application in C or C++, and I don't have any time or inclination
> to actually learn the language much, what should I do?' then I would
> be in utter agreement with you.  Don't learn C unless you really
> want to.  It is hard to be a good C programmer.  It requires discipline
> which the language will not give you, which you must bring to the
> experience yourself.  It helps if you know a really good C programmer
> who will say things like ``no, you cannot put that nauseous piece of slime
> into our nice clean v7 kernel'' which will give you real incentive to
learn
> how to have that discipline.  The world is full of *bad* C programmers,
> though, so finding such a person is hard, especially if you are new
> enough that you do not know the difference between good and bad C code.

Maybe I interpreted the original post somewhat too much.
I actually thought the person was intending to use C to add some
functionality to Python.
Which in fact means to me he does not want to know about every hole in the
road but get it running quickly.

If this was wrong, sorry for my ignorance.

> It was easier in the days when we all just wanted to code like
> Ken Thompson. The person who suggested reading v7 source actually had
> good advice, if only you could get a v7 kernel and a pdp-11 to run it on.

If one is interested in archeology, this is probably really interesting
stuff.
I admit thsat sometime I start some old-system simulator on my own.

But to get productive, I try to use up to date technology.

Maybe you appreciate your silent, quick page printer more if you had a 9
needle piece for years.
But the outcome will stay the same, nice printouts.

> I assumed the original poster wanted to become a good C code writer, or at
> least a good C code reader.  You tell him to learn C++ instead, as if
learning
> C is obselete.

If it is not obsolete, it should be at least considered deprecated for new
projects.

The thing is, you get C for free a much better programming habits I think if
you start out with objects rather than a bunch of unrelated functions (as
long as syntax is concerned, in your mind they will of course have some
relation, but mind tends to fade after a - usually very short - period of
doing sth else) and data pieces.

I compare that to learning to drive. You do not need how your injection
system works _exactly_ and how the wires are mounted and things like that.
You only need to know that if you are really getting a freak in cars... Or
if you make repairing cars your business.
In former days, you had your car engineer with you because it was necessary
to have so. Like one had to use Assembly language and C in former days.
Today you visit your garage every some month to check the thing up - and you
only need Assembly and plain C seldom.

>
> But then you also say that there are no good and bad languages.  Are you
sure
> that you are on the correct mailing list?  The on-going debate about the
new
> string syntax is all about whether or not it is ``good''.  Does it make
> Python *good*? or *bad*?   Important stuff.
>

Well I think that one can learn quite a lot by monitoring what problems
other ones encounter and how they are solved.
This is the main reason why I'm in this list right now.

Hope I can contribute more helpful posts in some time.

If I would not consider Python an interesting language I would not be here.
But I would not choose it to write a windows kernel driver right now.
(I would take C++)


just my opinions

regards
werner





More information about the Python-list mailing list