<s>
Procedural	B-Application
programming	I-Application
is	O
a	O
programming	O
paradigm	O
,	O
derived	O
from	O
imperative	B-Application
programming	I-Application
,	O
based	O
on	O
the	O
concept	O
of	O
the	O
procedure	O
call	O
.	O
</s>
<s>
The	O
first	O
major	O
procedural	B-Application
programming	I-Application
languages	I-Application
appeared	O
circa	O
1957	O
–	O
1964	O
,	O
including	O
Fortran	B-Application
,	O
ALGOL	B-Language
,	O
COBOL	B-Application
,	O
PL/I	B-Language
and	O
BASIC	O
.	O
</s>
<s>
Pascal	B-Application
and	O
C	B-Language
were	O
published	O
circa	O
1970	O
–	O
1972	O
.	O
</s>
<s>
Computer	O
processors	O
provide	O
hardware	O
support	O
for	O
procedural	B-Application
programming	I-Application
through	O
a	O
stack	B-General_Concept
register	I-General_Concept
and	O
instructions	O
for	O
calling	O
procedures	O
and	O
returning	O
from	O
them	O
.	O
</s>
<s>
Hardware	O
support	O
for	O
other	O
types	O
of	O
programming	O
is	O
possible	O
,	O
but	O
no	O
attempt	O
was	O
commercially	O
successful	O
(	O
for	O
example	O
Lisp	B-Operating_System
machines	I-Operating_System
or	O
Java	B-Language
processors	I-Language
)	O
.	O
</s>
<s>
Modularity	B-Architecture
is	O
generally	O
desirable	O
,	O
especially	O
in	O
large	O
,	O
complicated	O
programs	O
.	O
</s>
<s>
Inputs	O
are	O
usually	O
specified	O
syntactically	O
in	O
the	O
form	O
of	O
arguments	O
and	O
the	O
outputs	O
delivered	O
as	O
return	B-Language
values	I-Language
.	O
</s>
<s>
Scoping	B-Language
is	O
another	O
technique	O
that	O
helps	O
keep	O
procedures	O
modular	B-Architecture
.	O
</s>
<s>
Less	O
modular	B-Architecture
procedures	O
,	O
often	O
used	O
in	O
small	O
or	O
quickly	O
written	O
programs	O
,	O
tend	O
to	O
interact	O
with	O
a	O
large	O
number	O
of	O
variables	O
in	O
the	O
execution	O
environment	B-Device
,	O
which	O
other	O
procedures	O
might	O
also	O
modify	O
.	O
</s>
<s>
Because	O
of	O
the	O
ability	O
to	O
specify	O
a	O
simple	O
interface	O
,	O
to	O
be	O
self-contained	O
,	O
and	O
to	O
be	O
reused	O
,	O
procedures	O
are	O
a	O
convenient	O
vehicle	O
for	O
making	O
pieces	O
of	O
code	O
written	O
by	O
different	O
people	O
or	O
different	O
groups	O
,	O
including	O
through	O
programming	B-Library
libraries	I-Library
.	O
</s>
<s>
Procedural	B-Application
programming	I-Application
languages	I-Application
are	O
also	O
imperative	B-Application
languages	I-Application
,	O
because	O
they	O
make	O
explicit	O
references	O
to	O
the	O
state	O
of	O
the	O
execution	O
environment	B-Device
.	O
</s>
<s>
This	O
could	O
be	O
anything	O
from	O
variables	O
(	O
which	O
may	O
correspond	O
to	O
processor	B-General_Concept
registers	I-General_Concept
)	O
to	O
something	O
like	O
the	O
position	O
of	O
the	O
"	O
turtle	O
"	O
in	O
the	O
Logo	O
programming	O
language	O
.	O
</s>
<s>
Often	O
,	O
the	O
terms	O
"	O
procedural	B-Application
programming	I-Application
"	O
and	O
"	O
imperative	B-Application
programming	I-Application
"	O
are	O
used	O
synonymously	O
.	O
</s>
<s>
However	O
,	O
procedural	B-Application
programming	I-Application
relies	O
heavily	O
on	O
blocks	O
and	O
scope	B-Language
,	O
whereas	O
imperative	B-Application
programming	I-Application
as	O
a	O
whole	O
may	O
or	O
may	O
not	O
have	O
such	O
features	O
.	O
</s>
<s>
As	O
such	O
,	O
procedural	B-Application
languages	I-Application
generally	O
use	O
reserved	O
words	O
that	O
act	O
on	O
blocks	O
,	O
such	O
as	O
if	O
,	O
while	O
,	O
and	O
for	O
,	O
to	O
implement	O
control	O
flow	O
,	O
whereas	O
non-structured	B-Application
imperative	B-Application
languages	I-Application
use	O
goto	B-Application
statements	O
and	O
branch	O
tables	O
for	O
the	O
same	O
purpose	O
.	O
</s>
<s>
The	O
focus	O
of	O
procedural	B-Application
programming	I-Application
is	O
to	O
break	O
down	O
a	O
programming	O
task	O
into	O
a	O
collection	O
of	O
variables	O
,	O
data	B-General_Concept
structures	I-General_Concept
,	O
and	O
subroutines	O
,	O
whereas	O
in	O
object-oriented	B-Language
programming	I-Language
it	O
is	O
to	O
break	O
down	O
a	O
programming	O
task	O
into	O
objects	O
that	O
expose	O
behavior	O
(	O
methods	O
)	O
and	O
data	O
(	O
members	O
or	O
attributes	O
)	O
using	O
interfaces	O
.	O
</s>
<s>
The	O
most	O
important	O
distinction	O
is	O
that	O
while	O
procedural	B-Application
programming	I-Application
uses	O
procedures	O
to	O
operate	O
on	O
data	B-General_Concept
structures	I-General_Concept
,	O
object-oriented	B-Language
programming	I-Language
bundles	O
the	O
two	O
together	O
,	O
so	O
an	O
"	O
object	O
"	O
,	O
which	O
is	O
an	O
instance	O
of	O
a	O
class	O
,	O
operates	O
on	O
its	O
"	O
own	O
"	O
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
The	O
principles	O
of	O
modularity	B-Architecture
and	O
code	O
reuse	O
in	O
practical	O
functional	B-Language
languages	I-Language
are	O
fundamentally	O
the	O
same	O
as	O
in	O
procedural	B-Application
languages	I-Application
,	O
since	O
they	O
both	O
stem	O
from	O
structured	B-Language
programming	I-Language
.	O
</s>
<s>
Functions	O
and	O
their	O
modularly	O
separated	O
from	O
each	O
other	O
in	O
the	O
same	O
manner	O
,	O
by	O
the	O
use	O
of	O
function	O
arguments	O
,	O
return	B-Language
values	I-Language
and	O
variable	O
scopes	O
.	O
</s>
<s>
The	O
main	O
difference	O
between	O
the	O
styles	O
is	O
that	O
functional	B-Language
programming	I-Language
languages	I-Language
remove	O
or	O
at	O
least	O
deemphasize	O
the	O
imperative	B-Application
elements	O
of	O
procedural	B-Application
programming	I-Application
.	O
</s>
<s>
The	O
feature	O
set	O
of	O
functional	B-Language
languages	I-Language
is	O
therefore	O
designed	O
to	O
support	O
writing	O
programs	O
as	O
much	O
as	O
possible	O
in	O
terms	O
of	O
pure	B-Application
functions	I-Application
:	O
</s>
<s>
Whereas	O
procedural	B-Application
languages	I-Application
model	O
execution	O
of	O
the	O
program	O
as	O
a	O
sequence	O
of	O
imperative	B-Application
commands	O
that	O
may	O
implicitly	O
alter	O
shared	O
state	O
,	O
functional	B-Language
programming	I-Language
languages	I-Language
model	O
execution	O
as	O
the	O
evaluation	O
of	O
complex	O
expressions	O
that	O
only	O
depend	O
on	O
each	O
other	O
in	O
terms	O
of	O
arguments	O
and	O
return	B-Language
values	I-Language
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
functional	B-Language
programs	I-Language
can	O
have	O
a	O
free	O
order	O
of	O
code	O
execution	O
,	O
and	O
the	O
languages	O
may	O
offer	O
little	O
control	O
over	O
the	O
order	O
in	O
which	O
various	O
parts	O
of	O
the	O
program	O
are	O
executed	O
;	O
for	O
example	O
,	O
the	O
arguments	O
to	O
a	O
procedure	O
invocation	O
in	O
Scheme	B-Language
are	O
evaluated	O
in	O
an	O
arbitrary	O
order	O
.	O
</s>
<s>
Functional	B-Language
programming	I-Language
languages	I-Language
support	O
(	O
and	O
heavily	O
use	O
)	O
first-class	B-Application
functions	I-Application
,	O
anonymous	B-General_Concept
functions	I-General_Concept
and	O
closures	B-Language
,	O
although	O
these	O
concepts	O
have	O
also	O
been	O
included	O
in	O
procedural	B-Application
languages	I-Application
at	O
least	O
since	O
Algol	B-Language
68	I-Language
.	O
</s>
<s>
Functional	B-Language
programming	I-Language
languages	I-Language
tend	O
to	O
rely	O
on	O
tail	B-Language
call	I-Language
optimization	I-Language
and	O
higher-order	B-Language
functions	I-Language
instead	O
of	O
imperative	B-Application
looping	O
constructs	O
.	O
</s>
<s>
Many	O
functional	B-Language
languages	I-Language
,	O
however	O
,	O
are	O
in	O
fact	O
impurely	O
functional	B-Language
and	O
offer	O
imperative/procedural	O
constructs	O
that	O
allow	O
the	O
programmer	O
to	O
write	O
programs	O
in	O
procedural	B-Application
style	O
,	O
or	O
in	O
a	O
combination	O
of	O
both	O
styles	O
.	O
</s>
<s>
It	O
is	O
common	O
for	O
input/output	B-General_Concept
code	O
in	O
functional	B-Language
languages	I-Language
to	O
be	O
written	O
in	O
a	O
procedural	B-Application
style	O
.	O
</s>
<s>
There	O
do	O
exist	O
a	O
few	O
esoteric	O
functional	B-Language
languages	I-Language
(	O
like	O
Unlambda	B-Language
)	O
that	O
eschew	O
structured	B-Language
programming	I-Language
precepts	O
for	O
the	O
sake	O
of	O
being	O
difficult	O
to	O
program	O
in	O
(	O
and	O
therefore	O
challenging	O
)	O
.	O
</s>
<s>
These	O
languages	O
are	O
the	O
exception	O
to	O
the	O
common	O
ground	O
between	O
procedural	B-Application
and	O
functional	B-Language
languages	I-Language
.	O
</s>
<s>
In	O
logic	B-Language
programming	I-Language
,	O
a	O
program	O
is	O
a	O
set	O
of	O
premises	O
,	O
and	O
computation	O
is	O
performed	O
by	O
attempting	O
to	O
prove	O
candidate	O
theorems	O
.	O
</s>
<s>
From	O
this	O
point	O
of	O
view	O
,	O
logic	B-Language
programs	I-Language
are	O
declarative	B-Language
,	O
focusing	O
on	O
what	O
the	O
problem	O
is	O
,	O
rather	O
than	O
on	O
how	O
to	O
solve	O
it	O
.	O
</s>
<s>
However	O
,	O
the	O
backward	O
reasoning	O
technique	O
,	O
implemented	O
by	O
SLD	B-Application
resolution	I-Application
,	O
used	O
to	O
solve	O
problems	O
in	O
logic	B-Language
programming	I-Language
languages	I-Language
such	O
as	O
Prolog	B-Language
,	O
treats	O
programs	O
as	O
goal-reduction	O
procedures	O
.	O
</s>
<s>
Experienced	O
logic	O
programmers	O
use	O
the	O
procedural	B-Application
interpretation	O
to	O
write	O
programs	O
that	O
are	O
effective	O
and	O
efficient	O
,	O
and	O
they	O
use	O
the	O
declarative	B-Language
interpretation	O
to	O
help	O
ensure	O
that	O
programs	O
are	O
correct	O
.	O
</s>
