Logo
Nazad
D. Alic, S. Omanovic, Vaidas Giedrimas
9 1. 5. 2016.

Comparative analysis of functional and object-oriented programming

The choice of the first programming language and the corresponding programming paradigm is an important part of the software development process. Knowing the advantages and constraints of individual programming paradigms is important as it can be crucial for successful software implementation. In this paper we conduct an empirical comparison of functional and object-oriented programming languages using analog examples in C#, F#, Haskell, and Java. Three algorithms were implemented: algorithm for solving N queens problem, algorithm for generating n-th left-truncatable prime and merge sort algorithm in C#, F#, Haskell and Java programming languages. An overview of programming languages efficiency is given by measuring two basic parameters: number of lines of code and program execution speed. Also, system resource usage is monitored during execution. Limited experiments showed that the programming language Java is faster than the other three languages whose performances were measured. Java was surprisingly fast on these problems that are more suitable for functional programming languages. Haskell was less memory intensive (up to two times less than Java) with similar execution times, while .NET languages were slower up to four times in comparison to Java. Object-oriented languages C# and Java had significantly more lines of code for all three algorithms when compared to functional programming language Haskell and the hybrid one F#.


Pretplatite se na novosti o BH Akademskom Imeniku

Ova stranica koristi kolačiće da bi vam pružila najbolje iskustvo

Saznaj više