Best of Functional Programming2024

  1. 1
    Article
    Avatar of communityCommunity Picks·2y

    Things You Should Never Do As A Software Engineer

    This post provides a list of 10 things that software engineers should avoid, including being a perfectionist, not prioritizing code refactoring, misunderstanding the concept of legacy code, using functional programming in the wrong context, following best practices blindly, struggling alone instead of learning from experienced teammates, falling into the 'flow' and over-engineering, neglecting physical health, forgetting the enjoyment of programming, and being a coder instead of a problem solver using code.

  2. 2
    Article
    Avatar of devtoDEV·2y

    Essential ES6 JavaScript Features Every JavaScript Developer Should Know

    Learn about the essential features of ES6 in JavaScript, including arrow functions, template literals, array destructuring, object destructuring, the Set method, the spread operator, and the rest operator.

  3. 3
    Article
    Avatar of stitcherstitcher.io·2y

    I don't write code the way I used to

    A seasoned programmer shares reflections on how their coding approach has evolved over the past decade. Key changes include a move away from abstractions, embracing a functional programming mindset, struggling but persisting with testing, opting for readability over shorthand efficiency, and the importance of static analysis tools. Despite the quirks, they continue to find value in using PHP.

  4. 4
    Article
    Avatar of typescripttvTypeScript.TV·2y

    How to write declarative TypeScript Code?

    Declarative programming in TypeScript focuses on defining the desired outcome rather than the specific steps to achieve it. Unlike imperative programming, which details every step and state change, declarative programming relies on abstractions to handle these complexities. An illustrative comparison is made using the example of filtering even numbers from an array, highlighting key differences in control flow, state management, and code focus.

  5. 5
    Article
    Avatar of javacodegeeksJava Code Geeks·2y

    Java Streams: 5 Powerful Techniques You Might Not Know

    Discover 5 powerful techniques for Java Streams that can enhance your code readability, maintainability, and processing efficiency.

  6. 6
    Article
    Avatar of communityCommunity Picks·2y

    Unleash JavaScript's Potential with Functional Programming

    JavaScript supports both Object-Oriented Programming (OOP) and Functional Programming (FP), enabling developers to write more modular, deterministic, and testable code. Key concepts such as pure functions, immutability, closures, higher-order functions, and declarative programming are fundamental to FP. The post explains these concepts in detail and demonstrates practical applications using JavaScript's array methods like map, filter, and reduce. Additionally, it highlights important principles like function composition, currying, and data privacy, aiming to transform the way you write JavaScript code.

  7. 7
    Article
    Avatar of collectionsCollections·2y

    Mastering JavaScript Closures: A Comprehensive Guide

    JavaScript closures are powerful and essential for writing clean, modular, and efficient code. They allow functions to access variables from their outer scope even after that scope has closed. By understanding closures, you can better understand how functions in JavaScript retain access to their own lexical scope.

  8. 8
    Article
    Avatar of itnextITNEXT·2y

    A Few Unshakable Principles for Writing Better Code

    Explore essential principles for writing better, cleaner code. The author shares insights on effective code practices, emphasizing that functions should perform one task and maintain a consistent return type. Highlighting the value of code readability, abstraction, and functional programming concepts such as map-reduce, the guide provides practical examples to illustrate these points.

  9. 9
    Article
    Avatar of devtoDEV·2y

    Deep Dive into Functional Programming in Javascript

    Functional programming concepts such as pure functions, immutability, currying, memoization, and monads can significantly enhance the quality and maintainability of JavaScript code.

  10. 10
    Article
    Avatar of infoworldInfoWorld·2y

    7 JavaScript language elements every developer needs

    Learn about the most searched JavaScript language elements, including arrays, 'for' loops, and the 'forEach' method. These are essential fundamentals for JavaScript developers.

  11. 11
    Article
    Avatar of communityCommunity Picks·2y

    A different way to think about TypeScript

    Think of TypeScript's type system as a functional language that operates over sets. Types can be considered as sets of literals they can construct. By resolving types into sets, intersections and unions become clearer. Primitives in TypeScript allow introspection and transformation of these sets. Mapped types and recursive logic enable advanced type manipulations. Viewing TypeScript through this lens helps to understand and utilize its advanced features better.

  12. 12
    Article
    Avatar of communityCommunity Picks·2y

    sindresorhus/awesome-nodejs: :zap: Delightful Node.js packages and resources

    A curated list of Node.js packages and resources for developers.

  13. 13
    Article
    Avatar of communityCommunity Picks·2y

    Tail Call Optimization ♻️and Recursion🔁 in JavaScript

    Recursion is a technique where a function calls itself to solve problems but can lead to high memory usage and stack overflow. Tail call optimization (TCO) addresses this by reusing stack frames for the subsequent calls when the recursive call is in the tail position. JavaScript provides partial support for TCO, with ECMAScript 6 introducing proper tail calls (PTC). Techniques like iteration, trampolining, and memoization further help optimize recursive functions. Challenges include handling deep recursion and asynchronous operations. Functional programming libraries such as Ramda offer TCO-optimized functions.

  14. 14
    Article
    Avatar of asayerasayer·2y

    Better Error Handling with Monads (Part 1)

    This post explains how to achieve better error handling using monads in JavaScript. It starts with basic containers, progresses to functors, and culminates in monads. The focus is on how to define and use monads to simplify coding tasks, such as dealing with errors and missing values, using vanilla JavaScript without classes.

  15. 15
    Article
    Avatar of codemazeCode Maze·2y

    Local Functions vs Lambda Expressions in C#

    Local functions and lambda expressions in C# serve different purposes and have distinct performance characteristics. Local functions are methods nested within other methods and excel in performance since they can avoid heap allocation and use struct instead of class captures. Lambda expressions, while concise and useful for passing as delegates, generally require heap allocation and object instantiation. Local functions can be generic, recursive, and used as iterators, whereas lambda expressions struggle with these features. Thus, local functions are often more versatile and performant, especially when not using APIs that demand delegates.

  16. 16
    Video
    Avatar of TechWithTimTech With Tim·2y

    Master Python Lambda Functions in 8 Minutes

    Learn about Python lambda functions, which are anonymous one-line functions useful for scenarios where a function is used temporarily, such as with map, filter, and reduce functions. The post covers defining lambdas, using them in common functional programming contexts, and examples demonstrating their various uses.

  17. 17
    Article
    Avatar of pandProAndroidDev·2y

    Stop throwing exceptions!

    In Kotlin, it's recommended to avoid throwing exceptions and instead handle error scenarios using try/catch expressions, result objects, and functional programming paradigms. The default usage of try/catch is criticized for reducing readability and maintainability. The post suggests Kotlin's built-in Result class for better error handling, providing examples of how to wrap operations in Result objects and handle errors more effectively. This approach promotes cleaner, more testable code without relying on exceptions.

  18. 18
    Article
    Avatar of elixirforumElixir Forum·2y

    A free, 30min Elixir Quickstart Guide

    RunElixir.com 2 is a free, online quickstart guide designed to help developers get started with Elixir in 30 minutes. Inspired by the Rust by Example book and the Gleam language tour, it offers a condensed version of Elixir documentation and high-level introductions to various Elixir topics. It aims to show what Elixir and Erlang have to offer from a high level. Feedback and topic suggestions are welcomed.

  19. 19
    Article
    Avatar of bitfieldconsultingBitfield Consulting·2y

    Functional programming in Go — Bitfield Consulting

    Functional programming in Go enhances code organization by using functions as primary control structures. Key operations include mapping a function over a slice, filtering elements based on a function, and reducing a slice to a single value with a function. These operations can simplify and elegantly solve many problems. The post demonstrates how to implement `Map`, `Filter`, and `Reduce` functions in Go, highlighting their usage and versatility.

  20. 20
    Article
    Avatar of asayerasayer·2y

    Forever Functional: Of maps and pipes, chains and nests, and more

    Explore the usage of the map() method for different data types, as well as its application to functions. Learn about the concepts of composition and pipelining in functional programming.

  21. 21
    Video
    Avatar of fireshipFireship·2y

    Erlang in 100 Seconds

    Erlang is a fault-tolerant, functional programming language and runtime. It is used in the telecommunications industry to handle millions of phone calls in parallel. Erlang's process isolation and message passing features make it highly scalable and reliable.

  22. 22
    Article
    Avatar of inside_javaInside Java·2y

    Converting Data Sources to Streams

    Learn how to transform imperative-style loops into functional-style streams in Java. This guide walks through converting a file-reading task using BufferedReader into a streamlined process using the Streams API. Key functions include filter() and map(), which simplify data manipulation by treating the content as streams.

  23. 23
    Article
    Avatar of communityCommunity Picks·2y

    Higher-Order Functions In JavaScript

    JavaScript's functional programming features offer powerful tools for writing expressive and maintainable code. Higher-order functions, such as map, filter, and reduce, serve as a foundation for many coding patterns and techniques. They allow for data transformation, filtering, and combination, improving code modularity and expressiveness. Higher-order functions also enable a more declarative programming style and support concepts like currying and function composition. JavaScript provides built-in higher-order functions for array manipulation, and developers can create custom higher-order functions to cater to specific application needs.

  24. 24
    Article
    Avatar of newstackThe New Stack·2y

    Golang 1.22 Redefines the For Loop for Easier Concurrency

    Golang 1.22 introduces changes to the for loop for easier concurrency, including improved variable scoping and the ability to range over integers. It also previews a feature that allows users to range over functions as iterators.

  25. 25
    Article
    Avatar of hnHacker News·2y

    Gleam: A Basic Introduction

    Gleam is a statically-typed functional programming language designed for building scalable and maintainable software. Inspired by Elm and Rust, it compiles to Erlang, making it suitable for concurrent and distributed systems. This tutorial covers setting up the development environment, writing a simple 'Hello, World!' program, and demonstrating basic features like variables, types, arithmetic operations, functions, and case expressions.