Photo by Tomas Sobek on Unsplash

Erlang has a reputation of featuring a kind of syntax that begs for sugar so desperately, that it led to importing goodness from Ruby, and eventually inventing the Elixir language. However, for someone coming from ML languages, like OCaml or Haskell, it may even feel familiar.

In this article I peek into what this language is about, what’s the buzz around it, and how it tries to deceive the unsuspecting developers sometimes.

From the Lab into your Palm

The research for a programming language particularly suitable for implementing telecommunication solutions is started some 40 years ago at the Ericsson Computer Science Laboratory. Prolog — the logic…

Photo by Joao Tzanno on Unsplash

I’m a software developer for long. Approaching a magic number once again, I started to ponder what lessons I may have learned. Others might have their own story, but I have my own perspective too. Here’s is a list of the things I wish someone would have told me before I jumped on the software developer bandwagon.

Nobody teaches you how to apply things in practice

Because they can’t. No matter how sophisticated use cases your educators come up with, you’ll still be alone facing problems when you get hired by a company. They hired you to cope with such challenges, and not your mentors. And those challenges are…

Photo by Dylan Ferreira on Unsplash

The concept of higher-order functions is key in Functional Programming, but like recursive functions, they are also used to implement certain algorithms, programming patterns, or even writing kernel drivers. Although C is not the language that supports many FP concepts out of the box, higher-order functions can be implemented using function pointers and also with compiler support. In the present article, I attempt to illustrate this with easy to follow examples.

What kind of animal is a higher-order function?

A higher-order function is a function that accepts other functions as arguments or returns a function itself. Since C relies heavily on use of pointers, it also allows such…

This is the fifth part of a series of articles about Functional Programming in PHP. Previous parts:

Function Composition
More Functions

The Reluctant Code

You won’t admit you love me.
And so how am I ever to know?
You only tell me
Perhaps, perhaps, perhaps.

Photo by Matt Seymour on Unsplash

So far we only saw strong-minded functions that are explicit and resolute. It turns out that our code also can be reluctant. And by that I don’t mean reluctant to reveal the exact location and source of bugs in our program. We know that way too well. …

Photo by Tiffany Anthony on Unsplash

This is the forth part of a series of articles about Functional Programming in PHP. Previous parts:

Function Composition

The first Functional Programming language, Lisp, derives its name from ‘LISt Processing’. Working with lists is a fundamental concept in FP. Imagine your favorite necklace of pearls and the reassuring feeling of moving your fingers through it one by one. This simple activity has such an enormous effect, that the string of beads happens to appear in various spiritual practices of major world religions form Buddhism to Christianity.

We will delay on this concept a bit as a means…

Photo by Joshua Sortino on Unsplash

TIOBE — the software quality company — has just released its latest (April, 2021) statistics on the popularity of programming languages, the so-called TIOBE Index. They collect the data from several sources in parallel and update the list monthly. According to them, this list is intended to help developers and system engineers to decide which programming language to apply in a certain area, which can be considered a reasonable choice on a given field, which one to keep oneself updated with, or learn next, and which one to base your new project on.

Probably the most valuable outcome of populating…

Photo by Марьян Блан | @marjanblan on Unsplash

This is the third part of a series of articles about Functional Programming in PHP. Previous parts:


The Zen of modularity

If we ever want to reuse our code, we need to divide it into smaller chunks, that have well defined responsibility, and keep those parts modular enough to be considered building blocks for a bigger structure. We may have the first hand experience that balancing pebbles on top of each other at the river bank is considerably more of a challenge than building a wall from angular bricks.

It’s not enough to have building blocks that have uniform shape, because some…

Photo by Sharon McCutcheon on Unsplash

In the previous article we walked through the foundations of Functional Programming (FP) in PHP. This was by far not a comprehensive introduction, but rather mentioned the most important concepts of FP along with the PHP features, that are necessary to start applying FP in PHP as soon as possible. In this part I assume you’re already familiar with those basics mentioned in the introduction, and I will drop more concepts in as we proceed with currying.

Spicing your code up

Although it sounds fancy, currying has actually nothing to do with your favorite turmeric mix, but derives its name from the American mathematician…

Photo by DongGeun Lee on Unsplash

Why Functional Programming?

The web is getting filled with articles praising Functional Programming (FP), sometimes even starting with whipping Object Oriented Programming (OOP). Although the paradigm started to gain some momentum lately, there’s nothing new about it, considering it’s been around for 60+ years. You read that number right, FP may be older than your ma. So why is all the hype happening all of a sudden? Have the people of internet just reinvented the wheel? Does it take them so much time to learn a programming paradigm? But the OOP term itself is coined well after FP.

It’s not that anybody prevented…

Viktor Daróczi

A seasoned web developer nomad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store