The power of rethinking: functional programming is trending
The concept of functional programming has been around for a long time, but it is currently enjoying a comeback. Felix, a developer at ING in Germany, sees good reasons for that: “Functional programming is particularly suitable for current trends like parallel computing or global web services. And these trends are set to become even more important in the future.” That’s why Felix passionately promotes this approach in his lectures – of course, he also uses the methodology daily as a developer at ING. Read on for insights into this new paradigm for programmers.
As so often the case in 2020, "corona" was to blame. ING developer Felix had to put his functional programming lectures on hold. All the IT conferences at which he wanted to present it were cancelled or postponed. But the relevance of the topic is more critical than ever. Especially since the trending topic is relatively unknown to many teams, and often barely touched on in educational settings. Still, "functional programming is unmistakably the future," says Felix. "It can help make a large proportion of the current problems we have in software development disappear.” And it can even be used within established Java ecosystems.
Back to the function: a relevance renewed
Functional programming – why now, or why only now? As explained by Felix, the approach has been around since the 1940s. It harks back to the field of mathematics, with pioneers such as David Hilbert, Kurt Gödel, Alan Turing and Alonzo Church. “But the time was not ripe,” Felix points out, “The technology was not mature enough, so it was a dry research topic.” In the meantime, almost everything has changed, and the ideas behind it are becoming common practice – thanks to increased computing power and storage capacity, but also due to new requirements for scaling and parallelization. And that is precisely where functional programming shows impressive advantages over the object-oriented approach that has been dominating the industry since the 1980s.
A paradigm shift
While it is nothing new, functional programming requires quite a lot of rethinking on the part of programmers. “It’s a complete paradigm shift,” emphasizes Felix Functional languages like Haskell do not consist of commands; they are pure mathematical functions. Variables are unchangeable, and external conditions do not play a role. Object-oriented programming in "imperative" languages like C and Java is characterized by encapsulated objects and procedural command logic. This has its advantages, e.g. as visual objects facilitate the mapping of systems. And we know the usefulness of the imperative approach from baking recipes, which also consist of a sequence of commands: take flour, add milk, etc. In contrast, the functional approach initially seems strange to many Java programmers, and that’s not just because of the unfamiliar terminology. In the functional world, no command lists are processed. Instead, functions are executed, whereby functions can also have function values and be recursively nested.
Scaling, parallelization, type systems
A central point of the functional paradigm is the avoidance of “side effects”. “Side effects are a basic problem of the imperative approach”, says Felix: “Data is stored in memory – and changed. And this change often makes parallelization difficult, but parallelization is needed today. A number of processor cores are already at work in a smartphone. Parallelization is also important for the provision of web services. A functional program, however, does not change data, but creates new data in the memory. This avoids typical “concurrency” problems like “data races” or synchronized blocks. That’s good for speed and scalability, because no data blocks have to be locked. Testing is also easier. Functional type systems ensure that many errors can already be eliminated during programming. That’s much better than discovering the first problems during runtime, which may require urgent service over the weekend.
Applications and recommendations
Imperative vs. functional – for ING developer Felix, this is not a question of either/or: "The imperative paradigm is not at risk! For tasks with step-by-step logic, it will remain the approach of choice in the future. But for other tasks, functional programming is simply better. In fact, it is long-proven in business. In 1987, Ericsson developed the functional language Erlang for telecom applications – where high availability and parallelism count. Fortunately, interested developers do not necessarily have to learn a purely functional language. The style can also be implemented in the Java ecosystem. Java itself has been functionally enhanced. According to Felix, a more elegant alternative to the Java Runtime Environment is the Kotlin language: "It is like a better Java.” Kotlin is easy to learn, it is supported by Google, and it’s even the preferred language for Android development since 2019. In his development work for ING, Felix uses the functional Java business library VAVR in addition to Kotlin. Learning about functional programming is a fundamental benefit for every developer: rethinking teaches the brain to remain open to new solutions.
Programming for ING
The IT working environment at ING is constantly evolving, as evidenced by Felix and his passion for functional programming – a supposedly academic approach that is now suddenly more relevant than ever. At ING, IT experts are encouraged to think outside of the box. It is no ordinary financial institution, but an innovative universal bank with a dynamic digital strategy. ING is constantly looking for new staff at its Frankfurt a.M. and Nuremberg locations and is an attractive opportunity for ambitious IT professionals: agile structures, a global IT community within the ING Group, a generous training budget and the freedom to pursue one’s own further development, such as attending conferences. Felix will present his lecture as soon as possible at one of the many postponed conferences that will finally take place once "corona" is under control. Everything else about IT careers at ING can be found on the ING jobs page.