Question:
what is the differences between functional,imperative,logic and object-oriented programming?
searchforyatin
2006-02-04 12:50:05 UTC
what is the differences between functional,imperative,logic and object-oriented programming?
Three answers:
ben_fulton2000
2006-03-06 19:28:33 UTC
Functional languages emphasize the evaluation of expressions, rather than the execution of commands. So in an imperative language like C, you might write



total = 0;

for (i = 0; i<10; ++i) total += i;



But in a functional language like Scheme, you would write it as a function instead:



(define sum

(lambda (from total)

(if (= 0 from)

total

(sum (- from 1) (+ total from)))))

(sum 10 0)



By logic programming, you probably mean Prolog. Logic programming languages, in general, are programming languages which incorporate some of the language of mathematical logic; unification and backtracking search are common operational features.



But most modern, popular languages are object-oriented, which means that objects can be defined and instantiated, and send messages to other objects. C++, C#, and Java are all object-oriented languages.
anonymous
2016-10-22 12:31:25 UTC
Functional Imperative
Vara
2006-02-04 15:02:59 UTC
the basic difference b/w functional programming and object oriented programming is that,in the functional programming the program compiler follows top-down approach.where as in an object oriented programming the compiler follows bottom up approach.

in functional language the prime logics are seperated function wise.these functions are to be called by the main program.but in the object oriented programming the logics form classes,a new revolution in depicting real time problems in the computer understandable way.its also acheived in functional but in oop language these classes contain all the member variables and also the member functions.this process is called encapsulations of data. the manipulation data is done through objects which are derived from class datatype.this is caleed abstraction.

if you need more information ask me i will send you an e-boo.bye


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...