Originally posted on searchapparchitecture. Choosing between functional programming vs. object-oriented programming isn’t easy, but there are plenty of key factors that may help make the decision easier. Committing to a programming paradigm is an important step in any application development effort. While they are hardly the only two options when it comes to overarching development...
Tag: functional programming
An introduction to typeclass metaprogramming
Originally posted on lexi-lambda.github. Typeclass metaprogramming is a powerful technique available to Haskell programmers to automatically generate term-level code from static type information. It has been used to great effect in several popular Haskell libraries (such as the servant ecosystem), and it is the core mechanism used to implement generic programming via GHC generics. Despite this, remarkably little material...
Fun JavaScript: Safely dealing with undefined/null values using functional programming
Originally posted on intext. Let’s pretend there is a number we want to apply an operations to, and if that number is undefined/null, we want to avoid an error or unexpected result. The operation will be add. One way to do this imperatively could be: const number = // getting number from somewhere (DB/network/etc)let newNumber; if...
Composing functions in JavaScript
Originally posted on dev. Taking functional programming approach to pipeline functions in JavaScript Cross-posted from my dev.to article with a same title. Recently I read an article, here on Medium, about using Pipeline style in JavaScript. An article described how to pipe functions together so data flows through all of them. What I’ve missed in this article was...
How To Replace Your Python For Loops with Map, Filter, and Reduce
Write more semantic code with functional programming Do you ever look at your code and see a waterfall of for loops? Do you find yourself having to squint your eyes and lean towards your monitor to get a closer look? I know I do. For loops are a Swiss army knife for problem-solving, but, when...
Functional Programming with examples in Java, Javascript and Haskell
Functional Programming is an old paradigm, but relatively new to many programmers. In this course you will explore how to take advantage of the power that comes with thinking declaratively. The course is taught by Senior Engineers with several years of experience in front end and full stack applications. This is a 6 hours course....
What Makes Functional and Object-oriented Programming Equal
There is an ongoing dispute on the Internet about which kind of programming, functional or object-oriented, is better. Large areas of the scene are polluted by a raging war where bigots of all kinds are serving fabricated “proofs” to disregard the opposing programming technique. Notably, an extremely loud and aggressive minority exists, which claims that...
Functional-ish JavaScript
Functional programming is a great discipline to learn and apply when writing JavaScript. Writing stateless, idempotent, side-effect free code really does solve a lot of problems: It’s easier to test It’s easier to debug It’s easier to reproduce issues But there’s a growing impression in the community that functional programming is an all-or-nothing practice. It’s...
What Making a Cup Of Tea Taught me about Functional Programming.
Like most people, I have a hard time understanding Functional Programming. Following the same path as many others. I spent hours scratching my head watching youtube, reading blogs and attending talks. All in aid off a finding better understanding. But, In a surprise twist. The thing that joined all the confusing dots together was not...
What is better — Functional programming or Object Oriented?
Last week, I found myself caught in the firing range of functional programmers — all because I dared put forward an alternative mode of thinking for JavaScript. This is probably also the first time I’ve ever gotten hate and love mail, public condemnation, accolades and tweets for something that had innocent intentions and origins. Somehow, I also managed to...
Knowing Monads Through The Category Theory
We all know that programming is based on math, what is perhaps not so clear is that knowing more math is going to help us become better developers. And although in all types of programming, math is fundamental, it is even more so in functional programming. A very widespread concept which I’m sure you have...
Why is functional programming gaining traction? Why now?
The biggest companies in the world are investing heavily in functional programming. From Facebook building React and Reason, to Apple pivoting to Swift, to Google developing MapReduce, functional programming is gaining traction. But why? I go over four hypotheses and evaluate them. TRANSCRIPT Eric Normand: Why are the biggest companies in the world investing in...
Friendly Functional Programming
Programming is about solving real world problems, each program describes the different instructions, actions and events “What to do if..?” to deal with some problems. Programming is like creating a life style following some rules which are defined by the programmer. We might be the author of the life story of someone who trusted us...