Comparative analysis of functional and object-oriented programming | IEEE Conference Publication | IEEE Xplore

Comparative analysis of functional and object-oriented programming


Abstract:

The choice of the first programming language and the corresponding programming paradigm is an important part of the software development process. Knowing the advantages a...Show More

Abstract:

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#.
Date of Conference: 30 May 2016 - 03 June 2016
Date Added to IEEE Xplore: 28 July 2016
ISBN Information:
Conference Location: Opatija, Croatia
References is not available for this document.

I. Introduction

As with the many things in programming languages history, there is an always present debate about which programming paradigm is better and when a specific paradigm should be used [1]–[2]. Even the classification of paradigms itself is often cause for a debate. However, programming paradigms are often classified in six fundamental paradigms: imperative, declarative, object-oriented, functional, symbolic, and logic programming paradigms. Declarative and symbolic paradigms are sometimes left out leaving only four fundamental paradigms [3].

Select All
1.
B. Meyer, “SOFTWARE ARCHITECTURE: OBJECT-ORIENTED VS FUNCTIONAL,” Chapter 13 of Beautiful Architecture, edited by D. Spinellis and G. Cousios, O'Reilly, 2009, pp. 315–348.
2.
S. Nanz and C. A. Furia, “A Comparative Study of Programming Languages in Rosetta Code,” in Proceedings of the 37th InternationalConference on Software Engineering - Volume 1, Piscataway, NJ, USA, 2015, pp. 778–788.
3.
K. Normark, “Functional Programming in Scheme.” [Online]. Available: http://people.cs.aau.dkl=normark/prog'i-03/html/notes/theme-index.html. [Accessed: 02–Feb–2016 ].
4.
J. O. Coplien, “Multi-Paradigm Design,” Ph.D. dissertation, Informatics Dept., Vrije Univ., Brussel, Belgium, 2000.
5.
D. Donko and S. Omanovic, Objektno orijentirana analiza i dizajn primjenom UML notacije, Elektrotehnicki fakultet, Sarajevo, 2009.
6.
Microsoft, “NET Framework Versions and Dependencies.” [Online]. Available: https://msdn.microsoft.com/en-us/library/bb822049(v=vs.110).aspx. [Accessed: 02–Feb–2016 ].
7.
Oracle, “Information about Java 8.” [Online]. Available: https:/Ijava.com/en/download/faq/java8.xml. [Accessed: 02–Feb–2016 ].
8.
A. Scott, “Functional Programming vs. Object-Oriented Programming.” [Online]. Available: http://functionspace.com/topicI1467/Functional-Programming-vs-Object-Oriented-Programming. [Accessed: 02–Feb–2016 ].
9.
D. Wampler and A. Payne, Programming Scala: Scalability = Functional Programming + Objects. O'Reilly Media, 2014.
10.
D. A. Turner, “Some History of Functional Programming Languages ” - An invited lecture given at TFP 12, St Andrews University, 12 June 2012.
11.
T. Kuhne, A Functional Pattern System for Object-Oriented Design, Verlag Dr. Kovac, Hamburg, Germany, 1999.
12.
Basili V.R. ; Selby R.W., “Comparing the Effectiveness of Software Testing Strategies,” in Software Engineering, IEEE Transactions on, vol. SE-13, no. 12, pp. 1278–1296, Dec. 1987
13.
Haskell, “Haskell Language.” [Online]. Available: https://www.haskell.org/. [Accessed: 03–Feb–2016 ]. [Accessed: 03–Feb–2016 ].
14.
Microsoft “Visual C# Resources.” [Online]. Available: https://msdn.microsoft.com/en-us/vstudio/hh341490.aspx. [Accessed: 03–Feb–2016 ].
15.
Oracle, “Java 8 Central.” [Online]. Available: http://www.oracle.com/technetwork/java/javase/overview/java8–2100321.html. [Accessed: 03–Feb–2016 ].
16.
Microsoft “Visual F#.” [Online]. Available: https://msdn.microsoft.com/en-us/library/dd233154.aspx. [Accessed: 03–Feb–2016 ].
17.
G. Hutton, Programming in Haskell, Cambridge University Press, 2007.
18.
M. Leucker T. Noll P. Stevens, and M. Weber, “M.: Functional programming languages for verification tools: Experiences with ML and Haskell,” in In: Proceedings of the Scottish Functional Programming Workshop, 2001.
19.
B. O'Sullivan J. Goerzen D.B. Stewart, Real World Haskell, O'Reilly Media, 2008.
20.
T. Liu, F# for C# Developers, Microsoft Press, 2013.
21.
Oracle, “Lambda Expressions (The Java™ Tutorials> Learning the Java Language> Classes and Objects).” [Online]. Available: https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html. [Accessed: 03–Feb–2016 ].
22.
TIOBE, “TIOBE Software: Tiobe Index.” [Online]. Available: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html [Accessed: 03–Feb–2016 ].
23.
Microsoft, “Lambda Expressions (C# Programming Guide).” [Online]. Available: https://msdn.microsoft.com/en-us/library/bb397687.aspx. [Accessed: 03–Feb–2016 ]. [Accessed: 03–Feb–2016 ].
24.
O. Angell and H. J. Godwin, “On Truncatable Primes,” in Mathematics of computation, AMS, vol. 31, No 177, pp. 265–267, Jan 1977

Contact IEEE to Subscribe

References

References is not available for this document.