Better Programming

Advice for programmers.

Follow publication

Member-only story

Why JavaScript Might Be the Functional Programming Language To Simplify Your Code

Arnold Abraham
Better Programming
Published in
6 min readAug 4, 2021

Image made by the Author

Functional Programming (FP)became very popular during the last decade of web development. Thanks to many libraries and frameworks (LoDash, RamdaJS, React and Redux, Angular and NGRX), JavaScript got a great touch of FP.

But the term, FP, is almost as old as programming itself and has therefore been around quite a while. LISP, the second-oldest programming language, is still in use.

Nonetheless, JavaScript offers many features that raise the question:

Is JavaScript an appropriate Language for FP?

The Diverse Opinion About Functional Programming

Ask whoever you want, and you will get different answers. It is a modern approach to programming that leaves every other paradigm behind not only because it might be advanced and enlightened.

Others will answer that this paradigm is way too theoretical to be applied to real-world problems. It is practically impossible to implement it straight because it brings more complications than benefits to the table.

I think the truth lies somewhere within, as with anything in life. Nothing is just black or white.

Think the Other Way Around

Ides of March (Death of Ceasar), Picture from Wikipedia

Rule as an imperator means to solve a problem the imperative fashioned way: a sequence of statements. Whereas your desired result is achieved by creating objects and mutating their states. This ultimately means modifying the objects themselves.

Rule as functionary is the complete opposite. Instead of focusing on objects, you create results by evaluating expressions. Those expressions are combined to compose functions.

FP is the fine English way of coding. No loops, skip side effects and pass functions around.

The Content of Your Toolbox

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Arnold Abraham
Arnold Abraham

Written by Arnold Abraham

JavaScript, TypeScript and C#/.NET Tutorials/News/Best Practices by a German Software Engineer - Fun helps you to learn on the fly --> arnoldcode.com

Responses (1)

Write a response

Great read, congrats Arnold

--