News for hackers. Stuff that matters.
Re:Trampolines in JavaScript by sluukkonen on Friday September 06, 2013 @12:58PM (#6341386)
Small steps. Just using some simple functional constructs like `map` and `filter` will do wonders for your code. You don't have to start writing everything in a purely functional manner to benefit from it.
Re:Trampolines in JavaScript by crazygringo on Friday September 06, 2013 @01:04PM (#6341424)
Oh, for sure -- I use map/filter/reduce/etc. whenever I can when they result in cleaner/shorter code. They're great.

I'm asking more about things like tail-call recursion/trampolining, function decoration -- making the "architecture" of your program more functional, rather than just a few lines here or there.

Re:Trampolines in JavaScript by cgag on Friday September 06, 2013 @03:24PM (#6342160)
Recursion isn't really hard once you get used to it, and often leads to shorter/cleaner code. Map/filter/reduce are themselves very clearly expressed using recursion.
Re:Trampolines in JavaScript by mpyne on Friday September 06, 2013 @01:17PM (#6341495)
Indeed, I've started using many functional concepts in a Perl program I maintain.

Functional code isn't just good for concurrency, it also helps when trying to reason about lists and associative containers at a higher level.

Re:Trampolines in JavaScript by daxelrod on Saturday September 07, 2013 @01:21AM (#6344062)
For anyone interested in applying functional concepts to Perl, I highly recommend Mark Jason Dominus's Higher Order Perl[1], the full text of which is now available online for free.

It starts by teaching a reader moderately familiar with Perl functional concepts, and then it deep dives into these concepts and iteratively applies them to example programs to make them better.

[1]http://hop.perl.plover.com/