Talk:Procedural programming: Difference between revisions

Content deleted Content added
Gazpacho (talk | contribs)
No edit summary
Line 18:
==Procedural vs. Declarative==
The concept of procedural languages is used to contrast with declarative languages. Some languages have features of both, such as LISP or other functional languages (which are not primarily declarative as the declarative language article states). The difference is procedural describes "what" a program does and "how" it does it. Declarative simply states the form of what is expected (Logic-based programming). I would suggest someone clean this up and add it/ edit this article (I have never done so, and don't know if I should dare make this my first). More detailed information can be found in Concepts of Programming Languages by Robert W. Sebesta.
OO being a subclass of procedural is a tough call. It is certainly more procedural thenthan declarative, but OO describes a different set of ideas than procedural or declarative. (abstraction, inheritance...etc..) It seems possible that there could be an OO logic-based language, so I would say OO is not only procedural.
Also, the openningopening statement includingincludes: functions should not be confused with mathematical function, seems wrong. They should be confused / thought of as nearly the same. I am sure there is article on here further detailing this: given input a function produces a single output. -has
 
:[http://www.cs.chalmers.se/~nordland/ohaskell/ O'Haskell] is an example of a ''technically'' non-procedural OO language. The non-proceduralness is buried under a lot of syntactic sugar, but it's there. ML and Lisp are both functional languages where the functions can have side effects, which makes them distinct from mathematical functions. [[User:Gazpacho|Gazpacho]] 04:52, 27 October 2005 (UTC)
----
What are these side-effects. In Common LISP an other versions sure there are side-effects, and in fact there are many things which Lisp imperative. However, in pure Lisp, which is a true functional language, then I can not think of any side-effects. When you use a subroutine to simply return a single value, then it is considered a function. The term function is not defined by what languages have made functions and then expanded to make something different than functions. It is a term in programming originating from subroutines that are true functions, as in like mathematical functions. Programming languages on computers are no stronger than recursively enumerable langauges which can be defined according to recursive functions, which are highly "mathematical". Basically, I am saying every program could be written as a set of mathematical functions (it may be a huge list of them, but it is possible - you learn this in the study of formal languages). -has