From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Should I learn C or Pascal? Date: 1996/07/20 Message-ID: #1/1 X-Deja-AN: 169089279 references: <4rs76l$aqd@ccshst05.uoguelph.ca> <4sdlco$rtl@nntp.seflin.lib.fl.us> <4sf9e7$kl7@news.jump.net> <01bb74ac$b7aa7860$7b91f780@deangulo> <01bb7591$83087d60$87ee6fce@timpent.airshields.com> <4sord0$l0k@solaria.cc.gatech.edu> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.c,comp.lang.c++,comp.lang.ada Date: 1996-07-20T00:00:00+00:00 List-Id: "An algorithm is just a set of instructions on how to accomplish a task. An algorithm does not depend at all on any sort of programming "language". In fact, I was taught that you should write out your "game plan" and psuedo code before you even touch any sort of syntax in any language. Yes, I do tend to write up my psuedo-code in a C-like syntax frequently but you don't need to. Loop until variable is equal to 7 Add 1 to variable Print out the following string to screen: ;-) end of loop There's an algorithm written in plain english. It's a stupid algorithm," First of all "pseudo-code" is still written in a language, which has syntax and semantics. The trouble with an algorithm written in "plain english" like the above is that it is imprecise. For example does the string that is written to screen include a leading blank? I have no idea from the above. If variable is 2**32-1, does the above still work? I have no idea. Are the strings on separate lines of the screen? I have no idea. writing while variable /= 7 loop variable := variable + 1; put_line (";-)"); end loop; is less writing than you did, just as clear, and importantly, exactly precise (I had to make some guesses as to what your intention was, but if my guesses were wrong, the above is easily modified to accomodate them). Writing at a high semantic level is desirable, and your example would have been much more effective if for example it had included universal quantification over finite sets, but that too would better be written in a well-defined language. If you went a step further, and wrote non-effective computation steps involving for example membership in infinite sets, then of course what you wrote would not correspond to an executable program, but would still be better written in a precise language (e.g. one of the many specification languages like Z) Writing in "plain english" may appeal to those who are petrified of formal notation of any kind, but such people are not likely to get very far in this field anyway!