Re: Learning C Programming

Subject: Re: Learning C Programming
From: Linda Sherman <linsherm -at- GTE -dot- NET>
Date: Fri, 4 Dec 1998 21:18:38 -0500

Walker, Arlen P wrote:
>
> If you want to start with C, go ahead. Just get a good compiler and listen
> to it. Turn on every possible warning and don't test run the program until
> you've cleared every warning flag, or at least understand each and every
> warning flag it gives you and are certain there are none left of any
> importance. All the common mistakes should be flagged with warnings or
> errors by competent compilers.

This is incorrect. Compilers and lint-checkers (which only C
needs--Pascal doesn't) only catch syntactical errors and ambiguities.
They don't catch logic bugs. For example, in C, a lint-checker will
catch "if(a=b)", which is a perfectly legal syntax, and ask if you
really meant "if(a==b)", which you probably did. That's a syntactical
ambiguity (unique to C--Pascal doesn't give you these fits). But if you
coded "if(a!=b)" instead of "if(a==b)", no compiler in the world will
catch it, because it's a logic error.

> The basic difference between Pascal and C is that C makes the assumption
> that you know what you're doing, while Pascal assumes you're completely
> ignorant.

This is also incorrect, but it's a common prejudice among C programmers.

A more accurate statement would be that Pascal does some of the work for
you, taking care of some details (like memory allocation) that a C
programmer must handle explicitly. In most applications, especially ones
a beginner is likely to write, there is no reason not to let the
compiler handle these matters.

Pascal has been used for some extremely sophisticated applications. For
example, most of operating system of the Macintosh and much of Windows
was originally written in Pascal.

> Almost no
> one outside of academia uses Pascal, while C shows up almost everywhere.

C is more commonly used, but it's not accurate to say that Pascal is not
used outside academia. Borland has sold a lot of copies of Delphi and,
before that, Turbo Pascal. A lot of commercial software for both Windows
and Mac has been and continues to be written in Pascal.

In any case, it's not an either-or situation. Learning one doesn't
preclude you from learning the other. And as I said, it's an easy
jump--a VERY easy jump--from Pascal to C. The languages are so similar
that Borland's C++ compiler can handle both! I still maintain however,
that most beginners will learn faster and with fewer frustrations if
they start with Pascal. And I think most C programmers who don't have an
attitude problem will agree.

I am a C/C++ programmer, by the way. I've probably written 1000 lines of
code in C or C++ for every one I've ever written in Pascal. Precisely
because I've written so much C/C++, I have no illusions about it.

Lin
--
Linda K. Sherman <linsherm -at- gte -dot- net>
Freelance Writer: Technical - Business - Government


From ??? -at- ??? Sun Jan 00 00:00:00 0000=



Previous by Author: Re: Alternative to Front Page?
Next by Author: Re: Alternative to Front Page?
Previous by Thread: Re: Learning C Programming
Next by Thread: Re: Learning C Programming


What this post helpful? Share it with friends and colleagues:


Sponsored Ads