http://www.perlmonks.org?node_id=656881


in reply to Re: How do I train myself to write more Perl-ish Perl, rather than C-ish Perl?
in thread How do I train myself to write more Perl-ish Perl, rather than C-ish Perl?

I will definitely second this, I had to learn Lisp (for AI) and Scheme and OCaml (for programming languages) last year at uni. While all three have constructs for iterative loops (for example), my professors wouldn't allow us to use them, forcing us to think in terms of recursive calls. Just this simple rule alone allowed me to think more ``functionally'', and soon I was thinking in terms of recursive algorithms, higher order functions, and so forth. This bled over to my Perl hacking, and my code has never been less C-like.

I was stuck in the rut of the C way of doing things, but functional languages showed me the light. I'd recommend anyone take a short vacation away from imperative languages if they haven't yet.

  • Comment on Re^2: How do I train myself to write more Perl-ish Perl, rather than C-ish Perl?