#functional-programming

[ follow ]
#scala
Alvinalexander
2 years ago
Scala

Thinking With Types: Summary

In Scala/FP, developers work with types more extensively than in Java/FP. [ more ]
Alvinalexander
1 year ago
Scala

Learn Functional Programming (Without Fear)

Helping OOP developers delve into functional programming concepts using Scala's Cats Effect and ZIO libraries in under 200 pages. [ more ]
Alvinalexander
2 years ago
Scala

Functional Programming, Simplified (a Scala book)

Functional Programming, Simplified book provides a comprehensive guide to understanding functional programming, condensing multiple resources into one accessible source. [ more ]
Alvinalexander
2 months ago
Scala

ZIO 2: Using Either with ZIO in a Scala for-expression

Use ZIO in Scala for-expressions with Either to manage errors effectively. [ more ]
Alvinalexander
2 months ago
Scala

ZIO 2: How to read a file and write its output to the console

Reading files and processing output using ZIO 2 in Scala. [ more ]
Medium
3 months ago
Scala

Brief Introduction to Scala

Scala is a programming language created in 2003 to address challenges in developing complex software systems efficiently.
Scala is statically-typed, supports functional and object-oriented programming, and has a rich set of libraries for building scalable applications. [ more ]
Alvinalexander
2 years ago
Scala

Thinking With Types: Summary

In Scala/FP, developers work with types more extensively than in Java/FP. [ more ]
Alvinalexander
1 year ago
Scala

Learn Functional Programming (Without Fear)

Helping OOP developers delve into functional programming concepts using Scala's Cats Effect and ZIO libraries in under 200 pages. [ more ]
Alvinalexander
2 years ago
Scala

Functional Programming, Simplified (a Scala book)

Functional Programming, Simplified book provides a comprehensive guide to understanding functional programming, condensing multiple resources into one accessible source. [ more ]
Alvinalexander
2 months ago
Scala

ZIO 2: Using Either with ZIO in a Scala for-expression

Use ZIO in Scala for-expressions with Either to manage errors effectively. [ more ]
Alvinalexander
2 months ago
Scala

ZIO 2: How to read a file and write its output to the console

Reading files and processing output using ZIO 2 in Scala. [ more ]
Medium
3 months ago
Scala

Brief Introduction to Scala

Scala is a programming language created in 2003 to address challenges in developing complex software systems efficiently.
Scala is statically-typed, supports functional and object-oriented programming, and has a rich set of libraries for building scalable applications. [ more ]
morescala
#zio-2
Alvinalexander
2 months ago
Scala

ZIO 2: Processing ZIO command line arguments

Scala 3 and ZIO 2 example demonstrates processing command-line arguments in a ZIO 2 application. [ more ]
Alvinalexander
2 months ago
JavaScript

The ZIO 2 "mental model"

Think of ZIO 2 as a mental model encompassing code structure and best practices. [ more ]
Alvinalexander
2 months ago
Scala

ZIO 2: Processing ZIO command line arguments

Scala 3 and ZIO 2 example demonstrates processing command-line arguments in a ZIO 2 application. [ more ]
Alvinalexander
2 months ago
JavaScript

The ZIO 2 "mental model"

Think of ZIO 2 as a mental model encompassing code structure and best practices. [ more ]
morezio-2
Medium
2 months ago
Scala

Unlocking the Power of Scala Development: A Comprehensive Guide

Understanding Scala can create numerous opportunities for developers at all levels. [ more ]
#scala-conferences
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
2 months ago
Scala

Scalendar May 2024

Frontend and software architecture events in May 2024 feature Scala conferences covering functional programming and industry practices with renowned experts and diverse topics. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
4 months ago
Scala

Scalendar March 2024

Stay updated on software development trends and events worldwide.
Scala Conference 2024 celebrates Scala's 20th anniversary with diverse program. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
2 months ago
Scala

Scalendar May 2024

Frontend and software architecture events in May 2024 feature Scala conferences covering functional programming and industry practices with renowned experts and diverse topics. [ more ]
Scalac - Software Development Company - Akka, Kafka, Spark, ZIO
4 months ago
Scala

Scalendar March 2024

Stay updated on software development trends and events worldwide.
Scala Conference 2024 celebrates Scala's 20th anniversary with diverse program. [ more ]
morescala-conferences
#programming-languages
Inner-product
2 months ago
Scala

Direct-style Effects Explained

Direct-style effects aim to provide the benefits of monads without using monads in programming languages. [ more ]
LogRocket Blog
1 year ago
JavaScript

How to create a compose function in TypeScript - LogRocket Blog

Composing functions in TypeScript is a core concept in functional programming that combines multiple functions into a single function that can perform any number of tasks you may require.Function composition can be implemented in many programming languages, including TypeScript.In this article, we will learn how to create typed compose and pipe functions in TypeScript and how to use these functions to perform function composition in TypeScript.
Theregister
1 year ago
Software development

Meta met a programming language it likes better than Java

Meta, parent of Facebook, is in the midst of migrating its Android app Java code to Kotlin, a younger programming language that also relies on the Java Virtual Machine, or JVM.Created by software tool maker JetBrains, Kotlin debuted in 2011 and by 2016 had reached its 1.0 release.The following year, it was adopted by Google as a first-class (supported) language for Android development and was put under the management of its own foundation, funded by JetBrains and Google.
Inner-product
2 months ago
Scala

Direct-style Effects Explained

Direct-style effects aim to provide the benefits of monads without using monads in programming languages. [ more ]
LogRocket Blog
1 year ago
JavaScript

How to create a compose function in TypeScript - LogRocket Blog

Composing functions in TypeScript is a core concept in functional programming that combines multiple functions into a single function that can perform any number of tasks you may require.Function composition can be implemented in many programming languages, including TypeScript.In this article, we will learn how to create typed compose and pipe functions in TypeScript and how to use these functions to perform function composition in TypeScript.
Theregister
1 year ago
Software development

Meta met a programming language it likes better than Java

Meta, parent of Facebook, is in the midst of migrating its Android app Java code to Kotlin, a younger programming language that also relies on the Java Virtual Machine, or JVM.Created by software tool maker JetBrains, Kotlin debuted in 2011 and by 2016 had reached its 1.0 release.The following year, it was adopted by Google as a first-class (supported) language for Android development and was put under the management of its own foundation, funded by JetBrains and Google.
moreprogramming-languages
#category-theory
Medium
6 months ago
Scala

Functional Containers Summary: Functor vs Applicative vs Monad

Functors represent mapping between categories, can be viewed as util class for mapping over values, prevalent in functional languages like Scala and Haskell.
Applicatives generalize Functors, operate not just on values but also on functions within a context, less powerful than Monads but more versatile. [ more ]
Alvinalexander
6 months ago
Scala

Eugenio Moggi, monads, and functional programming

Moggi's work on monads introduced a foundational concept for functional programming.
Monads provide a way to structure and control computational effects in a pure and compositional way. [ more ]
Medium
4 weeks ago
JavaScript

Monads!

Monads are fundamental in functional programming but can be intimidating; understanding their basic concepts is key. [ more ]
Medium
4 weeks ago
JavaScript

Monads!

Monads are fundamental in functional programming but can be intimidating; understanding the basic concepts is key for developers to embrace them. [ more ]
Medium
6 months ago
Scala

Functional Containers Summary: Functor vs Applicative vs Monad

Functors represent mapping between categories, can be viewed as util class for mapping over values, prevalent in functional languages like Scala and Haskell.
Applicatives generalize Functors, operate not just on values but also on functions within a context, less powerful than Monads but more versatile. [ more ]
Alvinalexander
6 months ago
Scala

Eugenio Moggi, monads, and functional programming

Moggi's work on monads introduced a foundational concept for functional programming.
Monads provide a way to structure and control computational effects in a pure and compositional way. [ more ]
Medium
4 weeks ago
JavaScript

Monads!

Monads are fundamental in functional programming but can be intimidating; understanding their basic concepts is key. [ more ]
Medium
4 weeks ago
JavaScript

Monads!

Monads are fundamental in functional programming but can be intimidating; understanding the basic concepts is key for developers to embrace them. [ more ]
morecategory-theory
Medium
4 months ago
Scala

Master Scala Rest APIs in 3 Simple Concepts: Illustrated Guide with Tapir, http4s, and Circe!

Tapir, http4s, and Circe are game-changing Scala libraries for Rest APIs and SwaggerUI docs generation.
Scala ecosystem leans towards Tapir, http4s, and Circe for building backend systems due to production-ready and actively maintained status. [ more ]
Medium
5 months ago
Scala

https://github.com/geirolz/fly4s

Flyway is a popular Java library for handling database migrations, but it has some stylistic problems in terms of OOP paradigm.
Fly4s is a lightweight wrapper for Flyway that aims to provide pureness, resource handling, and type safety by using typelevel libraries. [ more ]
CodeProject
5 months ago
JavaScript

Embracing functional programming in C#

Functional programming promotes readability, testability, and maintainability of software.
State mutation is a common source of bugs in software development. [ more ]
Alvinalexander
5 months ago
Web development

100% FREE "Introduction to Functional Programming" video training course (index page)

The article is promoting a free video training course on functional programming
The course is designed to be helpful for those interested in learning functional programming [ more ]
Pybites
5 months ago
Python

Exploring The Role Of Static Methods In Python: A Functional Perspective - Pybites

Static methods in Python do not require an instance or class reference and are typically used for utility functions that belong to a class but are independent of class instances.
Python's module system allows for effective namespace management and code organization, making it a viable alternative to static methods in certain scenarios. [ more ]
Alvinalexander
5 months ago
Scala

Free "Introduction to Functional Programming" video training course: January 21, 2024

12 new lessons released
Final lessons to include ZIO code [ more ]
LogRocket Blog
6 months ago
Scala

Exploring Effect, a meta-state RxJS-like framework - LogRocket Blog

Effect is a functional library for managing side effects in TypeScript.
Effect helps with handling async operations, concurrency, and reactivity while maintaining type safety. [ more ]
Rubyflow
6 months ago
Design

Etcher 1.0.0: A flexible configuration loader and transformer.

Etcher gem 1.0.0 release
Flexible, customizable, and fault-tolerant design [ more ]
#functional programming
Medium
7 months ago
JavaScript

Functional Programming In JavaScript: Beginner's Guide

Functional programming emphasizes pure functions, immutability, and higher-order functions.
Functional programming brings benefits like readability, predictability, concurrent execution, and reusable code. [ more ]
Alvinalexander
7 months ago
Books

Great 2023 holiday programming gift book (for Java/Kotlin/OOP developers)

The book 'Learn Functional Programming The Fast Way!' has been reduced to $20 for the holidays.
It is written for Java, Kotlin, and object-oriented programming (OOP) developers. [ more ]
Medium
7 months ago
JavaScript

Functional Programming In JavaScript: Beginner's Guide

Functional programming emphasizes pure functions, immutability, and higher-order functions.
Functional programming brings benefits like readability, predictability, concurrent execution, and reusable code. [ more ]
Alvinalexander
7 months ago
Books

Great 2023 holiday programming gift book (for Java/Kotlin/OOP developers)

The book 'Learn Functional Programming The Fast Way!' has been reduced to $20 for the holidays.
It is written for Java, Kotlin, and object-oriented programming (OOP) developers. [ more ]
morefunctional programming
Alvinalexander
1 year ago
Scala

May 30, 2023: New release of Functional Programming, Simplified

1. Functional programming is an important and powerful concept that can simplify software development.
2. Functional Programming Simplified by Alvin Alexander is a comprehensive guide to mastering the fundamentals of functional programming.
3. The book is available for free as a PDF, making it a great resource for anyone looking to learn functional programming. [ more ]
#application
Medium
1 year ago
Vue

Authentication and Authorization in NestJS

NestJS Nest is a framework for building efficient, scalable Node.js server-side applications.It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Dmitri Pavlutin Blog
1 year ago
JavaScript

Pure Functions in JavaScript: A Beginner's Guide

A function is a reusable block of code that accepts arguments and returns a computed value.A pure function always returns the same value given the same arguments and produces no side effects.Let's see in more detail what are pure functions and why they are useful.Before I go on, let me recommend something to you.
LogRocket Blog
1 year ago
JavaScript

How to define higher-order functions in Rust - LogRocket Blog

Higher-order functions (HOFs) are functions whose parameters and/or return values are functions themselves.In other words, if a language supports higher-order functions, then we say that these functions are first-class citizens, that is they are values.In this article, we'll investigate how Rust supports higher-order functions and how we can define them.
GitHub
1 year ago
JavaScript

GitHub - xeitojs/xeito: Xeito is a framework for building interactive web applications with Typescript and Tagged Template Literals.

Harness the power of the web.Typescript framework for building web applications.Xeito is a framework for building efficient, scalable web applications using Typescript.It combines some of the best features of Angular, Vue, React and Svelte to provide you with amazing tools to build your next web application.
Medium
1 year ago
Vue

Redux & State Management Basics

Let's make sharing state easy!Redux is a state management library that is used to manage the state of an application.It provides a predictable and centralized way to manage the state of an application, making it easier to debug and reason about.Redux is not a standalone library; it is often used with React and other libraries to build complex applications.
Medium
1 year ago
Scala

Integrating Java APIs with Cats Effect

Cats Effect is an excellent and performant framework for doing asynchronous computations in a functional manner.It provides an IO monadic datatype for controlling the actions of your application.Effects wrapped in instances of the IO monad are lazily evaluated.They can be conveniently composed together with the flatMap function creating bigger programs and then evaluated in a resource-safe runtime.
Medium
1 year ago
Vue

Authentication and Authorization in NestJS

NestJS Nest is a framework for building efficient, scalable Node.js server-side applications.It uses modern JavaScript, is built with TypeScript (preserves compatibility with pure JavaScript) and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP (Functional Reactive Programming).
Dmitri Pavlutin Blog
1 year ago
JavaScript

Pure Functions in JavaScript: A Beginner's Guide

A function is a reusable block of code that accepts arguments and returns a computed value.A pure function always returns the same value given the same arguments and produces no side effects.Let's see in more detail what are pure functions and why they are useful.Before I go on, let me recommend something to you.
LogRocket Blog
1 year ago
JavaScript

How to define higher-order functions in Rust - LogRocket Blog

Higher-order functions (HOFs) are functions whose parameters and/or return values are functions themselves.In other words, if a language supports higher-order functions, then we say that these functions are first-class citizens, that is they are values.In this article, we'll investigate how Rust supports higher-order functions and how we can define them.
GitHub
1 year ago
JavaScript

GitHub - xeitojs/xeito: Xeito is a framework for building interactive web applications with Typescript and Tagged Template Literals.

Harness the power of the web.Typescript framework for building web applications.Xeito is a framework for building efficient, scalable web applications using Typescript.It combines some of the best features of Angular, Vue, React and Svelte to provide you with amazing tools to build your next web application.
Medium
1 year ago
Vue

Redux & State Management Basics

Let's make sharing state easy!Redux is a state management library that is used to manage the state of an application.It provides a predictable and centralized way to manage the state of an application, making it easier to debug and reason about.Redux is not a standalone library; it is often used with React and other libraries to build complex applications.
Medium
1 year ago
Scala

Integrating Java APIs with Cats Effect

Cats Effect is an excellent and performant framework for doing asynchronous computations in a functional manner.It provides an IO monadic datatype for controlling the actions of your application.Effects wrapped in instances of the IO monad are lazily evaluated.They can be conveniently composed together with the flatMap function creating bigger programs and then evaluated in a resource-safe runtime.
moreapplication
Alvinalexander
1 year ago
Scala

Learn Functional Programming The Fast Way! (new book cover)

I decided to rename my book, Learn Functional Programming Without Fear to Learn Functional Programming The Fast Way! because (a) I think it's more reflective of today's world, and (b) it's consistent with my other book, Learn Scala 3 The Fast Way!.
#programming
Medium
1 year ago
Vue

What is Purity in JavaScript and Why Does It Matter?

The process of studying JavaScript usually begins in a very practical way.From declaring variables to understanding the hell of Asynchronous JavaScript, the more theoretical concepts get left out.And this gap starts to get annoying when you get into deeper topics.With this in mind, let's start by explaining some of the more theoretical (and even philosophical) concepts of Modern JavaScript, starting with purity.
Alvinalexander
1 year ago
Scala

My LaTeX cheatsheet for writing a computer programming book

By Alvin Alexander.Last updated: January 22, 2023


I'm currently writing my new book, Functional Programming, Simplified (Updated for Scala 3) directly in LaTeX, and this is my "LaTeX cheatsheet" that I keep open all the time so I can copy and paste the LaTeX stuff I need while I write.Note that I don't use any LaTeX formula stuff, so most of this is pretty basic LaTeX stuff, though there are a few custom commands/functions that probably won't make sense to anyone unless I share some more details.
Alvinalexander
1 year ago
Scala

Patreon page to support Alvin Alexander's writing

As you might guess from looking at this collection of book covers, I LOVE writing about things like Scala and functional programming, but it pays about 1/10th of what programming does.To try to make it affordable to stay in the writing business, I've created this Patreon page.Any support is greatly appreciated!
Medium
1 year ago
Vue

7 JavaScript Tricks You Should Know

JavaScript is a popular programming language that is widely used for front-end web development, server-side scripting, and creating mobile and desktop applications.It is a powerful language that offers many features and capabilities, including object-oriented programming, event-driven programming, and functional programming.
Medium
1 year ago
Vue

What is Purity in JavaScript and Why Does It Matter?

The process of studying JavaScript usually begins in a very practical way.From declaring variables to understanding the hell of Asynchronous JavaScript, the more theoretical concepts get left out.And this gap starts to get annoying when you get into deeper topics.With this in mind, let's start by explaining some of the more theoretical (and even philosophical) concepts of Modern JavaScript, starting with purity.
Alvinalexander
1 year ago
Scala

My LaTeX cheatsheet for writing a computer programming book

By Alvin Alexander.Last updated: January 22, 2023


I'm currently writing my new book, Functional Programming, Simplified (Updated for Scala 3) directly in LaTeX, and this is my "LaTeX cheatsheet" that I keep open all the time so I can copy and paste the LaTeX stuff I need while I write.Note that I don't use any LaTeX formula stuff, so most of this is pretty basic LaTeX stuff, though there are a few custom commands/functions that probably won't make sense to anyone unless I share some more details.
Alvinalexander
1 year ago
Scala

Patreon page to support Alvin Alexander's writing

As you might guess from looking at this collection of book covers, I LOVE writing about things like Scala and functional programming, but it pays about 1/10th of what programming does.To try to make it affordable to stay in the writing business, I've created this Patreon page.Any support is greatly appreciated!
Medium
1 year ago
Vue

7 JavaScript Tricks You Should Know

JavaScript is a popular programming language that is widely used for front-end web development, server-side scripting, and creating mobile and desktop applications.It is a powerful language that offers many features and capabilities, including object-oriented programming, event-driven programming, and functional programming.
moreprogramming
#implementation
Alvinalexander
1 year ago
Scala

A Scala Adler-32 checksum algorithm

While fooling around recently with various computer programming algorithms, I ended up writing an implementation of the Adler-32 checksum algorithm in Scala.There isn't too much to say about it, other than I hope I got it right.My results for the simple test below matched the results shown on the Adler-32 Wikipedia page, so that's encouraging.
Medium
1 year ago
Vue

A Guide to Monads in JavaScript

In this series of blogs I'll try my best to walk you through the Monads basics & implementations, So stay tuned for the next part!Now, without further ado, let's understand what a Monad is!
Monad is a design pattern used to describe computations as a series of steps.With monads, we can define a pipeline, a series of computational steps, that allow us to reuse more of our code, to write it in terms of highly composable parts.
Alvinalexander
1 year ago
Scala

A Scala Adler-32 checksum algorithm

While fooling around recently with various computer programming algorithms, I ended up writing an implementation of the Adler-32 checksum algorithm in Scala.There isn't too much to say about it, other than I hope I got it right.My results for the simple test below matched the results shown on the Adler-32 Wikipedia page, so that's encouraging.
Medium
1 year ago
Vue

A Guide to Monads in JavaScript

In this series of blogs I'll try my best to walk you through the Monads basics & implementations, So stay tuned for the next part!Now, without further ado, let's understand what a Monad is!
Monad is a design pattern used to describe computations as a series of steps.With monads, we can define a pipeline, a series of computational steps, that allow us to reuse more of our code, to write it in terms of highly composable parts.
moreimplementation
Medium
1 year ago
Vue

Mastering Advanced JavaScript Functions: Closures, Currying, and Higher-Order Functions

JavaScript functions are a crucial part of the language, allowing developers to write reusable and modular code.However, there are some advanced concepts related to functions that may not be familiar to all developers.In this article, we'll explore some of the most powerful and advanced features of JavaScript functions, including closures, currying, and higher-order functions.
Alvinalexander
1 year ago
Scala

Become an affiliate for Alvin Alexander's books

If you like my books and want to earn a little extra income, I just started using the Gumroad "affiliates" program.Just sign up with Gumroad, link to one or more books, then hopefully make some sales and earn a little extra money.I'm starting with a 30% commission, so if you sell a $10 book like Learn Scala 3 The Fast Way! you'll earn $3, and if you sell a $20 book like Functional Programming, Simplified: Updated for Scala 3, you'll earn $6 (USD).
Alvinalexander
1 year ago
Scala

Learning Recursion: A free booklet, by Alvin Alexander

As a brief note today, I just released the first version of a new, free booklet that I've titled Learning Recursion.Free download
This booklet is based on the recursion lessons in my new book, Functional Programming, Simplified: Updated for Scala 3. If you've already purchased that book, there's no need to download this booklet, unless you'd like these lessons available in this separate booklet.
Alvinalexander
1 year ago
Scala

Scala: How to convert a String to an Int (Integer)

Scala FAQ: How do I convert a String to Int in Scala?Solution: Use 'toInt'
If you need to convert a String to an Int in Scala, use the toInt method, which is available on String objects, like this:

scala>val i = "1".toInti: Int = 1
As you can see, I just cast the string "1" to an Int object using the toInt method, which is available to any String.
Alvinalexander
1 year ago
Scala

A Scala "fold left" function written using recursion

As a brief note, here's some Scala source code that shows how to write a fold left ( foldLeft) function using recursion:

// scala 2

object FoldLeft extends App {

val a = List(1,2,3,4)

def add(a: Int, b: Int) = a + b

println(foldLeft(0)(a)(add))

def foldLeft(lastResult: Int)(list: List[Int])(f: (Int, Int) => Int): Int = list match {
case Nil => lastResult
case x :: xs => {
val result = f(lastResult, x)
println(s"last: $lastResult, x: $x, result = $result")
foldLeft(result)(xs)(f)
}
}

}
The output of this example code looks like this:

last: 0, x: 1, result = 1
last: 1, x: 2, result = 3
last: 3, x: 3, result = 6
last: 6, x: 4, result = 10
10
I'll explain this code in my new book on functional programming, but for the moment I'm just sharing the code here in case anyone wants/needs to see how to do this.
#optimization
Medium
1 year ago
Data science

First Speakers Announced for the Data Engineering Summit on Jan 18

In just a few weeks, ODSC and Ai+ Training's Data Engineering Live Summit will arrive.This fully virtual event on January 18th is where you'll want to be to get the latest and greatest when it comes to data engineering.After reviewing our list of speakers, the team's excited about the content that you'll get to enjoy.
Slott-softwarearchitect
1 year ago
Python

Functional Programming and Finite State Automata (FSA)

When I talk about functional programming in Python, folks like to look for place where functional programming isn't appropriate.They latch onto finite-state automata (FSA) because "state" of an automata doesn't seem to fit with stateless objects used in functional programming.This is a false dichotomy.
Medium
1 year ago
Data science

First Speakers Announced for the Data Engineering Summit on Jan 18

In just a few weeks, ODSC and Ai+ Training's Data Engineering Live Summit will arrive.This fully virtual event on January 18th is where you'll want to be to get the latest and greatest when it comes to data engineering.After reviewing our list of speakers, the team's excited about the content that you'll get to enjoy.
Slott-softwarearchitect
1 year ago
Python

Functional Programming and Finite State Automata (FSA)

When I talk about functional programming in Python, folks like to look for place where functional programming isn't appropriate.They latch onto finite-state automata (FSA) because "state" of an automata doesn't seem to fit with stateless objects used in functional programming.This is a false dichotomy.
moreoptimization
#information
Alvinalexander
1 year ago
Scala

Combining the best of FP and OOP with Scala

I like what John De Goes shares in this talk about how to combine the best of FP & OOP.The "best of" portion of the talk starts about 36 minutes into the talk, which is where that link starts.FWIW, I share almost all of the same information in my book, Functional Programming, Simplified, though I will admit that I probably don't articulate it quite as well as his speech.
Alvinalexander
1 year ago
Scala

How to add elements to a List in Scala (List, ListBuffer)

Scala List FAQ: How do I add elements to a Scala List?
Alvinalexander
1 year ago
Scala

Combining the best of FP and OOP with Scala

I like what John De Goes shares in this talk about how to combine the best of FP & OOP.The "best of" portion of the talk starts about 36 minutes into the talk, which is where that link starts.FWIW, I share almost all of the same information in my book, Functional Programming, Simplified, though I will admit that I probably don't articulate it quite as well as his speech.
Alvinalexander
1 year ago
Scala

How to add elements to a List in Scala (List, ListBuffer)

Scala List FAQ: How do I add elements to a Scala List?
moreinformation
#performance
James Sinclair
1 year ago
JavaScript

A Skeptic's Guide to Functional Programming with JavaScript

What if the team hates my functional code?So you learned some functional programming.And it's glorious!Your JavaScript is cleaner; more concise; elegant.It feels solid.You can't wait to share it with the team.So you throw up a PR and wait for the comments to come in; eager to hear what they think.And those comments come in all right.
James Sinclair
1 year ago
JavaScript

What if the team assumes my functional JavaScript is slow?

Suppose you start introducing some functional flavour into your code.And, you like it.The code is more expressive.It's easier to test.It's easier to pull apart and reconfigure.On several measures, it's better code than you used to write.There's a problem, though.The team have been communicating, with not-so-subtle hints, that they don't like it.
James Sinclair
1 year ago
JavaScript

A Skeptic's Guide to Functional Programming with JavaScript

What if the team hates my functional code?So you learned some functional programming.And it's glorious!Your JavaScript is cleaner; more concise; elegant.It feels solid.You can't wait to share it with the team.So you throw up a PR and wait for the comments to come in; eager to hear what they think.And those comments come in all right.
James Sinclair
1 year ago
JavaScript

What if the team assumes my functional JavaScript is slow?

Suppose you start introducing some functional flavour into your code.And, you like it.The code is more expressive.It's easier to test.It's easier to pull apart and reconfigure.On several measures, it's better code than you used to write.There's a problem, though.The team have been communicating, with not-so-subtle hints, that they don't like it.
moreperformance
alvinalexander.com
1 year ago
Scala

Simple FP book: No monads. No monoids. No category theory. Just FP code.

How about a simple functional programming book written with this style: No monads.No monoids.No category theory.Just some Java & Scala code.Robert Martin's tweet about writing a new simple functional programming book (in Clojure) was shared with me here, and I like his initial wording on not worrying about monads, monoids, functors, and category theory.
Topenddevs
1 year ago
JavaScript

- Top End Devs

Lane Wagner is the founder of a startup company called Boot.dev.He teaches backend development online in Go, Python, and JavaScript.Lane joins Chuck and Steve as they talk all things Functional Programming.They also talk about its importance and share their thoughts about it.Moreover, Lane also shares his experience with creating boot.dev and the different teaching strategies he uses on his online learning platform.
#years
Alvinalexander
1 year ago
Scala

For OOP developers: The smallest, simplest functional programming book

Some of the books on the right side of this image are amazing, and I would never discourage anyone from reading the great ones.But if you're an object-oriented programming (OOP) developer who wants to start understanding functional programming (FP) over a weekend, that's the goal of the new little book on the left: Learn Functional Programming Without Fear.
Alvinalexander
1 year ago
Scala

Best FP book for OOP, Java, and Kotlin developers?

October, 2022: I just released my new book, "(Almost) Functional Programming," and I think it's going to be a terrific book for all OOP developers, especially Java and Kotlin developers.
Alvinalexander
1 year ago
Scala

The three principles of functional programming

As an example, here are the "three principles of functional programming," from this tweet:
...
Orthogonal composability 2.Maximum polymorphism 3.Maximum deferment
Conversely, here are the "three pillars of functional programming," from Functional and Reactive Domain Modeling:
...
Referential transparency 2.Substitution model 3.Equational reasoning
...
When I started learning FP (and later took two years to write Functional Programming, Simplified) I was surprised there wasn't a single accepted definition of functional programming.
Alvinalexander
1 year ago
Scala

For OOP developers: The smallest, simplest functional programming book

Some of the books on the right side of this image are amazing, and I would never discourage anyone from reading the great ones.But if you're an object-oriented programming (OOP) developer who wants to start understanding functional programming (FP) over a weekend, that's the goal of the new little book on the left: Learn Functional Programming Without Fear.
Alvinalexander
1 year ago
Scala

Best FP book for OOP, Java, and Kotlin developers?

October, 2022: I just released my new book, "(Almost) Functional Programming," and I think it's going to be a terrific book for all OOP developers, especially Java and Kotlin developers.
Alvinalexander
1 year ago
Scala

The three principles of functional programming

As an example, here are the "three principles of functional programming," from this tweet:
...
Orthogonal composability 2.Maximum polymorphism 3.Maximum deferment
Conversely, here are the "three pillars of functional programming," from Functional and Reactive Domain Modeling:
...
Referential transparency 2.Substitution model 3.Equational reasoning
...
When I started learning FP (and later took two years to write Functional Programming, Simplified) I was surprised there wasn't a single accepted definition of functional programming.
moreyears
Alvinalexander
1 year ago
Scala

Functional programming: The fastest way to learn it

Alternate titles for my book, Learn Functional Programming Without Fear, are, the fastest way to learn functional programming and learn functional programming the fast way.That's because I found out - almost by accident - that the fastest way to learn FP goes like this:


     Start with an OOP foundation, like using Java, Kotlin, and other OOP languages
     Take a look at how you write methods in OOP languages
     Then look at how to solve problems using pure functions and data types
     Add in immutable (algebraic) variables
     Then add in immutable data structures
     Lastly, add in functional error-handling using Scala's Option, Try, and Either data types


As I show in Learn Functional Programming Without Fear, if you follow this "OOP to FP" journey correctly, you'll now be ready to use Scala/FP libraries like ZIO and Cats Effect.
Alvinalexander
1 year ago
Scala

50% off discount code for "Functional Programming, Simplified"

If you've been waiting for a coupon or discount to learn functional programming, today may be your lucky day.I just created a 50% off discount code for the PDF version of "Functional Programming, Simplified" (a best-selling, highly-rated book about functional programming in Scala).But hurry, because the discount is limited to the first 100 buyers.
Alvinalexander
1 year ago
Scala

(Almost) Functional Programming

Dateline October 17, 2022: Today I'm proud to announce the initial release of my new book, (Almost) Functional Programming:
A little book, a big goal
Alvinalexander
1 year ago
Scala

Notes from Functional and Reactive Domain Modeling

I'm a big fan of the book, Functional and Reactive Domain Modeling, and these are some of my notes ("CliffsNotes") from the book, most of them coming from the first chapter.
#back
Alvinalexander
1 year ago
Scala

Scala: Examples of for-expressions being converted to map and flatMap

Without much explanation, here are a couple of source code examples from my book, Functional Programming, Simplified (in Scala).
Alvinalexander
1 year ago
Scala

Scala: A Reverse Polish Notation (RPN) calculator written with foldLeft

That code also works, but whether it's readable is subject to debate (depending on your experience with Scala, functional programming, the foldLeft method, your brain, and other factors).
Alvinalexander
1 year ago
Scala

Simple Scala recursion examples (recursive programming)

Therefore I'll just show the following code without discussing it: package recursion import scala.annotation.tailrec
...
/** * The `fibHelper` code comes from this url: rosettacode.org/wiki/Fibonacci_sequence#Scala
Alvinalexander
1 year ago
Scala

Scala: Examples of for-expressions being converted to map and flatMap

Without much explanation, here are a couple of source code examples from my book, Functional Programming, Simplified (in Scala).
Alvinalexander
1 year ago
Scala

Scala: A Reverse Polish Notation (RPN) calculator written with foldLeft

That code also works, but whether it's readable is subject to debate (depending on your experience with Scala, functional programming, the foldLeft method, your brain, and other factors).
Alvinalexander
1 year ago
Scala

Simple Scala recursion examples (recursive programming)

Therefore I'll just show the following code without discussing it: package recursion import scala.annotation.tailrec
...
/** * The `fibHelper` code comes from this url: rosettacode.org/wiki/Fibonacci_sequence#Scala
moreback
Alvinalexander
1 year ago
Scala

A simple Scala Quicklens example (functional programming, lenses)

I may explain this more in the future, but for now, here's some source code for an example of how to use Quicklens in a Scala functional programming project.
Given some model/ADT definitions like this:
Alvinalexander
1 year ago
Scala

My video on Expression-Oriented Programming (EOP)

Based on my two books, Learn Scala 3 The Fast Way and Functional Programming, Simplified, here's my video on Expression-Oriented Programming (EOP) in Scala:
(And here's a direct link to the video.)
Simplilearn.com
1 week ago
JavaScript

Java 8 Features: Essential Updates in 2024

Java 8 introduced key features like Lambda Expressions, Stream API, and Date and Time API for enhanced productivity and functional programming in Java. [ more ]
Alvinalexander
2 weeks ago
JavaScript

ZIO 2: Passing a ZLayer value to an application, getting a return value, and handling possible errors

Demonstrates passing a value to ZIO application using ZLayer, handling errors with foldZIO, and different ways to write run value. [ more ]
Jrsinclair
1 month ago
JavaScript

How to compose JavaScript functions that take multiple parameters (the epic guide)

Functions with multiple parameters cannot be composed directly. Techniques like currying and partial application help handle multi-argument functions. [ more ]
Alvinalexander
1 year ago
JavaScript

Scala: How to use fold on an Option (syntax, examples)

Different ways to extract values from Scala Option, including using fold method. [ more ]
[ Load more ]