IJCH - Inside JaiChai's Head (Meaning: My Warped, Personal Opinions and Musings)
From the Author:
Salutations.
I am JaiChai.
And if I haven't had the pleasure of meeting you before, I'm delighted to make your acquaintance now.
I invite you to interact with everyone, learn, and have as much fun as possible!
For my returning online friends, "It's always great to see you again!"
Important Clarification -
It's important for me to make this clear up front:
This article IS NOT a tutorial on Functional Programming.
Yes, a basic definition of Functional Programming will be submitted, but that is the extent of it.
I will not be debating for or against Functional Programming.
Stated differently, I will not be proselytizing, nor will I be attempting to recruit converts from other programming communities.
Nor will I discuss ALL the differences between Functional Programming and the universe of other computer languages.
The only comparisons and contrasts I submit relate directly to my motivation for learning Functional Programming.
To reiterate, this article IS NOT about the "WHAT" of Functional Programming. It is about the "WHY"; that is, my personal reasons for learning Functional Programming at this point in my life.
That said, let's charge on...
Everyone a Coder -
I strongly believe that everyone should learn to code - whether or not you plan on being a professional programmer.
Why?
Here's just a few significant benefits of learning to code:
Teaches Logic and Critical thinking
Builds Problem Solving Skills
Introduces Development, Execution, and Process Evaluation
Increases Identification, Interaction and Syntax Capabilities
Enhances Creativity
Encourages Collaboration
Demystifies Computers
Often morphs from a Hobby to a Profession
In short, learning to code - in whatever language - teaches people "How to Think More Effectively" and builds tangible, important Life Skills.
Brief Description of Functional Programming -
Imperative vs. Declarative Languages:
Popular Functional Programming Languages:
10 Reasons WHY I'm Learning Functional Programming
#1 - I Suck at other Programming Languages!
By far, the biggest complaint about learning Functional Programming is it's perceived "Almost Vertical Learning Curve"!
The fact that I'm basically ultra-lame at most of the popular languages is actually a positive thing.
How can that be?
First off, let me explain why I suck at other programming languages.
I am shamelessly disloyal. The decision to use a certain language in the past was solely based on the type of problem I needed to solve.
Different languages provide different benefits.
For example, Java/JavaScript is good for cross platform/web oriented projects, C is popular among engineers, C++ is good for programs needing speed (think Gaming); while Python and Ruby are the languages recommended for beginners, etc.
Being a computer language whore and project mercenary, I have never "imprinted" onto any single language.
I'm lazy and vehemently avoid re-inventing the wheel. If I can find an open source example of what I need, I have no qualms about using it (aka "GitHub Hound").
Consequently, I have never bothered to memorize a lot of the jargon, syntax and idiosyncratic properties of those languages; hence, I am far from an expert in any single language.
Since the popular Imperative (tell the program "what" to do) programming languages and Functional (tell it "how" to do) Programming style have totally different paradigms, proficiency in other languages is actually a detriment.
In other words, if a person's legacy programming paradigms and coding habits are deeply ingrained, the paradigm shift required to learn Functional Programming is a major obstacle in the learning process.
In contrast, I am basically Tabula Rasa; therefore, I have virtually nothing to unlearn.
In other words, my historically non-committal attitude towards any one language makes it much easier to accept and learn the unique paradigm and syntax of Functional Programming.
#2 - Purity -
...pure functions are easier to reason about because you know that they can’t do certain things, such as talk to the outside world, have hidden inputs, or modify hidden state.
Because of this, you’re guaranteed that their function signatures tell you (a) exactly what’s going into each function, and (b) coming out of each function.
In short, Referential Transparency (same in, same out) is a built-in property of Functional Programming.
This makes programming to purpose MUCH EASIER because there are no side-effects or state management to deal with.
#3 - Less Bugs, Cool Compiler
Debugging sucks and is frustrating as Hell!
In Functional Programming, bugs are found during compile time, not runtime (translated: A whole lot of time saved and anguish prevented).
Furthermore, debugging is very costly in terms of man hours and severely impacts a company's bottom line.
#4 - Pararellism
Parallelism represents a huge increase in speed and efficiency.
Traditional languages are always vulnerable to a host of problems when programming for parallelism. There are just too many dependencies, strict sequencing schemes, and changes of state.
The modularity of Functional Programming guarantees no interference and side-effects; making it perfect for parallel computing.
The take-away from this is simple:
Functional Programming is able to safely exploit all the cores of today and tomorrow's computers.
#5 - Laziness
In programming language theory, lazy evaluation, or call-by-need is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing).
This property of Functional Programming translates into tremendous improvements in the efficiency of developing, testing and deploying software; as well as saving millions (if not billions) of dollars of computing resources.
#6 - Industrial Strength and Use
Functional Programming languages are considered "high-assurance" (dependable and robust enough for enormous, billion dollar, high tech global business, dangerous scientific projects, etc.).
That is why many industries and corporations are now turning to Functional Programming languages for their high-risk, high-scale and high-cost operations.
For example:
Facebook uses Haskell -
WhatsApp uses Erlang -
Twitter uses Scala -
#7 - Functional Programming and Other Languages
Functional Programming is language agnostic because it is a paradigm and style.
Consequently, Functional Programming is already seeping into many other computer languages.
Here's just of few of them -
#8 - Tailor Made for Cryptocurrency
One error in a cryptocurrency's code can result in an avalanche of loss.
Just look at the history of major hacks on cryptocurrency to see that patching current code is not a viable longterm solution.
That's why more and more cryptocurrency developers and smart contract platforms are seriously looking at Functional Programming languages to solve their safety, scalability, and reliability issues.
In fact, Cardano is totally programmed in a Functional Language called Haskell.
#9 - Choice for Quantum Computing
Quantum Mechanics and Quantum Computing are a of couple subjects I am very interested in.
I see learning Functional Programming as a solid method for understanding Quantum Computing better.
Functional Programming is obviously well suited for the abstraction level needed for quantum computing because the language is based on Lambda Calculus.
There's been a lot of Quantum Computing modeling using Haskell.
And Lisp is a popular language among Quantum Computer programmers.
#10 - First Class Mental Exercise
Whether it be muscles or brain cells, non-use equals atrophy.
Functional Programming has its roots in Lambda Calculus.
Lambda Calculus is elegant and powerful.
It can encode ANY COMPUTATION using mathematical expressions.
Once you wrap your mind around the basic concepts of abstraction, you quickly realize that its simplicity is the key to its reliability and flexibility.
Parting Shots -
By JaiChai
Really Appreciate You Stopping By.
Truly hope to see you again!
About the Author
Believing that school was too boring, he dropped out of High School early; only to earn an AA, BS and MBA in less than 4 years much later in life – while working full-time as a Navy/Marine Corps Medic.
In spite of a fear of heights and deep water, he performed high altitude, free-fall parachute jumps and hazardous diving ops in deep, open ocean water.
After 24 years of active duty, he retired in Asia.
Since then, he's been a full-time, single papa and actively pursuing his varied passions (Writing, Disruptive Technology, Computer Science and Cryptocurrency - plus more hobbies too boring or bizarre for most folk).
He lives on an island paradise with his teenage daughter, long term girlfriend and three dogs.