Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!hc!lanl!unm-la!unmvax!nmtsun!warner@hydrovax.nmt.edu From: warner@hydrovax.nmt.edu (M. Warner Losh) Newsgroups: comp.lang.fortran Subject: Re: i++, i+=1, i=i+1 Summary: Mild flaming on this stupid topic. Message-ID: <1123@nmtsun.nmt.edu> Date: 15 Sep 88 19:02:18 GMT Sender: news@nmtsun.nmt.edu Organization: New Mexico Tech Hydrology Program Lines: 45 In article <3629@lanl.gov>, jlg@lanl.gov (Jim Giles) writes... >My english description of 'i = i + 1' _is_ "add 1 to i". the difference >between that and 'i += 1' is purely textual. It's easy to write a >preprocessor to switch the later to the former. Such a preprocessor >needn't have _any_ semantic knowledge of the target language. It need >only look for '+=' and replace it with '= _X_' where _X_ is whatever >token preceeds the '+='. In other words, as far as functionality >goes, '+=" doesn't do a damn thing. mild flame on As Chris has already pointed out, += doesn't do much for you in terms of functionality. It is more convient to use this notation. If you want to get really technical, then you should be programming in Turing machine logic, since it offers no more functionality than C or FORTRAN or any modern computer language. It has several probelms: 1) it is totally gross and unclear and 2) it takes several pages to do what you can do in FORTRAN or C in one line. That is why we do things in C or FORTAN, and not in Assmebler or Turning machine langues. The standard usage in 'C' (meaning, this is how most 'C' programmers program, not what *MUST* be done) is to use += or ++ . There was a time when += or ++ produced better code. That is why they were introduced to the language (I think, I haven't actually asked K&R). Since they are in wide spread use, must 'C' programmers know how to interpret these strange symbols. FORTRAN programmers will have some trouble here, since there is no EXACT analog in FORTRAN. This doesn't mean that they can't learn how to read them, it just means that it is hard at first. major flame on Can we now get back to talking about FORTRAN, and what the damn committee is doing to our FORTRAN? Ppppppplease? flame off C isn't FORTRAN. FORTRAN isn't C. >J. Giles >Los Alamos -- Warner Losh warner@hydrovax.nmt.edu ...!unmvax!nmtsun!warner%hydrovax "I don't know what language they will be programming in in the year 2000, but it will be called FORTRAN." -- Some one else... My spelling and views are my own. Only the vowels have been changed....