Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: Perl Internals: Hashes

by kvale (Monsignor)
on Apr 14, 2004 at 23:11 UTC ( #345245=note: print w/replies, xml ) Need Help??

in reply to Re: Perl Internals: Hashes
in thread Perl Internals: Hashes

C? Bah!, that's making it too easy. Write algorithms in MIX, the way God and Knuth intended it!

More seriously, perl is an excellent language for learning algorithms. One can get to the crux of the algorithm without fussing with memory management and other low-level irritations. The resulting simpler, cleaner code allows one to see what is going on. And the elimination of a separate compile step allows one to play with code in a more exploratory, interactive fashion. The book Mastering Algorithms with Perl is a fine example of how fun and easy learning algorithms can be.

I also think that having a hash as a fundamental part of the language makes a big difference in the ease of designing and implementing algorithms. Set operations become simple, as do tree and graph algorithms. There was an interesting study by Lutz Prechelt comparing programming efficiency across a wide range of languages. In it there was a text-processing task that was a natural for hashes. Despite both languages having hashes available through libraries, the C++ and Java folks tended to instead write huge amounts of code implementing n-ary trees, etc. instead of taking the easy way. Unless speed or memory limitations prevent it, it is generally a good idea to use the high-level tools you you have at hand.


Replies are listed 'Best First'.
Re: Re: Re: Perl Internals: Hashes
by stvn (Monsignor) on Apr 15, 2004 at 17:24 UTC
    C? Bah!, that's making it too easy. Write algorithms in MIX, the way God and Knuth intended it!

    Good ole GNU to the rescue, here is a MIX SDK. Now all we need is someone to write Inline::MIX ;-P


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://345245]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2018-04-26 02:46 GMT
Find Nodes?
    Voting Booth?