This PPT explains what you should know before you start learning to program a computer. It will help students not to by heart the syntax of a programming language.
What you should know before starting to learn programming?
1. This video is a part of baabtrans’
effort to make life easier for people
who want to learn programming
and information technology
industry
2.
3. FORMAL and Natural Languages
• Natural Language
– English, Malayalam, Hindi, Tamil, Kannada
• Formal Language
– Languages that are designed by people for specific
applications
– Ex. 2H + O H2O
– Programming languages are formal languages
– Strict rules and syntax
4. Difference between formal and natural
languages
• Ambiguity
– Natural = Contextual
• Redundancy
– Natural = More verbose
• Literalness
– Formal = Exact meaning. No symbolic meaning
5. Programming Languages
Programming Languages are formal languages
What is a program?
A program is a sequence of instructions that
specifies how to perform a computation. It
can be written in any language.
6. Programming
• It can be defined as the process of breaking
complex, large task into smaller and smaller
subtasks until the subtasks are simple enough
to be performed with sequences of these
basic instructions
7. Basic Instructions
Input
Get data from the keyboard, a file, or some other
device.
Output
Display data on the screen or send data to a file
or other device.
math and logic
Perform basic mathematical operations like
addition, and multiplication, and logical
operations like and, or, and not.
8. Conditional execution
Check for certain conditions and execute the
appropriate sequence of statements.
Repetition
Perform some action repeatedly, usually with
some variation.
9. Debugging
• debugging is the process of locating and fixing
or bypassing bugs (errors) in computer
program code or the engineering of a
hardware device
– Identify the problem
– Isolate the source of program. Remember ultimately computer
processes only one instruction at a time.
– Fix it
• Frustrating but most challenging job. Especially when you are
working in a live environment.
• Trial and error is a bad way of debugging.
10. Syntax errors
• Syntax refers to the structure of a program
and the rules about that structure. For
example, in English, a sentence must begin
with a capital letter and end with a period.
this sentence contains a syntax error.
• Initial days of coding you will find it difficult to
fix the syntax errors. But later you will tend to
reduce the errors. It is like changing gear while
you learn driving.
11. Runtime Errors
• These errors which appear when you start
running a program. These can be called as
exceptions. Exceptions can be handled while
coding. If you handle all the exceptions, the
program will not stop abruptly while running.
• If exceptions are not handled properly, the
users will get non-user friendly messages.
12. Semantic Errors/Logical Errors
• There won’t be any error but you will not get
the desired output.
• For example
int average(int a, int b)
{
return a + b / 2; /* should be (a + b) / 2 */
}
13. Tokens & Structure
• Basic elements of a language
– Keywords, identifier etc
– int, main etc.
• Structure
– How the tokens are arranged
– Example structure of a function
14. Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com