difference between procedural programming and functional programming

A functional language (ideally) allows you to write a mathematical function, i.e. a function that takes narguments and returns a value. If the program is executed, this function is evaluated.

A procedural language, on the other hand, performs a series of sequential steps, where the functional program would be nested. There’s a way of transforming sequential logic into functional logic calledcontinuation passing style.

As a consequence, a purely functional program always yields the same value for an input, and the order of evaluation is not well-defined; which means that uncertain values like user input or random values are hard to model in purely functional languages.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s