Javascript - OOP VS functional programming

Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.

Functional programming is a programming paradigm, a style of building the structure and elements of computer programs, that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.

OOP says that bringing together data and its behaviour in a single location makes it easier to understand how a program works. FP says that data and behaviour are distinctively different things and should be kept separate for clarity.

Even combining both Javascript and object oriented programming allows developers to write codes that are clean, concise and repeatable. Developers can create small blocks of codes that can then be called again without them having to rewrite the code or copy-paste the code over and over again. OOP JavaScript also offers prototype-based inheritance, over class-based, which allows objects to directly inherit from other objects.

hyrglobalsource– We are experts in identifying legacy IT systems/software and replacing it with high fidelity advanced technologies.

Leave a Reply

Your email address will not be published. Required fields are marked *