Programming Languages and Paradigms

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Name: Lance A.

Elizalde Date: October 9, 2023


Address: Bitaug, Enrique Villanueva, Siquijor
Course and Year: BS Info Tech II

Programming Languages and Paradigms


Programming languages are formal systems used to instruct computers and
other machines to perform specific tasks or operations. These languages consist of a
set of rules, symbols, and instructions that enable programmers to write code that
the computer can understand and execute.
Some common programming languages include Python, Java, C++,
JavaScript, Ruby, and many others. Each language has its strengths, weaknesses,
and areas of application, making them suitable for various types of programming
tasks and domains. Programmers select the appropriate language based on the
requirements of the project and their familiarity with the language's syntax and
features.
Programing paradigms are the theories or ideas that help to shape the
different languages that you use to create software. They represent the major
characteristics of a programming language, dictating its behavior. It is, therefore,
safe to say that a paradigm is just as important as a programming language’s syntax
and semantics. Most popular programming languages use one of a few types of
programming paradigm.

1. Imperative Programming Paradigm


The imperative programming paradigm uses a sequence of statements to
modify a program's state through the use of variables. The goal of the imperative
paradigm is to specify how a program should execute through explicit instructions
It's common to see imperative programming compared to declarative
programming, which is the philosophy behind languages where the programmer
specifies what to do, rather than how to do it.
If this is confusing, for now consider this: a cookbook instructs step-by-step
how to cook a recipe, a restaurant menu shows what you can order, and you
don't need to worry how it's made.
The imperative paradigm serves as the basis for later paradigms like the
structured, procedural, and object-oriented paradigms.
Imperative programming is divided into three broad categories: Procedural,
OOP and parallel processing. These paradigms are as follows:
A. Procedural programming paradigm
Procedural programming is all about breaking down your code into reusable
chunks called procedures. The idea is to split big projects into smaller parts so
that teams of developers can work on them simultaneously.
Think of it like building a complex Lego structure. You create smaller Lego
pieces (procedures) that can be easily put together to build something bigger. It's
like organizing your work into manageable blocks.
Procedural programming is often seen as a more advanced form of structured
programming, even though it actually came first. This is because they share
many similarities, and procedural programming can be thought of as a step
forward in how we structure our code for larger and more organized projects.
B. Object oriented programming
Object-Oriented Programming (OOP) is a way of writing code that focuses on
organizing data and actions into neat packages called "objects." Think of an
object as a small, self-contained program unit that has its own data (attributes)
and can-do things (methods).
In OOP, these objects can chat and collaborate with each other by asking for
help or sharing information. For example, if you have an object representing a
car, it can talk to an object representing an engine to make the car go.
OOP also loves to organize things in families. Imagine you have a "vehicle"
object, and you want to create a "car" object that has some stuff in common with
the "vehicle." With OOP, you can do that easily by making the "car" inherit
qualities from the "vehicle" like a family tree. This way, you don't have to write
everything from scratch for each new thing you want to create.
So, OOP helps keep code neat, lets objects work together, and makes it
simple to create new things that share traits with existing ones. It's like building
with Lego blocks where you can connect and extend your creations easily.
C. Parallel processing approach
Parallel processing is a computing technique that allows multiple streams of
calculations or data processing tasks to occur through numerous central
processing units (CPUs) working concurrently. It is an essential technique in
contemporary system operations, supporting multiple streams of data processing
tasks through multiple CPUs working concurrently.
Parallel processing uses two or more processors or CPUs simultaneously to
handle various components of a single activity. Systems can slash a program’s
execution time by dividing a task’s many parts among several processors. Multi-
core processors, frequently found in modern computers, and any system with
more than one CPU are capable of performing parallel processing. For improved
speed, lower power consumption, and more effective handling of several
activities, multi-core processors are integrated circuit (IC) chips with two or more
CPUs.
There are different types of parallel processing techniques, including task
parallelism, data parallelism, and pipeline parallelism.
 Task parallelism involves dividing a task into smaller sub-tasks
that can be executed simultaneously by different processors.
 Data parallelism involves dividing data into smaller chunks and
processing them simultaneously on different processors.
 Pipeline parallelism involves dividing a task into smaller sub-
tasks that are executed in sequence by different processors.
Parallel processing has numerous applications in real-world use cases. For
example, it is used in scientific simulations, weather forecasting, financial
modeling, and machine learning.
2. Declarative programming paradigm
The Declarative Paradigm is centered on the idea that code should describe
what the desired outcome of a program should be, rather than how to obtain the
outcome. This contrasts with the imperative paradigm, which centers itself on the
programmer writing explicit instructions to achieve a desired result.
More formally, the declarative paradigm focuses on expressing logic without
using control flows, i.e., if/else and loop statements. Declarative languages often
use a style that results in few side-effects, if any. This is usually a natural
consequence of not needing to specify explicit steps to solve a problem.
Popular examples of declarative languages are database query languages
such as SQL, markup languages like HTML and CSS, and in functional and logic
programming languages.
Side Effects
A function is known to cause a side-effect if it modifies a state that exists
outside the immediate function scope. For example, changing the global state of
your program is considered a side effect, in addition to changing the state of a
variable passed by reference. I/O operations to read and write from files are also
known as side effects!
A. Logic programming paradigms
Logic programming languages were first developed in the 1960s within
academic circles. They were originally created to explore knowledge
representation and artificial intelligence. Logic programming is a type of
declarative programming that relies on a formal logic known as Predicate
Calculus.
In declarative languages, like logic programming, you specify what you want
the program to achieve without detailing how it should be done. Instead, the
language itself figures out the precise steps to achieve the desired result.
It's essential to note that logic programming is not the same as programming
logic, which is a broader study of how logical rules apply in computer
programming.
In logic programming, programs are entirely data-driven and typically don't
contain traditional if-then-style logic. Instead, they use logical statements called
"predicates," which fall into two categories: facts and rules. Predicates have a
head (what you're interested in) and may also have a body (conditions that must
be met). The language's job is to determine the appropriate outcome based on
these logical statements.
B. Functional programming paradigms
Functional programming is a programming paradigm that emphasizes the use
of pure functions to solve problems. It is a declarative style of programming,
which means that it focuses on "what to solve" rather than "how to solve".
In functional programming, everything is a function. The functions are isolated
and independent of the state of the application. The main focus is on binding
everything in pure mathematical functions style. It uses expressions instead of
statements. An expression is evaluated to produce a value whereas a statement
is executed to assign variables.
Functional programming is based on Lambda Calculus, which is a framework
developed by Alonzo Church to study computations with functions. It provides a
theoretical framework for describing functions and their evaluation. It forms the
basis of almost all current functional programming languages.
Some of the concepts of functional programming include:
Programming languages that support functional programming include Haskell,
JavaScript, Python, Scala, Erlang, Lisp, ML, Clojure, OCaml, Common Lisp,
Racket.
 Pure functions: These functions have two main properties. First, they
always produce the same output for same arguments irrespective of
anything else. Secondly, they have no side-effects i.e., they do not
modify any arguments or local/global variables or input/output streams.
Later property is called immutability. The pure function’s only result is
the value it returns. They are deterministic.
 Recursion: There are no “for” or “while” loop in functional languages.
Iteration in functional languages is implemented through recursion.
Recursive functions repeatedly call themselves, until it reaches the base
case.
 Referential transparency: In functional programs variables once
defined do not change their value throughout the program. Functional
programs do not have assignment statements.
C. Database processing approach
A database processing approach refers to the way in which data is
manipulated and managed within a database system. There are several different
approaches that can be used depending on the specific needs and requirements
of the system.
One common approach is the relational database approach, which organizes
data into tables with rows and columns. This allows for efficient data retrieval and
manipulation using SQL (Structured Query Language) commands.
Another approach is the object-oriented database approach, which stores
data as objects with attributes and methods. This approach is useful for complex
data structures and applications that require extensive data manipulation.
A third approach is the NoSQL database approach, which is designed for
handling large-scale, unstructured data sets. This approach uses non-relational
data models and can be highly scalable and flexible.
In conclusion, programming languages and paradigms are fundamental
components of the software development landscape, shaping how developers
create, structure, and manage code to achieve specific tasks. Programming
languages provide the syntax and tools for instructing computers, with each
language offering its own strengths and suitability for various applications.
Programming paradigms, such as imperative, declarative, logic, and functional
programming, dictate the overarching philosophy behind languages and guide the
programmer's approach to problem-solving. Imperative programming focuses on
explicit instructions and state modification, while declarative programming
emphasizes specifying outcomes rather than explicit steps. Logic programming relies
on formal logic and facts/rules to derive results, and functional programming employs
pure functions and immutability to ensure predictable and efficient code execution.
Each paradigm brings its unique advantages and is chosen based on the
project's requirements and the developer's preference. Additionally, database
processing approaches, such as relational, object-oriented, and NoSQL databases,
play a critical role in how data is stored and manipulated within applications, offering
various solutions to meet different data management needs. In the ever-evolving
world of software development, understanding these languages and paradigms
empowers developers to choose the right tools and methodologies for their projects,
ultimately leading to more efficient, maintainable, and innovative software solutions.
Development tools and environments
Development tools and environments refer to the software, hardware, and
settings that software developers use to create, test, debug, and deploy software
applications. These tools and environments provide the necessary infrastructure and
resources for developers to efficiently write and manage code.
What is a development environment?
A development environment is a collection of procedures and tools designed
to develop, test and debug an application, program or website. It usually comprises
three server tiers, which individuals in software development typically collectively
refer to as DSP. They are:
Development server: The initial tier, in which developers test pieces of code
and see whether the application can successfully run while using that code. If,
after a series of tests and analyses, the developers conclude that the new
code integrates well within the application, it then moves on to the next tier.
Staging server: Developers create the environment within the staging server
in a way that mimics the final product. They use the staging server to test the
application and assess its reliability, then deploy it on a production server
once it receives approval.
Production server: This is the last component of the environment. Once the
developers determine that the application is successful, they implement it on
the server.
What is an integrated development environment?
An integrated development environment (IDE) is a software application that
helps programmers develop software code efficiently. It increases developer
productivity by combining capabilities such as software editing, building, testing, and
packaging in an easy-to-use application. Just as writers use text editors and
accountants use spreadsheets, software developers use IDEs to make their job
easier.
While it's possible to write code using any text editor, the use of integrated
development environments (IDEs) offers distinct advantages that go beyond mere
text editing. IDEs serve as comprehensive platforms that streamline the software
development process by centralizing various developer tools. This not only
accelerates the development of new applications but also eliminates the need for
manual integration and configuration of disparate software tools. Here are some
compelling reasons why developers prefer to use IDEs:
Code Editing Automation:
IDEs possess an understanding of the rules governing programming
languages, enabling them to offer intelligent features for automating code writing and
editing tasks.
Syntax Highlighting:
IDEs enhance code readability by automatically applying formatting, such as
making keywords bold or using different font colors. These visual cues provide
instant feedback on potential syntax errors.
Intelligent Code Completion:
IDEs offer suggestions to complete code statements as developers type,
significantly speeding up the coding process.
Refactoring Support:
IDEs assist in code refactoring, the process of improving code efficiency and
readability without altering its core functionality. This promotes code maintainability
and team collaboration.
Local Build Automation:
IDEs boost developer productivity by automating repetitive development
tasks, including compilation, testing, and debugging:
 Compilation: IDEs convert code into a format understood by the operating
system, with some languages utilizing just-in-time compiling.
 Testing: Developers can automate unit tests locally, ensuring code quality
before integration with other team members' work.
 Debugging: IDEs facilitate the debugging process by allowing developers to
step through code line by line, providing real-time feedback on errors, even as
they code.
What are development tools?
A software development tool is a computer program used by software
developers to create, edit, manage, support, and debug other applications,
frameworks, and programs. These tools are also commonly referred to as software
programming tools. Examples of software development tools include linkers, code
editors, GUI designers, performance analysis tools, assemblers, and compilers.
Development tools are essential in the software development process for several
reasons:
1. Productivity: By using these tools in the software development
process, the outcome of the projects will be more productive.
2. Workflow Maintenance: Using the development tools, a developer
can easily maintain the workflow of the project.
3. Quality Code: Developer tools include software, platforms, and add-
ons that enable developers to write high-quality code more efficiently.
4. Mobile Application Development: Mobile application development
tools help build, design, develop, test and launch a mobile app for
different devices and operating systems.
5. Web Browser and Web Apps: The Chrome Developer Tools give
developers access to the internal workings of the web browser and
web apps.
There are many software development tools available in the market today.
Some of the best software development tools include:
1. Embold: A software analytics platform that helps developers fix bugs before
deployment.
2. Linx: A low-code tool to build and automate backend applications and web
services.
3. Zoho Creator: A platform that allows users to build powerful enterprise
software applications 10x faster.
4. ClickUp: A project management tool that features advanced bug and issue-
tracking capabilities, superb sprint management, automation at the core, and
seamless collaboration.
5. GitHub: A cloud-based software development tool that provides version
control functionality for developers.
6. Azure: A cloud computing service that provides a wide range of services for
building, deploying, and managing applications.
Development tools, like any other tools, have their pros and cons. Here are some of
them:
Advantage Disadvantage
Efficiency: Development tools can greatly Learning Curve: Each tool has its own
increase the efficiency of software features and usage, so developers need to
development by automating repetitive spend time learning how to use them
tasks. effectively.
Quality Control: Tools like debuggers and Dependency: Over-reliance on tools can lead
compilers help maintain high standards of to a lack of fundamental programming skills.
code quality.
Collaboration: Many development tools Limitations: Every tool has its limitations and
facilitate collaboration among team may not be suitable for every project or team.
members, making it easier to work on large
projects.
Flexibility: Some development Cost: Some advanced development tools are
methodologies allow for changes at any expensive, which might be a barrier for small
stage of the project without delaying the teams or individual developers.
completion date.

In conclusion, development tools and environments are integral to modern software


development, providing the necessary infrastructure, automation, and efficiency that
developers rely on to create high-quality software. Integrated Development
Environments (IDEs) streamline the coding process, while various other
development tools enhance productivity, code quality, and collaboration. However,
developers should strike a balance between tool usage and fundamental
programming skills to avoid over-dependency, and carefully consider the suitability
and cost of tools for their specific projects and teams.
Version Control and Collaboration Tools
What is version control?
Version control, also known as versioning or source control, is the practice of
managing changes to source code. It’s about keeping a detailed account of every
modification made to the code, ensuring that these changes are both trackable and
reversible. A crucial tool in every developer’s kit, version control systems are the
bedrock of this process.
Why version control matters in software development
Version control plays an integral role in both software development and
project management. The tracking and versioning of source code changes in the
repository form the heart of this process.

Let’s highlight three key reasons why version control is important to both
software developers and product/project managers:
1. Streamlined release management
One key advantage of version control is its facilitation of release
management. It helps in maintaining different versions of software releases.
These releases encapsulate various enhancements and features developed for
different customers, aligning with the release roadmap.
2. Conflict prevention
Version control helps avoid code conflicts within the source code base. By
maintaining separate branches for different releases, it minimizes the chance of
changes overlapping and causing conflicts.
3. Tracking changes to digital artifacts
In addition to source code, version control helps track changes to other
digital artifacts involved in software development. This could include technical
design specifications, requirement documents, or any other deliverables that may
be subject to multiple iterations.
Types of version control
Version control systems come three main forms, each with its own set of
advantages and drawbacks:
1. Local version control
In local version control, changes are stored locally in the files as a hotfix or
patch before being pushed to a single version of code in a database. If any local
versions or the single code version become corrupted, retrieving changes can be
a challenge.
2. Central version control
Central version control hosts different versions of the code in a centralized
repository. Users can access these versions, and push or pull changes as
needed.
However, if the centralized repository becomes corrupted, retrieval can be
difficult.
3. Distributed version control
Distributed version control is the most sophisticated of the three. Here,
each local repository fully mirrors the central repository, including its history.
This means that even if the central repository becomes corrupted, it’s not a
problem. Any local servers can send a copy of the history and repository to other
local servers or back to the central server.

Benefits of version control in project management


Version control isn’t just a tool for developers. It’s a powerful solution that can
revolutionize how you manage projects, regardless of industry. It offers a structured,
systematic, and reliable way to track changes in your project files, making it easier to
maintain a consistent workflow and enhance collaboration among your team
members.
Let’s examine some of the key benefits that a version control system can
bring to your team and its projects:
Maintaining the latest version of all files: Version control ensures that everyone
on your team is always working from the latest version of any file or document. This
means you don’t have to worry about conflicting changes, duplication of work, or
errors stemming from outdated versions
Preserving a history of changes: With version control, you can see what changes
were made to a file, who made them, and when. This is useful for understanding the
evolution of a project and can be particularly valuable for auditing purposes
Facilitating collaboration: Version control allows multiple people to work on the
same file at the same time without overwriting each other’s changes. This makes it
an excellent tool for facilitating collaboration and improving efficiency
Preventing data loss: In the event of a mistake or an unexpected problem, version
control allows you to easily restore previous versions of a file. This can be a lifesaver
when it comes to preventing data loss
Increasing transparency and accountability: By tracking who made which
changes and when, version control increases transparency and accountability within
your team
Simplifying code management: Version control provides a clear history of changes
by not only recording the changes made but also tagging them with timestamp
information. This traceability makes it easier to understand the evolution of the code
over time
Identifying conflicts: Version control is instrumental in identifying and rectifying
incompatible changes before the code reaches the customer environment. This
proactive approach reduces errors and enhances the overall quality of the software
product
Popular version control systems and tools
Here’s a brief overview of some commonly used version control tools and their pros
and cons:
SVN — SVN, short for Subversion, is a centralized version control tool. While
it’s more advanced than local version control, it carries a risk: if the central
repository becomes corrupted, it’s difficult to retract the changes
TFS — Team Foundation Server (TFS) by Microsoft is also a centralized
version control system, sharing the same limitations as SVN. When coupled
with Azure DevOps, however, it can work with GIT to provide a distributed
version control system
Mercurial — This open-source, distributed version control system is preferred
over TFS and SVN because it mirrors the central repository and history in
each local repository, preventing total loss of information and data corruption
Git — Git is a distributed repository version control system similar to
Mercurial. It comes coupled with GitLab (a repository management software)
and GitHub (a platform to upload copies of the repository)
Best practices for implementing version control systems
Adopting version control is a significant step in software development and code
maintenance. If you’re implementing a version control system for the first time, it’s
crucial to follow certain best practices:
 Code submissions to the repository, also known as code commits, should be
at the most granular level of the change and include clear commit messages
 Code branches should support multiple versions of software releases and
patches
The version control system and repository should be compliant, with
considerations for disaster recovery, failover, and access control.
Version management vs. configuration management
While both version and configuration management aid in tracking changes
and improving the reliability of information, they serve different purposes. Version
control is one aspect of configuration management, tracking changes and allowing
visibility into what changes were made, when, and by whom. However, it doesn’t
typically provide insight into why changes were made or how those changes impact
other aspects of the project. That’s were configuration management steps in,
allowing visibility into the impact of changes on other project aspects. It’s mostly
needed for large, complex projects with many interrelated parts.
In conclusion, version control is a crucial practice in software development
and project management, enabling the systematic tracking and management of code
changes and digital artifacts. It ensures streamlined release management, conflict
prevention, and comprehensive tracking of changes, enhancing collaboration and
accountability. Version control systems can be local, centralized, or distributed, with
Git being a widely used distributed system. When implemented correctly, version
control systems improve transparency, data preservation, and code management,
while best practices ensure effective usage and compliance. Configuration
management complements version control by addressing broader project aspects,
making them valuable for large and complex projects.
20 BEST Software Development Tools (2023 Rankings). (2023, August 18). Software
Testing Help. https://www.softwaretestinghelp.com/software-development-
tools/
Declarative Paradigm | Programming Paradigms | DevMaking. (2021).
www.devmaking.com. https://www.devmaking.com/learn/programming-
paradigms/declarative-paradigm/
GeeksforGeeks. (2022). Functional Programming Paradigm. GeeksforGeeks.
https://www.geeksforgeeks.org/functional-programming-paradigm/
GeeksforGeeks. (2023b). Introduction of programming paradigms. GeeksforGeeks.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Imperative Paradigm | Programming Paradigms | DevMaking. (2021).
www.devmaking.com. https://www.devmaking.com/learn/programming-
paradigms/imperative-paradigm/
Kean, K. (2022). The 3 major programming Paradigms You should know. MUO.
https://www.makeuseof.com/programming-paradigms-major/
What is an IDE? - Integrated Development Environment Explained - AWS. (n.d.).
Amazon Web Services, Inc. https://aws.amazon.com/what-is/ide/
What is parallel processing? Types and examples. (n.d.). Spiceworks.
https://www.spiceworks.com/tech/iot/articles/what-is-parallel-processing/

You might also like