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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: Re: Perl Internals: Hashes by kvale
in thread Perl Internals: Hashes by Kozz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found