[prog] re the difference between various types of programming languauges, oo, logic etc

Robert J. Hansen rjh at sixdemonbag.org
Mon Mar 24 13:26:50 EST 2003


> What's the difference? Why would you use a particular type over another? (or 
> learn a particular type over another for that matter :)).

Some problems are easier in certain paradigms than others.  For
instance, pure math is beautifully simple in a functional style as
opposed to a procedural or OO.  Expert systems are much easier to build
in a logic-based language.  GUI toolkits just scream for object
orientation.  Etc.

The real difference is: learning different methods of computation
(functional, procedural, logical, object-oriented) will open your mind
to new ways of solving old problems.  Then when new problems come along,
you'll have a much larger base of techniques with which to address them.

> I have currently learnt one language (python) which can do OO programming or 
> functional programming (is think that's correct....).

Python advocates will say that you can do FP in Python; FP advocates
will say that Python lacks a strong lambda statement, closures, and
other important FP techniques.

> I don't fully understand the difference between a procedural and functional 
> programming language.....

... Functional programming is _way_ too large a subject for me to do it
justice in an email.  So instead, here are some good books on functional
programming:

Graham, Paul.  ANSI Common LISP.
Ullmann, Jeffrey D.  Elements of ML Programming.
Paulson, L.C.  ML for the Working Programmer
MIT Press.  Structure and Interpretation of Computer Programs
Friedman and Felleisen.  The Little LISPer, The Seasoned LISPer.
Friedman and Felleisen.  The Little Schemer, The Seasoned Schemer.
Friedman and Felleisen.  The Little MLer, The Seasoned MLer.

... I'd start with one of the Friedman/Felleisen "Little $Fooer" books:
it'll get you up-to-speed in a functional language.  By the end of it
you'll have enough of a grounding in a functional language to make sense
of the more advanced books.  Paul Graham's text is _wonderful_; best $55
I've ever spent on a computer book.  SICP and Paulson are also excellent
texts.  (SICP is available for free on the Web: but as a word of
warning, it's a _tough_ textbook.  Very much worth the reading, though.)

> And lisp....that's a functional language isn't it?

LISP is a language for writing computer languages.  I've never seen any
LISP application of any reasonable size which didn't define its own
computer language specifically for the purpose of solving a problem. 
I've seen a complete ISO PROLOG implementation written in 180 lines of
LISP, for instance--LISP is that flexible.  Some people say that degree
of flexibility is a liability, but...




More information about the Programming mailing list