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

Lecture 1

Uploaded by

k3537765
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lecture 1

Uploaded by

k3537765
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Programming Fundamentals

CSPF-121

Presented by
Dr. Muhammad Touseef Irshad
Lecture # 01

Department of Computer Science 1


National University of Modern Languages, Peshawar Campus
Language

Definition:

▪ A language is a structured system of


communication used by humans, animals, or even
machines.

▪ It can be spoken, written, or signed and involves


the use of symbols (like words, sounds, or gestures)
to convey meaning.

. 2
Language

▪ The structure of language typically follows rules of


grammar and syntax that allow individuals to
combine symbols in a way that can be understood
by others.

3
How to Communicate with a Computer?

▪ A computer cannot understand any commands


that you may give in English or in any other
language.

4
How to Communicate with a Computer?

▪ It has its own set of instructions for


communication, or what we call computer
languages.

▪ As computer is a machine so we need some


machine language to communicate with it.

5
Computer Language

Definition:

▪ A computer language is a formal language


designed to communicate instructions to a
computer.

▪ It includes the syntax and rules that dictate how


code is written and executed by the computer.

▪ Computer languages are the tools that humans use


to write programs. 6
Code

Definition:

▪ Code refers to the human-readable text or set of


statements written in a programming language.

▪ It is the raw material from which programs are


made.

▪ Code can refer to anything from a few lines of


script to entire blocks or even entire applications.
7
Code

▪ The entire C++ snippet above is the code that


produces the "Hello, World!" output.

▪ It contains several lines that tell the computer what


to do. 8
Program

Definition:

▪ A program is the complete and functional set of


instructions that can be compiled and executed to
perform a task.

▪ In this case, the entire block of C++ code


represents the Hello World program.

9
Program

▪ The whole block of code, when compiled and


executed, forms a program that outputs "Hello,
World!" to the console.

10
Instruction

Definition:

▪ An instruction is a single command or operation


within the program that the CPU executes.

▪ This is an instruction that tells the computer to


print "Hello, World!" to the console.

11
Benefits of Programming Languages

▪ Programming languages offer a variety of benefits


that enable individuals and organizations to solve
problems, create software, and automate tasks.

Here are some key benefits of programming


languages:

12
Benefits of Programming Languages

1. Problem Solving

▪ Programming languages enable the design and


implementation of solutions to a wide variety of
problems, from basic arithmetic to complex
scientific simulations.

Example: Python and MATLAB are widely used in data


science and engineering to solve mathematical and
computational problems.
13
Benefits of Programming Languages

2. Automation of Repetitive Tasks

▪ Programming languages allow for the automation


of repetitive and time-consuming tasks, freeing up
human effort for more complex or creative
activities.

Example: Scripts written in Python or Bash can automate file


management tasks, data entry, and system monitoring..

14
Benefits of Programming Languages

3. High Productivity and Efficiency

▪ High-level programming languages (such as


Python, Java, or C++) allow developers to write less
code to perform complex tasks, increasing
development speed and reducing errors.

Example: Frameworks like Django (Python) or Spring (Java)


provide pre-built components that speed up web
development, allowing developers to focus on higher-level
functionality rather than reinventing common tools. 15
Benefits of Programming Languages

4. Portability

▪ Programs written in many high-level languages can


be run on multiple platforms with little or no
modification.

Example: Java programs, thanks to the Java Virtual Machine


(JVM), can run on any platform that has a JVM installed,
making Java highly portable across different systems like
Windows, macOS, or Linux.
16
Benefits of Programming Languages

4. Portability

▪ Programs written in many high-level languages can


be run on multiple platforms with little or no
modification.

Example: Java programs, thanks to the Java Virtual Machine


(JVM), can run on any platform that has a JVM installed,
making Java highly portable across different systems like
Windows, macOS, or Linux.
17
Benefits of Programming Languages

5. Scalability

▪ Programming languages allow the creation of


scalable applications that can handle increasing
amounts of data, traffic, or complexity over time.

Example: Java, C++, and Python are used to build large-scale


applications like social media platforms (Facebook uses C++
and Python) or cloud services (like Google Cloud, written in
Go and Python).
18
Benefits of Programming Languages

5. Collaboration and Modularity

▪ Programming languages promote modularity,


allowing developers to break down complex
systems into smaller, reusable components or
modules, which improves code maintenance and
allows collaboration among teams

Example: Languages like C++, Python, and Java which allows


for modular code development, making collaboration across
teams easier and code more maintainable. 19
Benefits of Programming Languages

5. Collaboration and Modularity

▪ Programming languages promote modularity,


allowing developers to break down complex
systems into smaller, reusable components or
modules, which improves code maintenance and
allows collaboration among teams

Example: Languages like C++, Python, and Java which allows


for modular code development, making collaboration across
teams easier and code more maintainable. 20
Benefits of Programming Languages

6. Wide Range of Applications

▪ Programming languages are versatile and can be


used to create various types of applications such as
web apps, mobile apps, video games, data analysis
tools, and more.

Example:
• JavaScript is essential for web development (client-side and server-side).
• Swift and Kotlin are used for iOS and Android app development, respectively.
• C++ is popular for game development due to its performance efficiency.
21
Benefits of Programming Languages

7. Cross-Platform Development

▪ Many programming languages enable the creation


of cross-platform applications that can run on
multiple operating systems, reducing development
time and costs.

Example: Using frameworks like Flutter (Dart) or


React Native (JavaScript), developers can build mobile
apps for both Android and iOS platforms from a single
codebase. 22

You might also like