"You generate fewer bugs."

Jan Jogen / Functional programming

Good software developers are the backbone of Valtech Mobility. One of the developers, the PhD mathematician Jan Jongen, is working with swarm intelligence and functional programming. In this talk he gives some insight into the somewhat more complex areas of his profession:

What is your role at Valtech Mobility?

As product owner I’m responsible for infotainment and swarm services. In this role I discuss scope and functional requirements with customers. Additionally, I also work on the architecture for the services and support the team in its organizational activities.


How do you define the term “swarm service”?

Services that provide information that has been gathered from communications going on between vehicles. This is of special importance for our next-generation map service that we have developed for one of our customers. In order to have warnings of hazardous or dusty road sections that are as current and precise as possible, we utilize data generated from moving vehicles.


Swarm intelligence is still an exploratory topic. What kind of challenges you are facing?

On the one hand, we have to deal with a huge amount of data – we had more data available than market-leading map providers and the data was also more current and precise. Plus, the customer wanted to have the service implemented quickly. The timeframe for the development was only three months.


How do you handle such a challenge?

In order to be able to develop such a complex service with so many functions within such a short time, we, as a team, quickly decided that this could only be done with a functional programming language.



We had to look for possibilities how to eliminate bugs as early as possible in the development, in particular for concurrent applications – they are not easy to develop and harder to test. In functional programming you avoid side effects, this leads to fewer dependencies in the code and that again means fewer bugs. Typical Java problems are avoided; for example, you won’t get any zero pointer exceptions – e.g. no access to invalid zero values – and no errors by invalid programming states. In a nutshell: You generate fewer bugs.


Which programming languages were used?

At the moment we are using Scala in production. Scala – just like Java – is set up on JVM (Java Virtual Machine) and offers more capabilities from the functional programming world. We use the programming construct of “Futures” for the concurrent functions.


What kind of a construct is that exactly?

Futures stand for values that are not being calculated right now but might be available sometime in the future. Calculations are carried out concurrently with functions. Futures are a powerful programming concept, in particular in combination with calculation pipelines to exploit parallelism. For example, they substitute architectures with call backs ( here procedures are handed over that will be called up at a later point in time) and allow compact and descriptive code. Descriptive code describes the problems to be solved but not every detail of the implementation. This makes the source code very compact.


What would be a typical everyday problem that can be solved by this?

Take for example a search query for POIs and the implementation of a request pipeline to answer this query. Here it is important to analyze the query – let’s take: “gas stations in Dusseldorf” – and then answer it. First the query is broken down: What are we looking for and where? Than we have to determine the relevant providers, since there are a number of external providers for different types of data ( e.g. gas stations, hotels, parking garages). All data providers selected for the query are asked and so we have to eliminate doubles from the results and then prioritize what’s left. From this, an answer will be generated to be sent back to the vehicle. Actually, this is a nice example because this task offers many possibilities for concurrent calculations to have the query answered faster.


How much math is necessary for functional programming?

Actually, everybody can do functional programming. Provided you have the necessary curiosity and an interest in programming abstractions – it’s not rocket science. We see great application potential, in particular for swarm services – and would be happy for additional staff to support us. As a first step, all you have to do is reach out to our Digital Talent Guides.

Open jobs

More Topics