w1-w2 Programming_basic (1)
w1-w2 Programming_basic (1)
TOPIC 1
• COMPUTER PROGRAMMER
A set of words, symbols and A vocabulary and set of Programming languages can be
codes that enables a programmer grammatical rules (syntax) for used to create computer
to give instruction to a computer. instructing a computer to perform programs.
specific tasks.
Example:
•Let us say that an electric toothbrush has a processor and main memory.
•The processor can rotate the bristles left and right, and can check the on/off switch.
The machine instructions are one byte long, and correspond to the following machine operations:
LOW LEVEL LANGUAGE
ADVANTAGE DISADVANTAGE
Instructions are readily understood by the Instructions are extremely cryptic and difficult to
computer learn
Assembly languages use keywords and symbols, much like English, to form a
programming language but at the same time introduce a new problem.
The problem is that the computer doesn't understand the assembly code, so we
need a way to convert it to machine code, which the computer does
understand.
ADVANTAGE DISADVANTAGE
PROVIDES A STRUCTURED FRAMEWORK IS THE BIG PICTURE OF CREATING AN THE APPLICATION USUALLY CONSISTS
THAT GIVES AN IDEA, HOW TO BUILD A INFORMATION SYSTEM THAT HANDLES OF MANY PROGRAMS.
SYSTEM A MAJOR TASK OF APPLICATION.
PROGRAM DEVELOPMENT LIFE CYCLE (PDLC)
Planning
Deployment
Runtime errors
SYNTAX ERROR
WHAT IS
Paradigms differ in the concepts and methods
PROGRAMMING used to represent the elements of a program
PARADIGM? (such as objects, functions, variables, constraints).
• Advantages
➢ Conceptual simplicity
➢ Faster development
➢ Increased productivity
• Disadvantages
➢ Can have a steep learning curve
➢ Larger program size than procedural programs.
FUNCTIONAL PROGRAMMING
PARADIGM
•
• Functional programming is a subset of declarative programming.
• Programs written using this paradigm use functions, blocks of code intended to
behave like mathematical functions.
• Functional languages discourage changes in the value of variables through
assignment, making a great deal of use of recursion instead.
• Examples are : F#, Haskell, Lisp, Python, Ruby, JavaScript etc.
• Advantages
➢ Small and clean syntax
➢ Better support for reasoning about programs
➢ They allow functions to be treated as any other data values.
➢ They support programming at a relatively higher level than the imperative
languages
• Disadvantages
➢ Requires Lot of Memory
➢ Functional languages use more storage space than their imperative cousins
IMPERATIVE FUNCTIONAL