Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!fdurt1!wisdom!tronsbox!dfrancis From: dfrancis@tronsbox.xei.com (Dennis Heffernan) Newsgroups: comp.sys.amiga.programmer Subject: Re: Functional Programming (Re: Good programmers and assembly language) Message-ID: <1529@tronsbox.xei.com> Date: 9 Apr 91 04:14:49 GMT References: <7214@harrier.ukc.ac.uk> <1523@tronsbox.xei.com> <7235@harrier.ukc.ac.uk> Organization: Romantic Encounters BBS Lines: 50 In article <7235@harrier.ukc.ac.uk> mr3@ukc.ac.uk (M.Rizzo) writes: |I think you've made a very hasty comment there. You are obviously put |off by the notation and confused by the totally different approach to |imperative programming languages such as C that most people are |used to. That's not a hasty comment; that's one based on all the code I've seen from such wonderful languages as C, C++ and SmallTalk that look like line noise. I'd rather learn assembly than spend my life pondering strings of non- alphanumeric symbols. | |But if you know how the quick sort algorithm works (you'll find this in |any decent algorithms book) you should be able to understand those |three lines if you think about it. They're almost a specification of |quick sort rather than an implementation ! Familiarity with set and |function notation in Mathematics is also very useful. Just to help you |along if you want to understand it better: | [...] |The third line is obviously using recursion. In my opinion this line |captures the essence of the quick sort algorithm very elegantly. Again |think of how many PASCAL or C statements you'd need to implement |quicksort (more the so for assembler). Don't care how many lines it takes. If there was a language with the power of C or assembler and the readability of Cobol, I'd marry it. As it stands, anything I write other than rexx scripts gets either flow charted or psudo-coded first, and THEN I worry about the assembler code. It'd be pointless for me to go through all that and then put all the real code on three lines. |I can assure you that languages such as Miranda, Hope and ML, do |provide significant advantages over traditional programming languages. |Their authors have analyzed the shortcomings of traditional languages |and written new ones to overcome them. A very good introduction to |such languages is given in "An Introduction to Functional Programming" |by Bird & Wadler (published by Prentice-Hall) for anyone who's interested. |Increasingly more universities are including functional programming in |their undergraduate courses - there are even opinions that a functional |language should replace Pascal as the traditional first language taught |at university. The book review collumn in the current Byte covers some books that take the opposite stance. dfrancis@tronsbox.xei.com ...uunet!tronsbox!dfrancis GEnie: D.HEFFERNAN1 ------------------------------------------------------------------------------ "Using C will definitely cut your life expectancy by 10 years or more." --Carl Sassenrath, GURU'S GUIDE TO THE COMMODORE AMIGA #1