0% found this document useful (0 votes)
7 views

Functional Programming

Uploaded by

lilskit4life
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Functional Programming

Uploaded by

lilskit4life
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Question 1: Functional programming focuses on computation as the evaluation of mathematical

functions. It emphasizes first-class functions, pure functions, unit testing debugging and more.
The functional programming languages rely on recursion for iteration (Bhadwal, 2019).
JavaScript, Closure and Scala are a few languages supported by functional programming. The
functional paradigm influences the organization of code by promoting the use of pure functions
and immutability, which leads to cleaner, more predictable code that is easier to understand and
maintain. This approach to problem-solving emphasizes breaking down complex tasks into
smaller, reusable functions, enabling more efficient and modular development while reducing the
likelihood of side effects and bugs.ne well-known example of functional programming is
Haskell. Haskell is a purely functional programming language that emphasizes immutability,
first-class functions, and strong static typing. (Yatsko & Suslow, 2016).

Structured programming highlights programming and expression evaluation (Yatsko &


Suslow, 2016). It aims to improve code clarity, maintainability, and efficiency by organizing
code into clear, manageable structures. Some of the core principles of structured programming
include selection, iteration, modularity and so on. (Yatsko & Suslow, 2016) One example where
the structured paradigm is operative is when it comes to object oriented programming, it
encourages the use of classes and objects to encapsulate data and behavior. This leads to better
organization of code by grouping related functionality together. (Bhadwal, 2019).

Object-Oriented programming focuses on the use of programming with data types


(Yatsko & Suslow, 2016). OOP focuses on bundling data into objects to encourage modularity
and reusability. This method promotes problem-solving through abstraction simplifying the
understanding and management of complex systems. For example, in a banking application, a
`Customer` class might contain customer data and account management methods, allowing
interactions with customer objects instead of directly handling data structures, thus improving
clarity and maintainability. (Bhadwal, 2019)

Question 2: Imagine you are tasked with designing a new software solution. Discuss the steps
you would take in the problem analysis and design phases to ensure the efficiency and resilience
of the final product. Highlight specific design principles and methodologies you would apply and
explain their importance.

I would follow a structured software approach during the problem analysis and design
phases to ensure the final product is both efficient and resilient. Here are the steps I would take:

Step One - Engaging Stakeholders: Engage stakeholders through interviews and surveys
to gather functional and non-functional requirements and highlight business goals. (Yatsko &
Suslow, 2016) Engaging with users and stakeholders ensures that the software meets actual
needs and expectations, reducing the risk of costly changes later in the project.

Step Two - Modular Design (software): Use Case Diagrams: Create use case diagrams to
visualize interactions between users and the system. Implement a modular design plan and
principle (SRP) where each module handles a specific task. Decide on modularity of software, on
the possible need to use libraries, frameworks, design patterns and so on.

Step Three - Implementation (coding): I would prioritize writing clean, well-documented


code following coding standards and best practices. This practice not only improves code quality
but also helps in identifying issues early in the development process. (Yatsko & Suslow, 2016)

Step Four - Testing (Validation): For testing, I would implement a Test-Driven


Development (TDD) approach, where tests are written before the actual code. This practice
ensures that the code meets specified requirements and reduces the likelihood of defects. This
methodology promotes writing tests before code, enhancing software reliability and encouraging
better design decisions.

Step Five - Deployment (installation): In the deployment phase, I would ensure that the
software is packaged and configured correctly for various environments. This approach
minimizes human error, ensures consistency, and allows for rapid updates, facilitating a
smoother release cycle. (Yatsko & Suslow, 2016)

Step Six - Maintenance: Final phase would be maintenance (retirement would be the end
of the steps entirely) is critical for addressing any issues that arise post-deployment and for
adapting to changing user needs. Applying the agile methodology in the maintenance phase helps
teams respond quickly to user feedback and evolving requirements.

How does the use of higher-order functions in functional programming contribute


to code modularity and reusability?

Thanoshan MV (2019, November 12). What exactly is a programming paradigm?.


freeCodeCamp.org. https://www.freecodecamp.org/news/what-exactly-is-a-programming-
paradigm/

Yatsko, A., & Suslow, W. (2016). Insight into theoretical and applied informatics :
Introduction to information technologies and computer science. Walter de Gruyter GmbH.

Akhil Bhadwal. (2019). Functional Programming: Concepts, Advantages,


Disadvantages, and Applications

You might also like