Best of Functional ProgrammingOctober 2025

  1. 1
    Article
    Avatar of habrhabr·32w

    Predicate Pattern in Go

    Explores implementing the predicate pattern in Go to create elegant, filterable search methods. Demonstrates building a process finder that accepts predicate functions (functions returning bool) through builder methods like ByTitle() and ByPID(). Shows how to enhance developer experience by converting filter functions into methods on an empty struct, enabling IDE autocomplete for filter options while maintaining clean, idiomatic code.

  2. 2
    Article
    Avatar of freecodecampfreeCodeCamp·30w

    How to Use Closures in Go

    Closures in Go are functions that capture and retain access to variables from their surrounding scope, even after the outer function has finished executing. The guide covers how Go's escape analysis moves captured variables to the heap, common pitfalls like the loop variable trap where all closures reference the same variable, and practical patterns including memoization, event handlers, and concurrent pipelines. It explains how to create closures through various methods, handle them safely in goroutines using channels or mutexes, and addresses memory implications of heap-allocated captured variables.

  3. 3
    Article
    Avatar of hnHacker News·29w

    John Carmack on X: "When I started working in python, I got lazy with “single assignment”, and I need to nudge myself about it. You should strive to never reassign or update a variable outside of true

    John Carmack advocates for single assignment programming practice where variables are initialized once and never reassigned outside of loop iterations. This approach keeps intermediate calculations available during debugging and prevents bugs when moving code blocks. He recommends making variables const by default in C/C++ and wishes mutability required an explicit keyword instead.

  4. 4
    Article
    Avatar of rubylaRUBYLAND·31w

    Papercraft 3.0 Released

    Papercraft 3.0 introduces a redesigned rendering API that moves template operations from Proc extensions to explicit module methods (Papercraft.render and Papercraft.apply), addressing concerns about extending Ruby's core Proc class. The release adds improved XML support with self-closing tags, streamlines the Papercraft::Template wrapper class, and previews upcoming automatic template inlining using AST manipulation with Prism for significant performance improvements when composing complex templates.