Linux Format

So you think you’re important?

-

Functional programmin­g has become popular in the past few years. You use it to describe what you want to do, such as applying an operation to all the elements of an array, instead of describing how to get what you want, like creating a ‘for’ loop to visit all the elements of an array.

The biggest advantage of the functional programmin­g paradigm is that you’ll learn a new way of thinking and solving problems, and it will make your code smaller and more concise. Functional programmin­g is suited for concurrenc­y mainly because the compiler takes care of most operations that require the use of a state variable. So you can reuse your functions and modules because you know that they don’t have side-effects as is the case with object oriented and functional programmin­g languages.

Another advantage of functional programmin­g is that it offers an easier method of debugging because the code is simpler. Finally, functional programmin­g offers easier testing: if a subprogram works today, it’ll work all the time.

Programmin­g languages such as Erlang and Elixir, which uses the Erlang VM just like Kotlin uses the Java VM, are perfect for developing server applicatio­ns. But they can’t develop Android applicatio­ns, which is where Kotlin can help. So, always use the best tool for the job!

Bear in mind, however, that a bad developer can write bad code in any programmin­g language. So don’t think that a programmin­g language or a programmin­g paradigm can save you from bad code!

Newspapers in English

Newspapers from Australia