Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!dimacs.rutgers.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: <1535@tronsbox.xei.com> Date: 12 Apr 91 01:25:41 GMT References: <7235@harrier.ukc.ac.uk> <1529@tronsbox.xei.com> <7256@harrier.ukc.ac.uk> Organization: Romantic Encounters BBS Lines: 134 In article <7256@harrier.ukc.ac.uk> mr3@ukc.ac.uk (M.Rizzo) writes: |In article <1529@tronsbox.xei.com> dfrancis@tronsbox.xei.com (Dennis Heffernan) writes: |> 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. | |Is this some kind of a joke or what ? Do you honestly believe that |the thousands of people using the above-mentioned languages are a |bunch of idiots and you are some supreme programmer because you use |assembler ? No, worm, it's a personal preference. (Oh, I'M sorry, you DIDN'T want to be insulted? Next time keep a civil tongue in your head.) Last time I looked, ten million programmers don't all live up the same street. | |Did you ever try to learn one of the above languages properly before |making up your mind ? (By properly I mean using a language for at |least three months and working on exercises and at least a small project, |all with the help of at least one decent book). "Seeing code" as you |put it is far from being enough. I spent the better part of a year wrestling with C. I spent most of that time tripping over stupid syntactical errors brought about by the hieroglyphic-like nature of the language. |>|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. | |Less lines = less redundancy & more conciseness |The less code and unneccessary details you have, the easier it is |to figure out what is going on. An assembler listing is full of |unimportant details as far as an algorithm is concerned. An |AVERAGE Miranda programmer could easily recognize a quicksort in |Miranda in a few seconds. An EXPERT assembler programmer would take |minutes to recognize a quicksort written in assembler (ignoring |helpful identifiers in both cases of course). Still don't care how many lines it takes. Since I don't code without extensive comments, I never have a problem looking at my old stuff. I've met C programmers who can't read code they wrote a year ago, too. | |>If there was a language with the |>power of C or assembler and the readability of Cobol, I'd marry it. | |Readability of Cobol ? What a joke ! Readability does not mean using |long English sentences. Cobol is horrible to look at - its all |cluttered and has no parameter passing mechanism. I'd like to see |how readable quicksort would be in COBOL - it doesn't even allow |recursion so you'll have to manage a stack as well, and all this |using global variables - what a mess! Read it again. 90% of what you object to is how Cobol works, not how readable it is. (A friend who works with Cobol and BAL once told me of an incident at work. He showed a piece written in Cobol to another programmer who only did BAL, and she said "It's nice pseudocode, but what about the real program?") | |The syntax of a language isn't the only factor when it comes to |readability. The features provided by the language are |important factors as well e.g. local environments, apart from |being important for information hiding, make a program more |readable because the variables are declared close to where they |are used and not hundreds of lines further up in some global |DATA DIVISION or whatever COBOL calls it. Which is why I didn't say I would use Cobol. Try working more with English instead of Miranda. :-) | |>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. | |No it wouldn't be pointless - it would save you a lot of time and |would allow you to try out your program as quickly as possible |without having to think about all the niggly details of assembler. |Gee - it seems that you ENJOY making work MORE TEDIOUS for yourself ! That's what ARexx is for. | |>|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. | |Don't have the latest BYTE yet (I assume you're referring to April) so |I can't comment. However I'm pretty sure these books don't say anything |like you're saying about high-level languages. No, from the excerpts in the review, I'd say they're more critical. From what I saw, it looks like they take the position that functional languages are a total waste of time. I only said that I didn't like them. |Sorry, but as far as I'm concerned, you are living proof that assembler |does not separate the men from the boys. Why don't you try reading a |few good books like Grady Booch's "Object-Oriented Design" which will |give you solid examples and reasoning about the advantages of OOP |languages like C++ and Smalltalk. Follow-ups to comp.misc for |those interested in continuing this thread - I'm not :-) Because I don't give a damn about "Object Oriented Programming". I have never actually heard anyone give a clear, concise description of just what this is supposed to get me, as a programmer. That includes my sysadmin, who lives for C++. Last time I checked, Allah had yet to send a new prophet to hand down the One True Way to program. dfrancis@tronsbox.xei.com ...uunet!tronsbox!dfrancis GEnie: D.HEFFERNAN1 ------------------------------------------------------------------------------ "I swear eternal hostility to all forms of tyranny over the Amiga OS." --me, with apologies to Thomas Jefferson and Alexander Addington :-)