Problems? Is your data what you think it is? | |
PerlMonks |
Re: Re: Re: Re: Perl Internals: Hashesby demerphq (Chancellor) |
on Apr 14, 2004 at 23:17 UTC ( [id://345247]=note: print w/replies, xml ) | Need Help?? |
Well, I learned and programmed in a lot of other languages before I came to Perl so Im aware of the differences. Pascal in particular... *shiver* But anyway, I dont know that I agree with your last point. Personally amongst the first thing I do with a new language is write certain data structure implementations. Try 2-3 trees in VB. Blech. :-) Perl has a natural slant and thus some algorithms work nicely in Perl, others go against the grain as it were and are actually far less efficient than they should be. But aside from that if you learn an algorithm in a language like perl then you probably havent had to deal with as much language and representation specific gunk so you have probably learned the core ideas better. So when you go to implement in another language you're more free of language specific distractions and can concentrate on figuring out how to implement the core behaviour, not the equivelent of the other implementation you wrote. For instance
The equivelent code in almost any other language would be much larger, and would do no better, and IMO signifigantly worse at illustrating the ideas behind Huffman encoding. Optimising this so that it only calls sort once for instance only detract from the core idea of the algorithm.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
In Section
Seekers of Perl Wisdom
|
|