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

"pp" == p podmostko <p.podmostko@xxxxxxxxxxxxxx> writes:

pp> On May 25, 5:06 pm, "Uri Guttman" <u...@xxxxxxxxxxxxxxx> wrote:
>> 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.

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

but sort uses a particular algorithm, one of many that exist to do
sorting. some are specialized for certain data sets, some are general
purpose but have different degenerative cases (i.e. they can get very
slow with certain data sets). as i said sorting is a very core part of

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

you don't write out algorithm. they are a specific way to solve a
specific problem in a theoritical way. you still have to implement the
algorithm in a programming language and that can be easy or hard
depending on many factors including the complexity of the algorithm and
the skill of the coder. and you can code it up well or very crappy
too. a good coding of a bad algorithm can be better than a bad coding of
a good algorithm.

a good coder knows many fundamental algorithms or how to use modules
that implement them. i don't write out sort coding directly
anymore. instead i use perl's sort function but even that can be used in
better or worse ways. so understanding the concepts of sorting is important
to using it effectively and efficiently even if you don't directly code
the sorting yourself. this is why knowing basic algorithm theory is
important to any coder who wants to be a professional. and it is why so
many kiddies out there think they code well but don't since they have no


Uri Guttman ------ uri@xxxxxxxxxxxxxxx -------- --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- ---------
--------- Gourmet Hot Cocoa Mix ---- ---------

Relevant Pages

  • Re: allowing my AI to dynamically change its own structure
    ... the only kind of sort you knew about. ... If you have a program with a goal of sorting lists of numbers, ... algorithm, ... from the very low level model you seem to prefer? ...
  • Re: Sorting algorithm when comparison is heavy
    ... optimal way of sorting such elements (in other words, ... I would consider some good sort algorithm like quicksort together ... You suggest using pointers, so I think the above applies. ...
  • Re: sort on more than one key?
    ... I can sort on one key no problem.But what ... > sorting on more than one key, for example by last name then by first name. ... unstable) and in the compare function code the following for any pair ... key using a stable algorithm such as a nice "bubble" sort ...
  • Re: attempt at qsort implementation
    ... qsortis not required to implement any particular sort algorithm. ... It's just supposed to sort. ... out of order by sorting them and returning the first one. ... A recursive bogosort uses bogosort to sort the possible orders by ...
  • Re: The ultimate luxury ?
    ... This is not sorting. ... My definition in terms of imposing a linear order on a set is abstract ... and corresponds not to the algorithm of sorting, ...