Re: How to solve for smallest and largest int?
From: James Rogers (jimmaureenrogers_at_att.net)
Date: 03/27/04
- Next message: pablito: "Re: Why outsourcing is good - my personal experience."
- Previous message: Mensanator: "Re: how to attract grades 7-10 to Computer Science?"
- In reply to: Bruce: "Re: How to solve for smallest and largest int?"
- Next in thread: Richard Heathfield: "Re: How to solve for smallest and largest int?"
- Reply: Richard Heathfield: "Re: How to solve for smallest and largest int?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Mar 2004 06:06:35 GMT
bruce@nospam.com (Bruce) wrote in
news:40650bdf.2027605@news.dallas.sbcglobal.net:
> In comp.programming
> James Rogers <jimmaureenrogers@att.net> wrote:
>
>>bruce@nospam.com (Bruce) wrote in
>>news:4063dc24.12792694@news.dallas.sbcglobal.net:
>>
>>> Pardon me for saying this but if you can't generate this algorithm on
>>> your own, you have NO business trying to learn a language like ADA.
>>> Why don't you try BASIC or C first.
>>>
>>
>>I am confused by your logic. What makes Basic or C more appropriate for
>>the algorithm impared than Ada?
>
> Jim,
>
> I see why you're confused. You have a difficult time conprehending
> English. BASIC or C are more appropriate for HIM, not the algorithm.
I comprehend English quite well. You stated that a person who cannot
generate a simple algorithm has no business trying to learn Ada. You
then recommended Basic or C as a first language.
Your statement is clear. You say that Basic and C are more suited for
a person who cannot generate a simple algorithm. Do you really believe
that algorithms are less important in Basic or C than in Ada?
My suspicion is that you believe Basic and C are easier to learn than
Ada. That may be true or it may not be true. Basic was clearly
initially designed to be a first language. After several years of using
Basic as a first language it was also clear that many people learned a
lot of bad programming practices using Basic. Early versions of Basic
had only very limited looping structures and only very primitive
approximations of functions. Early Basic programmers used GOTO very
heavily. Early versions of Basic required explicit line numbers for
every line. Branches and GOTO statements were directed at hard-coded
line numbers, making software maintenance very messy.
Algorithms interact with data structures to produce programs.
Problem complexity can be concentrated in data structures, simplifying
algorithms, or placed in algorithms, simplifying data structures.
Early versions of Basic were extremely limited in their ability to
support complex data structures. The result was more complex
algorithms using Basic than needed when using more modern languages.
C provides a number of syntax structures that were advanced compared
to Basic in the 1970's. C also provides the ability to define your
own data structures. Learning C properly requires a person to learn
at least two languages. One is the C language syntax. The other is
the pre-processor syntax. C has been used for almost every kind of
programming task known to humans. The language is designed to stay
out of the way of the programmer. The C language was designed with
a basic assumption that the language should not inhibit the
programmer. The programmer knows what he or she is doing at all
times. "Good" C programmers are assumed to either make no errors
or find all the errors they create.
C does not exactly promote bad programming. It simply enables such
programming. Another way to say this is that C does nothing to
inhibit bad programming. Obfuscation is a traditional sin of C
programmers. There is often an implicit assumption that
obfuscation leads to faster programs. This assumption is not
usually true.
Many parts of C are easy to learn. What to avoid, and under
which circumstances, takes a lot more time and effort. I have
taught C to many students. The most difficult part of C for new
programmers is pointers and their relationship to arrays. Pointer
syntax in C is also very confusing for beginning programmers.
Any experienced C programmer can decipher C pointer syntax.
New students, on the other hand, have a hard time evaluating
the following syntax:
float (*(*f) ()) ();
I do not believe a person struggling with algorithms will find
comfort with the example above, or understanding where it
could be usefully employed.
C is a much smaller language than Ada, when counting reserved
words. That fact does not make it more appropriate for use as
a first programming language. The "simple" C language results
in some very nasty syntax (again, see example above). C also
has some surprising (for the beginning programmer) undefined
behaviors. For instance, the following expression is valid
C syntax, yet yields undefined results:
int c = 10;
c += c++;
None of these C problems is also an Ada problem.
Returining to the beginning of this message, I do not see a
clear justification for claiming that Basic or C are more
suited for a person that cannot generate a simple algorithm.
Jim Rogers
- Next message: pablito: "Re: Why outsourcing is good - my personal experience."
- Previous message: Mensanator: "Re: how to attract grades 7-10 to Computer Science?"
- In reply to: Bruce: "Re: How to solve for smallest and largest int?"
- Next in thread: Richard Heathfield: "Re: How to solve for smallest and largest int?"
- Reply: Richard Heathfield: "Re: How to solve for smallest and largest int?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]