Newsgroups: comp.object Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!happy.colorado.edu!hsrender From: hsrender@happy.colorado.edu Subject: Re: Documenting OO Systems Message-ID: <1991Mar25.145441.1@happy.colorado.edu> Lines: 36 Sender: news@colorado.edu (The Daily Planet) Nntp-Posting-Host: happy Organization: University of Colorado, Boulder References: <9103070342.AA07462@.nextserver.cs.stthomas.edu.cs.stthomas.edu ..> <1991Mar22.120946.1@happy.colorado.edu> <299@orbit.gtephx.UUCP> Date: 25 Mar 91 14:54:40 MDT In article <299@orbit.gtephx.UUCP>, barriost@gtephx.UUCP (Tim Barrios) writes: > In article <1991Mar22.120946.1@happy.colorado.edu>, hsrender@happy.colorado.edu writes: >> After all, which is more like English: >> >> ADD 1 to A GIVING B >> >> or >> B := A + 1 > > right answer, wrong question. we can all think of many > reasons why English isn't what's desirable here. a language to most > accurately represent the problem domain (ie, software design or > requirements) is what is desired. then, for most software engineering > application, the real question becomes which of the following is more > like engineering: > > add 1 to a. english, business > a := a + 1; -- math, engineering, science > a++; // made-up; worrying too much about the underlying target Your answer raises another question: why is the second option more readable than the third? (I'll ignore the question of which is more like engineering, because I have no idea how one measures the "engineeringness" of an expression.) I would postulate that it is because of experience. Most engineers learn to program in some form of block-structured language, so anything that looks like a block-structured language is immediately recognizable to them. But is this a better means of expression? I recall that at Syracuse they were teaching some of their intro students to program in Prolog, and they reported no ensuing problems in later CS courses. At Indiana and MIT I believe they teach Scheme to intro people, and both of them seem to produce good CS people. So, is it simply convention that makes us prefer "a := a + 1" to "a++"? After all, I never saw anything even vaguely like "a := a + 1" in any math or science course, so I can't believe I had any prior familiarity with it. hal.