Data Manipulation with functional programming and queries in Ballerina

Click for: original source

As an adept at Functional Programming (FP), I feel at ease with expressing my data manipulation logic by chaining high order functions like map, filter, and sort operating on arrays and maps. Ballerina, being designed as a Data-Oriented programming language, supports this FP style of coding. By Yehonathan Sharvit.

The main points from the article:

  • Ballerina has been designed as a Data-Oriented programming language and supports a functional programming coding style
  • Expressing data manipulation logic with functions can be powerful
  • Using arrow functions with type inference can make code compact and clear
  • Ballerina query language is similar to SQL in the sense that a query expression is made up of clauses. Data manipulation expressed with Ballerina query language is easier to read in comparison with other functional programming expressions
  • Ballerina “Table” data structure can be more effective than maps in representing indexed data collections

Ballerina query language is similar to SQL in the sense that a query expression is made up of clauses, like select, from, where, order by, join, etc… But, unlike in SQL, we are not limited to SQL operators to express our custom business logic: we are allowed to use any function inside our queries. Moreover, the Ballerina query language syntax makes it very convenient to manipulate data as it deals with records. Good read!

[Read More]

Tags app-development programming database functional-programming mysql