There are multiple programming paradigms that have their own set rules forhow code should be written. Programming languages utilize one or multiple ofthese paradigms. In this thesis, we will compare object-oriented programming,that is the most used today with languages such as C++ and Java, and functionalprogramming. Functional programming was introduced in the 1950's butsuered from performance issues, and has not been used much except for in theacademic world. However, for its ability to handle concurrency and big data,functional programming is of interest in the industry again with languages suchas Scala. In functional programming side effects, any interaction outside of thefunction, are avoided as well as changing and saving state. To compare these paradigms we have chosen four dierent algorithms, whichboth of us have implemented twice, once according to object-oriented programmingand once according to functional programming. All algorithms were implementedJavaScript. JavaScript is a multiparadigm language that supportsboth functional and object-oriented programming. For all implementations,we have measured development time, lines of code, execution time and memoryusage. Our results show that object-oriented programming gave us betterperformance, but functional programming resulted in less code and a shorterdevelopment time.
Identifer | oai:union.ndltd.org:UPSALLA1/oai:DiVA.org:bth-14717 |
Date | January 2017 |
Creators | Svensson Sand, Kim, Eliasson, Tord |
Publisher | Blekinge Tekniska Högskola, Institutionen för programvaruteknik, Blekinge Tekniska Högskola, Institutionen för programvaruteknik |
Source Sets | DiVA Archive at Upsalla University |
Language | English |
Detected Language | English |
Type | Student thesis, info:eu-repo/semantics/bachelorThesis, text |
Format | application/pdf |
Rights | info:eu-repo/semantics/openAccess |
Page generated in 0.0013 seconds