They tell the computer how to do something using a sequence of commands called imperatives- do this, do that
Characteristics:
> The code runs one line after another, it supports selection,iteration and assignment.
>Uses variables
>Programs are built in modules, which contain instructions to define exactly how the program should run
Global variables are declared at the start of the program and are accessible throughout the program.
Local variables are defined inside procedures and are only visible to them.
Python Snowflakes:
Advantages and disadvantages of procedural language:
Advantages:- Excellent for general purpose programming- Many books and references available on well-tried and tested coding algorithms- Good level of control without having to know precise target CPU details- Portable source code - use a different compiler to target a different CPUDisadvantages:- As there are so many procedural languages, a programmer tends to have to specialise in a particular language in order to get work- Need to be very precise and knowledgeable about programming instructions, and so a fully de-bugged working program takes more time to put together- Not as efficient as hand-crafted source code written in a low level language
No comments:
Post a Comment