Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Imperative and Procedural

Name: Anonymous 2011-08-06 1:20

What's the difference?

Name: Anonymous 2011-08-06 1:23

I think procedural has to do with things needing to be done in order and imperative is data being held in changeable state

Name: Anonymous 2011-08-06 1:27

>>2

i agree

Name: Anonymous 2011-08-06 1:32

Then wouldn't all small programs be procedural?

Name: Anonymous 2011-08-06 1:33

>>1
They aren't mutually exclusive properties of programming languages. Procedural languages ARE imperative. But not all imperative languages are strictly procedural.

Name: Anonymous 2011-08-06 1:40

>>4
At the end of the day, all programs are just sequences of machine instructions or VM byte-code (which is essentially the same thing as there is an isomorphism between the two) that perform transformations on data in memory (registers, RAM, disk storage, etc.)

The CPU doesn't give a rats ass if your program was originally written in an imperative or declarative language. All it cares is that it has a sequence of instructions to execute. Most machine languages are imperative themselves as CPUs are essentially state machines.

Name: Anonymous 2011-08-06 1:41

>>6

i was thinking more on a high level. something reflected on my code. the article above is a good example of that

Name: Anonymous 2011-08-06 1:46

>>2
You don't know jack shit, stop spouting bullshit if you don't even have a remote idea.

>>5 is more inline with the truth.

Imperative programming is stateful. The opposite of imperative programming is declarative, or non-stateful.

Procedural, structured and object-oriented languages are often imperative (although you can also have a declarative object-oriented language).

Functional and logical languages are often declarative in nature, but don't have to be... imperative languages can also have functional primitives like higher-order functions, lambdas, etc.

There are also many other sub-paradigms, most of which are not really mutually exclusive with one another.

You can have languages that support both imperative and declarative programming (Lisp).

Don't change these.
Name: Email:
Entire Thread Thread List