Rate Today's Posts, 12/1/2008 - Monday

Search:

Please Sign In or Register  |  Set as Homepage

Problem of Expression Evaluation in Programming Languages   Rating: (3.4 / 10)    Views: 1,768

Submitted By: Bensen on 10/29/2006. (  |  Share  |  Clikk It! )   

Your Ad Here


In traditional mathematics we have the benefit of being able to see the whole flow of a problem. There is a definitive beginning and end and everything in between is statically drawn out. With computer programs we are dealing with dynamic processes where we must deal with dynamic rules and explicitly draw out many of the rules we use all the time in mathematics and we must deal with some new problems that arise when we try and represent mathematical problems and constructs in terms of computer processes that exist in memory.

For instance in traditional mathematics we may have an expression, something of the sort of x = 3 – 2x, which of course would evaluate to x = 1 regardless of any previous value of x. In programs however this would not be the case. In fact here x would equal three minus whatever x was before times two. Hence x must be explicitly initialized to some value and stored somewhere before the execution of that statement would make any sense in the context of the program.

In mathematics we don’t have this limitation. But in programs we have to have a way to represent a variable in terms of itself and store it somewhere for later use, so that we can do some operation using the variable, such as an operation on the variable in terms of itself. Programs deal primarily with values and not with equations. True, values might be applied to equations, but those equations must be statically placed in a program. In contrast in mathematics we deal primarily with equations. This contrast between values and equations can lead to a whole set of subtle differences in the way we deal with variables in programs.
Further, in mathematics we frequently deal with multi-dimensional problems such as (x²) / 3. In programs we are dealing with a one dimensional space in that we don’t have a superscript or the like. Because of that, we must deal with precedence rules in a more direct fashion then is often required in regular mathematical practice. In mathematics we can literally just look at the equation and see that some value is a superscript indicating a “square” value or some other arbitrary value. So in the end the problems that we deal with in programming often derive from having to make explicit things which are often implicit in normal mathematical practice and thinking.


Link to this:

* copy and paste the above text into your site to link to this post.


If this post contains copyrighted or otherwise illegal material please let us know by clicking here.
If this post contains adult material please click here so we can place it in the appropriate section.

Comments and Reviews   (Average Member Review: average stars)


Your Ad Here

How would you rate this post?  

Review Title:  

Review:


  I am over the age of 13.



Contribute

New:

SarahSarah
comments please! more                                                                                                                                           

Emma (again)Emma (again)
comments please! more                                                                                                                                 

Random Links From Our Friends

Bored?  Check Out Today's Hotlinks

Popular:

Lacey Chabert 2Lacey Chabert 2
more                                                                                                                                                             

Lacey ChabertLacey Chabert
more                                                                                                                                                                 

Activity

14535 People Online