Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Perl Internals: Hashes

by kvale (Monsignor)
on Apr 14, 2004 at 23:11 UTC ( [id://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.

-Mark

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

    -stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://345245]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-20 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found