Re: Is PERL good for a linguist new to programming?



p.podmostko@xxxxxxxxxxxxxx wrote in
news:3fe30943-ea67-48eb-98ed-1c52f97a3f3f@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

On May 25, 5:06 pm, "Uri Guttman" <u...@xxxxxxxxxxxxxxx> wrote:
"pp" == p podmostko <p.podmos...@xxxxxxxxxxxxxx> writes:

  pp> Right now for example im racking my brains how to sort several
pp> words alphabetically using only if, for, else, and several
pp> variables.
....

that is a classic part of the knowledge scaling i mentioned. sorting
is one of the core areas taught in every algorithm class. i won't
give you a fish but you want to learn the bubble sort. it is the
easiest sort to code up but one of the slowest to run. but the speed
doesn't matter for short data sets and it is very educational to know
how to code it up and learning WHY it is slow.

....

Im aware of something like "sort" but i just a wanted to make it a
challenge to myself and use only the resources that i know at this
stage :)

Exactly. That is why Uri recommended you try to implement the Bubble
Sort algorithm. It is easy to implement (it was a demo that came with my
ZX Spectrum 48K back in 1982 ... written in Basic and read from cassette
tape -- In fact, after almost 20 years of continuous beeping first from
cassettes then from modems whenever I tried to do something useful, I
find the quiet that comes with today's internet access quite
disturbing). OK, that was not relevant but neither is drumming ;-)

Do you guys write out algorithms very often before sitting down to
programming?

No. I steal other people's algorithms.

Now, if you were asking about thinking about what to write, how to
organize it, how things fit together etc, yes, always. All the time.
Every time.

Sinan

--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
.